xfs_itable.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
  4. */
  5. #ifndef __XFS_ITABLE_H__
  6. #define __XFS_ITABLE_H__
  7. /*
  8. * xfs_bulkstat() is used to fill in xfs_bstat structures as well as dm_stat
  9. * structures (by the dmi library). This is a pointer to a formatter function
  10. * that will iget the inode and fill in the appropriate structure.
  11. * see xfs_bulkstat_one() and xfs_dm_bulkstat_one() in dmapi_xfs.c
  12. */
  13. typedef int (*bulkstat_one_pf)(struct xfs_mount *mp,
  14. xfs_ino_t ino,
  15. void __user *buffer,
  16. int ubsize,
  17. int *ubused,
  18. int *stat);
  19. /*
  20. * Values for stat return value.
  21. */
  22. #define BULKSTAT_RV_NOTHING 0
  23. #define BULKSTAT_RV_DIDONE 1
  24. #define BULKSTAT_RV_GIVEUP 2
  25. /*
  26. * Return stat information in bulk (by-inode) for the filesystem.
  27. */
  28. int /* error status */
  29. xfs_bulkstat(
  30. xfs_mount_t *mp, /* mount point for filesystem */
  31. xfs_ino_t *lastino, /* last inode returned */
  32. int *count, /* size of buffer/count returned */
  33. bulkstat_one_pf formatter, /* func that'd fill a single buf */
  34. size_t statstruct_size,/* sizeof struct that we're filling */
  35. char __user *ubuffer,/* buffer with inode stats */
  36. int *done); /* 1 if there are more stats to get */
  37. typedef int (*bulkstat_one_fmt_pf)( /* used size in bytes or negative error */
  38. void __user *ubuffer, /* buffer to write to */
  39. int ubsize, /* remaining user buffer sz */
  40. int *ubused, /* bytes used by formatter */
  41. const xfs_bstat_t *buffer); /* buffer to read from */
  42. int
  43. xfs_bulkstat_one_int(
  44. xfs_mount_t *mp,
  45. xfs_ino_t ino,
  46. void __user *buffer,
  47. int ubsize,
  48. bulkstat_one_fmt_pf formatter,
  49. int *ubused,
  50. int *stat);
  51. int
  52. xfs_bulkstat_one(
  53. xfs_mount_t *mp,
  54. xfs_ino_t ino,
  55. void __user *buffer,
  56. int ubsize,
  57. int *ubused,
  58. int *stat);
  59. typedef int (*inumbers_fmt_pf)(
  60. void __user *ubuffer, /* buffer to write to */
  61. const xfs_inogrp_t *buffer, /* buffer to read from */
  62. long count, /* # of elements to read */
  63. long *written); /* # of bytes written */
  64. int
  65. xfs_inumbers_fmt(
  66. void __user *ubuffer, /* buffer to write to */
  67. const xfs_inogrp_t *buffer, /* buffer to read from */
  68. long count, /* # of elements to read */
  69. long *written); /* # of bytes written */
  70. int /* error status */
  71. xfs_inumbers(
  72. xfs_mount_t *mp, /* mount point for filesystem */
  73. xfs_ino_t *last, /* last inode returned */
  74. int *count, /* size of buffer/count returned */
  75. void __user *buffer, /* buffer with inode info */
  76. inumbers_fmt_pf formatter);
  77. #endif /* __XFS_ITABLE_H__ */