xfs_itable.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it would be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program; if not, write the Free Software Foundation,
  15. * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  16. */
  17. #ifndef __XFS_ITABLE_H__
  18. #define __XFS_ITABLE_H__
  19. /*
  20. * xfs_bulkstat() is used to fill in xfs_bstat structures as well as dm_stat
  21. * structures (by the dmi library). This is a pointer to a formatter function
  22. * that will iget the inode and fill in the appropriate structure.
  23. * see xfs_bulkstat_one() and xfs_dm_bulkstat_one() in dmapi_xfs.c
  24. */
  25. typedef int (*bulkstat_one_pf)(struct xfs_mount *mp,
  26. xfs_ino_t ino,
  27. void __user *buffer,
  28. int ubsize,
  29. int *ubused,
  30. int *stat);
  31. /*
  32. * Values for stat return value.
  33. */
  34. #define BULKSTAT_RV_NOTHING 0
  35. #define BULKSTAT_RV_DIDONE 1
  36. #define BULKSTAT_RV_GIVEUP 2
  37. /*
  38. * Return stat information in bulk (by-inode) for the filesystem.
  39. */
  40. int /* error status */
  41. xfs_bulkstat(
  42. xfs_mount_t *mp, /* mount point for filesystem */
  43. xfs_ino_t *lastino, /* last inode returned */
  44. int *count, /* size of buffer/count returned */
  45. bulkstat_one_pf formatter, /* func that'd fill a single buf */
  46. size_t statstruct_size,/* sizeof struct that we're filling */
  47. char __user *ubuffer,/* buffer with inode stats */
  48. int *done); /* 1 if there are more stats to get */
  49. typedef int (*bulkstat_one_fmt_pf)( /* used size in bytes or negative error */
  50. void __user *ubuffer, /* buffer to write to */
  51. int ubsize, /* remaining user buffer sz */
  52. int *ubused, /* bytes used by formatter */
  53. const xfs_bstat_t *buffer); /* buffer to read from */
  54. int
  55. xfs_bulkstat_one_int(
  56. xfs_mount_t *mp,
  57. xfs_ino_t ino,
  58. void __user *buffer,
  59. int ubsize,
  60. bulkstat_one_fmt_pf formatter,
  61. int *ubused,
  62. int *stat);
  63. int
  64. xfs_bulkstat_one(
  65. xfs_mount_t *mp,
  66. xfs_ino_t ino,
  67. void __user *buffer,
  68. int ubsize,
  69. int *ubused,
  70. int *stat);
  71. typedef int (*inumbers_fmt_pf)(
  72. void __user *ubuffer, /* buffer to write to */
  73. const xfs_inogrp_t *buffer, /* buffer to read from */
  74. long count, /* # of elements to read */
  75. long *written); /* # of bytes written */
  76. int
  77. xfs_inumbers_fmt(
  78. void __user *ubuffer, /* buffer to write to */
  79. const xfs_inogrp_t *buffer, /* buffer to read from */
  80. long count, /* # of elements to read */
  81. long *written); /* # of bytes written */
  82. int /* error status */
  83. xfs_inumbers(
  84. xfs_mount_t *mp, /* mount point for filesystem */
  85. xfs_ino_t *last, /* last inode returned */
  86. int *count, /* size of buffer/count returned */
  87. void __user *buffer, /* buffer with inode info */
  88. inumbers_fmt_pf formatter);
  89. #endif /* __XFS_ITABLE_H__ */