xfs_itable.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. void *private_data,
  30. xfs_daddr_t bno,
  31. int *ubused,
  32. void *dip,
  33. int *stat);
  34. /*
  35. * Values for stat return value.
  36. */
  37. #define BULKSTAT_RV_NOTHING 0
  38. #define BULKSTAT_RV_DIDONE 1
  39. #define BULKSTAT_RV_GIVEUP 2
  40. /*
  41. * Values for bulkstat flag argument.
  42. */
  43. #define BULKSTAT_FG_IGET 0x1 /* Go through the buffer cache */
  44. #define BULKSTAT_FG_QUICK 0x2 /* No iget, walk the dinode cluster */
  45. #define BULKSTAT_FG_INLINE 0x4 /* No iget if inline attrs */
  46. /*
  47. * Return stat information in bulk (by-inode) for the filesystem.
  48. */
  49. int /* error status */
  50. xfs_bulkstat(
  51. xfs_mount_t *mp, /* mount point for filesystem */
  52. xfs_ino_t *lastino, /* last inode returned */
  53. int *count, /* size of buffer/count returned */
  54. bulkstat_one_pf formatter, /* func that'd fill a single buf */
  55. void *private_data, /* private data for formatter */
  56. size_t statstruct_size,/* sizeof struct that we're filling */
  57. char __user *ubuffer,/* buffer with inode stats */
  58. int flags, /* flag to control access method */
  59. int *done); /* 1 if there are more stats to get */
  60. int
  61. xfs_bulkstat_single(
  62. xfs_mount_t *mp,
  63. xfs_ino_t *lastinop,
  64. char __user *buffer,
  65. int *done);
  66. typedef int (*bulkstat_one_fmt_pf)( /* used size in bytes or negative error */
  67. void __user *ubuffer, /* buffer to write to */
  68. const xfs_bstat_t *buffer); /* buffer to read from */
  69. int
  70. xfs_bulkstat_one(
  71. xfs_mount_t *mp,
  72. xfs_ino_t ino,
  73. void __user *buffer,
  74. int ubsize,
  75. void *private_data,
  76. xfs_daddr_t bno,
  77. int *ubused,
  78. void *dibuff,
  79. int *stat);
  80. int
  81. xfs_internal_inum(
  82. xfs_mount_t *mp,
  83. xfs_ino_t ino);
  84. typedef int (*inumbers_fmt_pf)(
  85. void __user *ubuffer, /* buffer to write to */
  86. const xfs_inogrp_t *buffer, /* buffer to read from */
  87. long count, /* # of elements to read */
  88. long *written); /* # of bytes written */
  89. int
  90. xfs_inumbers_fmt(
  91. void __user *ubuffer, /* buffer to write to */
  92. const xfs_inogrp_t *buffer, /* buffer to read from */
  93. long count, /* # of elements to read */
  94. long *written); /* # of bytes written */
  95. int /* error status */
  96. xfs_inumbers(
  97. xfs_mount_t *mp, /* mount point for filesystem */
  98. xfs_ino_t *last, /* last inode returned */
  99. int *count, /* size of buffer/count returned */
  100. void __user *buffer, /* buffer with inode info */
  101. inumbers_fmt_pf formatter);
  102. #endif /* __XFS_ITABLE_H__ */