xfs_quota.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. /*
  2. * Copyright (c) 2000-2005 Silicon Graphics, Inc.
  3. * All Rights Reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it would be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write the Free Software Foundation,
  16. * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef __XFS_QUOTA_H__
  19. #define __XFS_QUOTA_H__
  20. struct xfs_trans;
  21. /*
  22. * The ondisk form of a dquot structure.
  23. */
  24. #define XFS_DQUOT_MAGIC 0x4451 /* 'DQ' */
  25. #define XFS_DQUOT_VERSION (u_int8_t)0x01 /* latest version number */
  26. /*
  27. * uid_t and gid_t are hard-coded to 32 bits in the inode.
  28. * Hence, an 'id' in a dquot is 32 bits..
  29. */
  30. typedef __uint32_t xfs_dqid_t;
  31. /*
  32. * Even though users may not have quota limits occupying all 64-bits,
  33. * they may need 64-bit accounting. Hence, 64-bit quota-counters,
  34. * and quota-limits. This is a waste in the common case, but hey ...
  35. */
  36. typedef __uint64_t xfs_qcnt_t;
  37. typedef __uint16_t xfs_qwarncnt_t;
  38. /*
  39. * This is the main portion of the on-disk representation of quota
  40. * information for a user. This is the q_core of the xfs_dquot_t that
  41. * is kept in kernel memory. We pad this with some more expansion room
  42. * to construct the on disk structure.
  43. */
  44. typedef struct xfs_disk_dquot {
  45. __be16 d_magic; /* dquot magic = XFS_DQUOT_MAGIC */
  46. __u8 d_version; /* dquot version */
  47. __u8 d_flags; /* XFS_DQ_USER/PROJ/GROUP */
  48. __be32 d_id; /* user,project,group id */
  49. __be64 d_blk_hardlimit;/* absolute limit on disk blks */
  50. __be64 d_blk_softlimit;/* preferred limit on disk blks */
  51. __be64 d_ino_hardlimit;/* maximum # allocated inodes */
  52. __be64 d_ino_softlimit;/* preferred inode limit */
  53. __be64 d_bcount; /* disk blocks owned by the user */
  54. __be64 d_icount; /* inodes owned by the user */
  55. __be32 d_itimer; /* zero if within inode limits if not,
  56. this is when we refuse service */
  57. __be32 d_btimer; /* similar to above; for disk blocks */
  58. __be16 d_iwarns; /* warnings issued wrt num inodes */
  59. __be16 d_bwarns; /* warnings issued wrt disk blocks */
  60. __be32 d_pad0; /* 64 bit align */
  61. __be64 d_rtb_hardlimit;/* absolute limit on realtime blks */
  62. __be64 d_rtb_softlimit;/* preferred limit on RT disk blks */
  63. __be64 d_rtbcount; /* realtime blocks owned */
  64. __be32 d_rtbtimer; /* similar to above; for RT disk blocks */
  65. __be16 d_rtbwarns; /* warnings issued wrt RT disk blocks */
  66. __be16 d_pad;
  67. } xfs_disk_dquot_t;
  68. /*
  69. * This is what goes on disk. This is separated from the xfs_disk_dquot because
  70. * carrying the unnecessary padding would be a waste of memory.
  71. */
  72. typedef struct xfs_dqblk {
  73. xfs_disk_dquot_t dd_diskdq; /* portion that lives incore as well */
  74. char dd_fill[4]; /* filling for posterity */
  75. /*
  76. * These two are only present on filesystems with the CRC bits set.
  77. */
  78. __be32 dd_crc; /* checksum */
  79. __be64 dd_lsn; /* last modification in log */
  80. uuid_t dd_uuid; /* location information */
  81. } xfs_dqblk_t;
  82. #define XFS_DQUOT_CRC_OFF offsetof(struct xfs_dqblk, dd_crc)
  83. /*
  84. * flags for q_flags field in the dquot.
  85. */
  86. #define XFS_DQ_USER 0x0001 /* a user quota */
  87. #define XFS_DQ_PROJ 0x0002 /* project quota */
  88. #define XFS_DQ_GROUP 0x0004 /* a group quota */
  89. #define XFS_DQ_DIRTY 0x0008 /* dquot is dirty */
  90. #define XFS_DQ_FREEING 0x0010 /* dquot is beeing torn down */
  91. #define XFS_DQ_ALLTYPES (XFS_DQ_USER|XFS_DQ_PROJ|XFS_DQ_GROUP)
  92. #define XFS_DQ_FLAGS \
  93. { XFS_DQ_USER, "USER" }, \
  94. { XFS_DQ_PROJ, "PROJ" }, \
  95. { XFS_DQ_GROUP, "GROUP" }, \
  96. { XFS_DQ_DIRTY, "DIRTY" }, \
  97. { XFS_DQ_FREEING, "FREEING" }
  98. /*
  99. * We have the possibility of all three quota types being active at once, and
  100. * hence free space modification requires modification of all three current
  101. * dquots in a single transaction. For this case we need to have a reservation
  102. * of at least 3 dquots.
  103. *
  104. * However, a chmod operation can change both UID and GID in a single
  105. * transaction, resulting in requiring {old, new} x {uid, gid} dquots to be
  106. * modified. Hence for this case we need to reserve space for at least 4 dquots.
  107. *
  108. * And in the worst case, there's a rename operation that can be modifying up to
  109. * 4 inodes with dquots attached to them. In reality, the only inodes that can
  110. * have their dquots modified are the source and destination directory inodes
  111. * due to directory name creation and removal. That can require space allocation
  112. * and/or freeing on both directory inodes, and hence all three dquots on each
  113. * inode can be modified. And if the directories are world writeable, all the
  114. * dquots can be unique and so 6 dquots can be modified....
  115. *
  116. * And, of course, we also need to take into account the dquot log format item
  117. * used to describe each dquot.
  118. */
  119. #define XFS_DQUOT_LOGRES(mp) \
  120. ((sizeof(struct xfs_dq_logformat) + sizeof(struct xfs_disk_dquot)) * 6)
  121. /*
  122. * These are the structures used to lay out dquots and quotaoff
  123. * records on the log. Quite similar to those of inodes.
  124. */
  125. /*
  126. * log format struct for dquots.
  127. * The first two fields must be the type and size fitting into
  128. * 32 bits : log_recovery code assumes that.
  129. */
  130. typedef struct xfs_dq_logformat {
  131. __uint16_t qlf_type; /* dquot log item type */
  132. __uint16_t qlf_size; /* size of this item */
  133. xfs_dqid_t qlf_id; /* usr/grp/proj id : 32 bits */
  134. __int64_t qlf_blkno; /* blkno of dquot buffer */
  135. __int32_t qlf_len; /* len of dquot buffer */
  136. __uint32_t qlf_boffset; /* off of dquot in buffer */
  137. } xfs_dq_logformat_t;
  138. /*
  139. * log format struct for QUOTAOFF records.
  140. * The first two fields must be the type and size fitting into
  141. * 32 bits : log_recovery code assumes that.
  142. * We write two LI_QUOTAOFF logitems per quotaoff, the last one keeps a pointer
  143. * to the first and ensures that the first logitem is taken out of the AIL
  144. * only when the last one is securely committed.
  145. */
  146. typedef struct xfs_qoff_logformat {
  147. unsigned short qf_type; /* quotaoff log item type */
  148. unsigned short qf_size; /* size of this item */
  149. unsigned int qf_flags; /* USR and/or GRP */
  150. char qf_pad[12]; /* padding for future */
  151. } xfs_qoff_logformat_t;
  152. /*
  153. * Disk quotas status in m_qflags, and also sb_qflags. 16 bits.
  154. */
  155. #define XFS_UQUOTA_ACCT 0x0001 /* user quota accounting ON */
  156. #define XFS_UQUOTA_ENFD 0x0002 /* user quota limits enforced */
  157. #define XFS_UQUOTA_CHKD 0x0004 /* quotacheck run on usr quotas */
  158. #define XFS_PQUOTA_ACCT 0x0008 /* project quota accounting ON */
  159. #define XFS_OQUOTA_ENFD 0x0010 /* other (grp/prj) quota limits enforced */
  160. #define XFS_OQUOTA_CHKD 0x0020 /* quotacheck run on other (grp/prj) quotas */
  161. #define XFS_GQUOTA_ACCT 0x0040 /* group quota accounting ON */
  162. /*
  163. * Conversion to and from the combined OQUOTA flag (if necessary)
  164. * is done only in xfs_sb_qflags_to_disk() and xfs_sb_qflags_from_disk()
  165. */
  166. #define XFS_GQUOTA_ENFD 0x0080 /* group quota limits enforced */
  167. #define XFS_GQUOTA_CHKD 0x0100 /* quotacheck run on group quotas */
  168. #define XFS_PQUOTA_ENFD 0x0200 /* project quota limits enforced */
  169. #define XFS_PQUOTA_CHKD 0x0400 /* quotacheck run on project quotas */
  170. /*
  171. * Quota Accounting/Enforcement flags
  172. */
  173. #define XFS_ALL_QUOTA_ACCT \
  174. (XFS_UQUOTA_ACCT | XFS_GQUOTA_ACCT | XFS_PQUOTA_ACCT)
  175. #define XFS_ALL_QUOTA_ENFD \
  176. (XFS_UQUOTA_ENFD | XFS_GQUOTA_ENFD | XFS_PQUOTA_ENFD)
  177. #define XFS_ALL_QUOTA_CHKD \
  178. (XFS_UQUOTA_CHKD | XFS_GQUOTA_CHKD | XFS_PQUOTA_CHKD)
  179. #define XFS_IS_QUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_ALL_QUOTA_ACCT)
  180. #define XFS_IS_UQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_UQUOTA_ACCT)
  181. #define XFS_IS_PQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_PQUOTA_ACCT)
  182. #define XFS_IS_GQUOTA_RUNNING(mp) ((mp)->m_qflags & XFS_GQUOTA_ACCT)
  183. #define XFS_IS_UQUOTA_ENFORCED(mp) ((mp)->m_qflags & XFS_UQUOTA_ENFD)
  184. #define XFS_IS_GQUOTA_ENFORCED(mp) ((mp)->m_qflags & XFS_GQUOTA_ENFD)
  185. #define XFS_IS_PQUOTA_ENFORCED(mp) ((mp)->m_qflags & XFS_PQUOTA_ENFD)
  186. /*
  187. * Incore only flags for quotaoff - these bits get cleared when quota(s)
  188. * are in the process of getting turned off. These flags are in m_qflags but
  189. * never in sb_qflags.
  190. */
  191. #define XFS_UQUOTA_ACTIVE 0x1000 /* uquotas are being turned off */
  192. #define XFS_GQUOTA_ACTIVE 0x2000 /* gquotas are being turned off */
  193. #define XFS_PQUOTA_ACTIVE 0x4000 /* pquotas are being turned off */
  194. #define XFS_ALL_QUOTA_ACTIVE \
  195. (XFS_UQUOTA_ACTIVE | XFS_GQUOTA_ACTIVE | XFS_PQUOTA_ACTIVE)
  196. /*
  197. * Checking XFS_IS_*QUOTA_ON() while holding any inode lock guarantees
  198. * quota will be not be switched off as long as that inode lock is held.
  199. */
  200. #define XFS_IS_QUOTA_ON(mp) ((mp)->m_qflags & (XFS_UQUOTA_ACTIVE | \
  201. XFS_GQUOTA_ACTIVE | \
  202. XFS_PQUOTA_ACTIVE))
  203. #define XFS_IS_OQUOTA_ON(mp) ((mp)->m_qflags & (XFS_GQUOTA_ACTIVE | \
  204. XFS_PQUOTA_ACTIVE))
  205. #define XFS_IS_UQUOTA_ON(mp) ((mp)->m_qflags & XFS_UQUOTA_ACTIVE)
  206. #define XFS_IS_GQUOTA_ON(mp) ((mp)->m_qflags & XFS_GQUOTA_ACTIVE)
  207. #define XFS_IS_PQUOTA_ON(mp) ((mp)->m_qflags & XFS_PQUOTA_ACTIVE)
  208. /*
  209. * Flags to tell various functions what to do. Not all of these are meaningful
  210. * to a single function. None of these XFS_QMOPT_* flags are meant to have
  211. * persistent values (ie. their values can and will change between versions)
  212. */
  213. #define XFS_QMOPT_DQALLOC 0x0000002 /* alloc dquot ondisk if needed */
  214. #define XFS_QMOPT_UQUOTA 0x0000004 /* user dquot requested */
  215. #define XFS_QMOPT_PQUOTA 0x0000008 /* project dquot requested */
  216. #define XFS_QMOPT_FORCE_RES 0x0000010 /* ignore quota limits */
  217. #define XFS_QMOPT_SBVERSION 0x0000040 /* change superblock version num */
  218. #define XFS_QMOPT_DOWARN 0x0000400 /* increase warning cnt if needed */
  219. #define XFS_QMOPT_DQREPAIR 0x0001000 /* repair dquot if damaged */
  220. #define XFS_QMOPT_GQUOTA 0x0002000 /* group dquot requested */
  221. #define XFS_QMOPT_ENOSPC 0x0004000 /* enospc instead of edquot (prj) */
  222. /*
  223. * flags to xfs_trans_mod_dquot to indicate which field needs to be
  224. * modified.
  225. */
  226. #define XFS_QMOPT_RES_REGBLKS 0x0010000
  227. #define XFS_QMOPT_RES_RTBLKS 0x0020000
  228. #define XFS_QMOPT_BCOUNT 0x0040000
  229. #define XFS_QMOPT_ICOUNT 0x0080000
  230. #define XFS_QMOPT_RTBCOUNT 0x0100000
  231. #define XFS_QMOPT_DELBCOUNT 0x0200000
  232. #define XFS_QMOPT_DELRTBCOUNT 0x0400000
  233. #define XFS_QMOPT_RES_INOS 0x0800000
  234. /*
  235. * flags for dqalloc.
  236. */
  237. #define XFS_QMOPT_INHERIT 0x1000000
  238. /*
  239. * flags to xfs_trans_mod_dquot.
  240. */
  241. #define XFS_TRANS_DQ_RES_BLKS XFS_QMOPT_RES_REGBLKS
  242. #define XFS_TRANS_DQ_RES_RTBLKS XFS_QMOPT_RES_RTBLKS
  243. #define XFS_TRANS_DQ_RES_INOS XFS_QMOPT_RES_INOS
  244. #define XFS_TRANS_DQ_BCOUNT XFS_QMOPT_BCOUNT
  245. #define XFS_TRANS_DQ_DELBCOUNT XFS_QMOPT_DELBCOUNT
  246. #define XFS_TRANS_DQ_ICOUNT XFS_QMOPT_ICOUNT
  247. #define XFS_TRANS_DQ_RTBCOUNT XFS_QMOPT_RTBCOUNT
  248. #define XFS_TRANS_DQ_DELRTBCOUNT XFS_QMOPT_DELRTBCOUNT
  249. #define XFS_QMOPT_QUOTALL \
  250. (XFS_QMOPT_UQUOTA | XFS_QMOPT_PQUOTA | XFS_QMOPT_GQUOTA)
  251. #define XFS_QMOPT_RESBLK_MASK (XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_RES_RTBLKS)
  252. #ifdef __KERNEL__
  253. /*
  254. * This check is done typically without holding the inode lock;
  255. * that may seem racy, but it is harmless in the context that it is used.
  256. * The inode cannot go inactive as long a reference is kept, and
  257. * therefore if dquot(s) were attached, they'll stay consistent.
  258. * If, for example, the ownership of the inode changes while
  259. * we didn't have the inode locked, the appropriate dquot(s) will be
  260. * attached atomically.
  261. */
  262. #define XFS_NOT_DQATTACHED(mp, ip) \
  263. ((XFS_IS_UQUOTA_ON(mp) && (ip)->i_udquot == NULL) || \
  264. (XFS_IS_GQUOTA_ON(mp) && (ip)->i_gdquot == NULL) || \
  265. (XFS_IS_PQUOTA_ON(mp) && (ip)->i_pdquot == NULL))
  266. #define XFS_QM_NEED_QUOTACHECK(mp) \
  267. ((XFS_IS_UQUOTA_ON(mp) && \
  268. (mp->m_sb.sb_qflags & XFS_UQUOTA_CHKD) == 0) || \
  269. (XFS_IS_GQUOTA_ON(mp) && \
  270. (mp->m_sb.sb_qflags & XFS_GQUOTA_CHKD) == 0) || \
  271. (XFS_IS_PQUOTA_ON(mp) && \
  272. (mp->m_sb.sb_qflags & XFS_PQUOTA_CHKD) == 0))
  273. #define XFS_MOUNT_QUOTA_ALL (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD|\
  274. XFS_UQUOTA_CHKD|XFS_GQUOTA_ACCT|\
  275. XFS_GQUOTA_ENFD|XFS_GQUOTA_CHKD|\
  276. XFS_PQUOTA_ACCT|XFS_PQUOTA_ENFD|\
  277. XFS_PQUOTA_CHKD)
  278. /*
  279. * The structure kept inside the xfs_trans_t keep track of dquot changes
  280. * within a transaction and apply them later.
  281. */
  282. typedef struct xfs_dqtrx {
  283. struct xfs_dquot *qt_dquot; /* the dquot this refers to */
  284. ulong qt_blk_res; /* blks reserved on a dquot */
  285. ulong qt_blk_res_used; /* blks used from the reservation */
  286. ulong qt_ino_res; /* inode reserved on a dquot */
  287. ulong qt_ino_res_used; /* inodes used from the reservation */
  288. long qt_bcount_delta; /* dquot blk count changes */
  289. long qt_delbcnt_delta; /* delayed dquot blk count changes */
  290. long qt_icount_delta; /* dquot inode count changes */
  291. ulong qt_rtblk_res; /* # blks reserved on a dquot */
  292. ulong qt_rtblk_res_used;/* # blks used from reservation */
  293. long qt_rtbcount_delta;/* dquot realtime blk changes */
  294. long qt_delrtb_delta; /* delayed RT blk count changes */
  295. } xfs_dqtrx_t;
  296. #ifdef CONFIG_XFS_QUOTA
  297. extern void xfs_trans_dup_dqinfo(struct xfs_trans *, struct xfs_trans *);
  298. extern void xfs_trans_free_dqinfo(struct xfs_trans *);
  299. extern void xfs_trans_mod_dquot_byino(struct xfs_trans *, struct xfs_inode *,
  300. uint, long);
  301. extern void xfs_trans_apply_dquot_deltas(struct xfs_trans *);
  302. extern void xfs_trans_unreserve_and_mod_dquots(struct xfs_trans *);
  303. extern int xfs_trans_reserve_quota_nblks(struct xfs_trans *,
  304. struct xfs_inode *, long, long, uint);
  305. extern int xfs_trans_reserve_quota_bydquots(struct xfs_trans *,
  306. struct xfs_mount *, struct xfs_dquot *,
  307. struct xfs_dquot *, struct xfs_dquot *, long, long, uint);
  308. extern int xfs_qm_vop_dqalloc(struct xfs_inode *, uid_t, gid_t, prid_t, uint,
  309. struct xfs_dquot **, struct xfs_dquot **, struct xfs_dquot **);
  310. extern void xfs_qm_vop_create_dqattach(struct xfs_trans *, struct xfs_inode *,
  311. struct xfs_dquot *, struct xfs_dquot *, struct xfs_dquot *);
  312. extern int xfs_qm_vop_rename_dqattach(struct xfs_inode **);
  313. extern struct xfs_dquot *xfs_qm_vop_chown(struct xfs_trans *,
  314. struct xfs_inode *, struct xfs_dquot **, struct xfs_dquot *);
  315. extern int xfs_qm_vop_chown_reserve(struct xfs_trans *, struct xfs_inode *,
  316. struct xfs_dquot *, struct xfs_dquot *,
  317. struct xfs_dquot *, uint);
  318. extern int xfs_qm_dqattach(struct xfs_inode *, uint);
  319. extern int xfs_qm_dqattach_locked(struct xfs_inode *, uint);
  320. extern void xfs_qm_dqdetach(struct xfs_inode *);
  321. extern void xfs_qm_dqrele(struct xfs_dquot *);
  322. extern void xfs_qm_statvfs(struct xfs_inode *, struct kstatfs *);
  323. extern int xfs_qm_newmount(struct xfs_mount *, uint *, uint *);
  324. extern void xfs_qm_mount_quotas(struct xfs_mount *);
  325. extern void xfs_qm_unmount(struct xfs_mount *);
  326. extern void xfs_qm_unmount_quotas(struct xfs_mount *);
  327. #else
  328. static inline int
  329. xfs_qm_vop_dqalloc(struct xfs_inode *ip, uid_t uid, gid_t gid, prid_t prid,
  330. uint flags, struct xfs_dquot **udqp, struct xfs_dquot **gdqp,
  331. struct xfs_dquot **pdqp)
  332. {
  333. *udqp = NULL;
  334. *gdqp = NULL;
  335. *pdqp = NULL;
  336. return 0;
  337. }
  338. #define xfs_trans_dup_dqinfo(tp, tp2)
  339. #define xfs_trans_free_dqinfo(tp)
  340. #define xfs_trans_mod_dquot_byino(tp, ip, fields, delta)
  341. #define xfs_trans_apply_dquot_deltas(tp)
  342. #define xfs_trans_unreserve_and_mod_dquots(tp)
  343. static inline int xfs_trans_reserve_quota_nblks(struct xfs_trans *tp,
  344. struct xfs_inode *ip, long nblks, long ninos, uint flags)
  345. {
  346. return 0;
  347. }
  348. static inline int xfs_trans_reserve_quota_bydquots(struct xfs_trans *tp,
  349. struct xfs_mount *mp, struct xfs_dquot *udqp,
  350. struct xfs_dquot *gdqp, struct xfs_dquot *pdqp,
  351. long nblks, long nions, uint flags)
  352. {
  353. return 0;
  354. }
  355. #define xfs_qm_vop_create_dqattach(tp, ip, u, g, p)
  356. #define xfs_qm_vop_rename_dqattach(it) (0)
  357. #define xfs_qm_vop_chown(tp, ip, old, new) (NULL)
  358. #define xfs_qm_vop_chown_reserve(tp, ip, u, g, p, fl) (0)
  359. #define xfs_qm_dqattach(ip, fl) (0)
  360. #define xfs_qm_dqattach_locked(ip, fl) (0)
  361. #define xfs_qm_dqdetach(ip)
  362. #define xfs_qm_dqrele(d)
  363. #define xfs_qm_statvfs(ip, s)
  364. #define xfs_qm_newmount(mp, a, b) (0)
  365. #define xfs_qm_mount_quotas(mp)
  366. #define xfs_qm_unmount(mp)
  367. #define xfs_qm_unmount_quotas(mp)
  368. #endif /* CONFIG_XFS_QUOTA */
  369. #define xfs_trans_unreserve_quota_nblks(tp, ip, nblks, ninos, flags) \
  370. xfs_trans_reserve_quota_nblks(tp, ip, -(nblks), -(ninos), flags)
  371. #define xfs_trans_reserve_quota(tp, mp, ud, gd, pd, nb, ni, f) \
  372. xfs_trans_reserve_quota_bydquots(tp, mp, ud, gd, pd, nb, ni, \
  373. f | XFS_QMOPT_RES_REGBLKS)
  374. extern int xfs_qm_dqcheck(struct xfs_mount *, xfs_disk_dquot_t *,
  375. xfs_dqid_t, uint, uint, char *);
  376. extern int xfs_mount_reset_sbqflags(struct xfs_mount *);
  377. extern const struct xfs_buf_ops xfs_dquot_buf_ops;
  378. #endif /* __KERNEL__ */
  379. #endif /* __XFS_QUOTA_H__ */