xfs_itable.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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 modify it
  5. * under the terms of version 2 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, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. *
  12. * Further, this software is distributed without any warranty that it is
  13. * free of the rightful claim of any third person regarding infringement
  14. * or the like. Any license provided herein, whether implied or
  15. * otherwise, applies only to this software file. Patent licenses, if
  16. * any, provided herein do not apply to combinations of this program with
  17. * other software, or any other product whatsoever.
  18. *
  19. * You should have received a copy of the GNU General Public License along
  20. * with this program; if not, write the Free Software Foundation, Inc., 59
  21. * Temple Place - Suite 330, Boston MA 02111-1307, USA.
  22. *
  23. * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
  24. * Mountain View, CA 94043, or:
  25. *
  26. * http://www.sgi.com
  27. *
  28. * For further information regarding this notice, see:
  29. *
  30. * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  31. */
  32. #ifndef __XFS_ITABLE_H__
  33. #define __XFS_ITABLE_H__
  34. /*
  35. * xfs_bulkstat() is used to fill in xfs_bstat structures as well as dm_stat
  36. * structures (by the dmi library). This is a pointer to a formatter function
  37. * that will iget the inode and fill in the appropriate structure.
  38. * see xfs_bulkstat_one() and xfs_dm_bulkstat_one() in dmapi_xfs.c
  39. */
  40. typedef int (*bulkstat_one_pf)(struct xfs_mount *mp,
  41. xfs_ino_t ino,
  42. void __user *buffer,
  43. int ubsize,
  44. void *private_data,
  45. xfs_daddr_t bno,
  46. int *ubused,
  47. void *dip,
  48. int *stat);
  49. /*
  50. * Values for stat return value.
  51. */
  52. #define BULKSTAT_RV_NOTHING 0
  53. #define BULKSTAT_RV_DIDONE 1
  54. #define BULKSTAT_RV_GIVEUP 2
  55. /*
  56. * Values for bulkstat flag argument.
  57. */
  58. #define BULKSTAT_FG_IGET 0x1 /* Go through the buffer cache */
  59. #define BULKSTAT_FG_QUICK 0x2 /* No iget, walk the dinode cluster */
  60. #define BULKSTAT_FG_VFSLOCKED 0x4 /* Already have vfs lock */
  61. /*
  62. * Return stat information in bulk (by-inode) for the filesystem.
  63. */
  64. int /* error status */
  65. xfs_bulkstat(
  66. xfs_mount_t *mp, /* mount point for filesystem */
  67. xfs_ino_t *lastino, /* last inode returned */
  68. int *count, /* size of buffer/count returned */
  69. bulkstat_one_pf formatter, /* func that'd fill a single buf */
  70. void *private_data, /* private data for formatter */
  71. size_t statstruct_size,/* sizeof struct that we're filling */
  72. char __user *ubuffer,/* buffer with inode stats */
  73. int flags, /* flag to control access method */
  74. int *done); /* 1 if there're more stats to get */
  75. int
  76. xfs_bulkstat_single(
  77. xfs_mount_t *mp,
  78. xfs_ino_t *lastinop,
  79. char __user *buffer,
  80. int *done);
  81. int
  82. xfs_bulkstat_one(
  83. xfs_mount_t *mp,
  84. xfs_ino_t ino,
  85. void __user *buffer,
  86. int ubsize,
  87. void *private_data,
  88. xfs_daddr_t bno,
  89. int *ubused,
  90. void *dibuff,
  91. int *stat);
  92. int /* error status */
  93. xfs_inumbers(
  94. xfs_mount_t *mp, /* mount point for filesystem */
  95. xfs_ino_t *last, /* last inode returned */
  96. int *count, /* size of buffer/count returned */
  97. xfs_inogrp_t __user *buffer);/* buffer with inode info */
  98. #endif /* __XFS_ITABLE_H__ */