diff options
Diffstat (limited to 'fs/xfs/xfs_quota.h')
-rw-r--r-- | fs/xfs/xfs_quota.h | 129 |
1 files changed, 69 insertions, 60 deletions
diff --git a/fs/xfs/xfs_quota.h b/fs/xfs/xfs_quota.h index f5d1202dde25..3ec91ac74c2a 100644 --- a/fs/xfs/xfs_quota.h +++ b/fs/xfs/xfs_quota.h | |||
@@ -197,7 +197,6 @@ typedef struct xfs_qoff_logformat { | |||
197 | #define XFS_QMOPT_UMOUNTING 0x0000100 /* filesys is being unmounted */ | 197 | #define XFS_QMOPT_UMOUNTING 0x0000100 /* filesys is being unmounted */ |
198 | #define XFS_QMOPT_DOLOG 0x0000200 /* log buf changes (in quotacheck) */ | 198 | #define XFS_QMOPT_DOLOG 0x0000200 /* log buf changes (in quotacheck) */ |
199 | #define XFS_QMOPT_DOWARN 0x0000400 /* increase warning cnt if needed */ | 199 | #define XFS_QMOPT_DOWARN 0x0000400 /* increase warning cnt if needed */ |
200 | #define XFS_QMOPT_ILOCKED 0x0000800 /* inode is already locked (excl) */ | ||
201 | #define XFS_QMOPT_DQREPAIR 0x0001000 /* repair dquot if damaged */ | 200 | #define XFS_QMOPT_DQREPAIR 0x0001000 /* repair dquot if damaged */ |
202 | #define XFS_QMOPT_GQUOTA 0x0002000 /* group dquot requested */ | 201 | #define XFS_QMOPT_GQUOTA 0x0002000 /* group dquot requested */ |
203 | #define XFS_QMOPT_ENOSPC 0x0004000 /* enospc instead of edquot (prj) */ | 202 | #define XFS_QMOPT_ENOSPC 0x0004000 /* enospc instead of edquot (prj) */ |
@@ -302,69 +301,79 @@ typedef struct xfs_dqtrx { | |||
302 | long qt_delrtb_delta; /* delayed RT blk count changes */ | 301 | long qt_delrtb_delta; /* delayed RT blk count changes */ |
303 | } xfs_dqtrx_t; | 302 | } xfs_dqtrx_t; |
304 | 303 | ||
305 | /* | 304 | #ifdef CONFIG_XFS_QUOTA |
306 | * Dquot transaction functions, used if quota is enabled. | 305 | extern void xfs_trans_dup_dqinfo(struct xfs_trans *, struct xfs_trans *); |
307 | */ | 306 | extern void xfs_trans_free_dqinfo(struct xfs_trans *); |
308 | typedef void (*qo_dup_dqinfo_t)(struct xfs_trans *, struct xfs_trans *); | 307 | extern void xfs_trans_mod_dquot_byino(struct xfs_trans *, struct xfs_inode *, |
309 | typedef void (*qo_mod_dquot_byino_t)(struct xfs_trans *, | 308 | uint, long); |
310 | struct xfs_inode *, uint, long); | 309 | extern void xfs_trans_apply_dquot_deltas(struct xfs_trans *); |
311 | typedef void (*qo_free_dqinfo_t)(struct xfs_trans *); | 310 | extern void xfs_trans_unreserve_and_mod_dquots(struct xfs_trans *); |
312 | typedef void (*qo_apply_dquot_deltas_t)(struct xfs_trans *); | 311 | extern int xfs_trans_reserve_quota_nblks(struct xfs_trans *, |
313 | typedef void (*qo_unreserve_and_mod_dquots_t)(struct xfs_trans *); | 312 | struct xfs_inode *, long, long, uint); |
314 | typedef int (*qo_reserve_quota_nblks_t)( | 313 | extern int xfs_trans_reserve_quota_bydquots(struct xfs_trans *, |
315 | struct xfs_trans *, struct xfs_mount *, | 314 | struct xfs_mount *, struct xfs_dquot *, |
316 | struct xfs_inode *, long, long, uint); | 315 | struct xfs_dquot *, long, long, uint); |
317 | typedef int (*qo_reserve_quota_bydquots_t)( | 316 | |
318 | struct xfs_trans *, struct xfs_mount *, | 317 | extern int xfs_qm_vop_dqalloc(struct xfs_inode *, uid_t, gid_t, prid_t, uint, |
319 | struct xfs_dquot *, struct xfs_dquot *, | 318 | struct xfs_dquot **, struct xfs_dquot **); |
320 | long, long, uint); | 319 | extern void xfs_qm_vop_create_dqattach(struct xfs_trans *, struct xfs_inode *, |
321 | typedef struct xfs_dqtrxops { | 320 | struct xfs_dquot *, struct xfs_dquot *); |
322 | qo_dup_dqinfo_t qo_dup_dqinfo; | 321 | extern int xfs_qm_vop_rename_dqattach(struct xfs_inode **); |
323 | qo_free_dqinfo_t qo_free_dqinfo; | 322 | extern struct xfs_dquot *xfs_qm_vop_chown(struct xfs_trans *, |
324 | qo_mod_dquot_byino_t qo_mod_dquot_byino; | 323 | struct xfs_inode *, struct xfs_dquot **, struct xfs_dquot *); |
325 | qo_apply_dquot_deltas_t qo_apply_dquot_deltas; | 324 | extern int xfs_qm_vop_chown_reserve(struct xfs_trans *, struct xfs_inode *, |
326 | qo_reserve_quota_nblks_t qo_reserve_quota_nblks; | 325 | struct xfs_dquot *, struct xfs_dquot *, uint); |
327 | qo_reserve_quota_bydquots_t qo_reserve_quota_bydquots; | 326 | extern int xfs_qm_dqattach(struct xfs_inode *, uint); |
328 | qo_unreserve_and_mod_dquots_t qo_unreserve_and_mod_dquots; | 327 | extern int xfs_qm_dqattach_locked(struct xfs_inode *, uint); |
329 | } xfs_dqtrxops_t; | 328 | extern void xfs_qm_dqdetach(struct xfs_inode *); |
330 | 329 | extern void xfs_qm_dqrele(struct xfs_dquot *); | |
331 | #define XFS_DQTRXOP(mp, tp, op, args...) \ | 330 | extern void xfs_qm_statvfs(struct xfs_inode *, struct kstatfs *); |
332 | ((mp)->m_qm_ops->xfs_dqtrxops ? \ | 331 | extern int xfs_qm_sync(struct xfs_mount *, int); |
333 | ((mp)->m_qm_ops->xfs_dqtrxops->op)(tp, ## args) : 0) | 332 | extern int xfs_qm_newmount(struct xfs_mount *, uint *, uint *); |
334 | 333 | extern void xfs_qm_mount_quotas(struct xfs_mount *); | |
335 | #define XFS_DQTRXOP_VOID(mp, tp, op, args...) \ | 334 | extern void xfs_qm_unmount(struct xfs_mount *); |
336 | ((mp)->m_qm_ops->xfs_dqtrxops ? \ | 335 | extern void xfs_qm_unmount_quotas(struct xfs_mount *); |
337 | ((mp)->m_qm_ops->xfs_dqtrxops->op)(tp, ## args) : (void)0) | 336 | |
338 | 337 | #else | |
339 | #define XFS_TRANS_DUP_DQINFO(mp, otp, ntp) \ | 338 | static inline int |
340 | XFS_DQTRXOP_VOID(mp, otp, qo_dup_dqinfo, ntp) | 339 | xfs_qm_vop_dqalloc(struct xfs_inode *ip, uid_t uid, gid_t gid, prid_t prid, |
341 | #define XFS_TRANS_FREE_DQINFO(mp, tp) \ | 340 | uint flags, struct xfs_dquot **udqp, struct xfs_dquot **gdqp) |
342 | XFS_DQTRXOP_VOID(mp, tp, qo_free_dqinfo) | 341 | { |
343 | #define XFS_TRANS_MOD_DQUOT_BYINO(mp, tp, ip, field, delta) \ | 342 | *udqp = NULL; |
344 | XFS_DQTRXOP_VOID(mp, tp, qo_mod_dquot_byino, ip, field, delta) | 343 | *gdqp = NULL; |
345 | #define XFS_TRANS_APPLY_DQUOT_DELTAS(mp, tp) \ | 344 | return 0; |
346 | XFS_DQTRXOP_VOID(mp, tp, qo_apply_dquot_deltas) | 345 | } |
347 | #define XFS_TRANS_RESERVE_QUOTA_NBLKS(mp, tp, ip, nblks, ninos, fl) \ | 346 | #define xfs_trans_dup_dqinfo(tp, tp2) |
348 | XFS_DQTRXOP(mp, tp, qo_reserve_quota_nblks, mp, ip, nblks, ninos, fl) | 347 | #define xfs_trans_free_dqinfo(tp) |
349 | #define XFS_TRANS_RESERVE_QUOTA_BYDQUOTS(mp, tp, ud, gd, nb, ni, fl) \ | 348 | #define xfs_trans_mod_dquot_byino(tp, ip, fields, delta) |
350 | XFS_DQTRXOP(mp, tp, qo_reserve_quota_bydquots, mp, ud, gd, nb, ni, fl) | 349 | #define xfs_trans_apply_dquot_deltas(tp) |
351 | #define XFS_TRANS_UNRESERVE_AND_MOD_DQUOTS(mp, tp) \ | 350 | #define xfs_trans_unreserve_and_mod_dquots(tp) |
352 | XFS_DQTRXOP_VOID(mp, tp, qo_unreserve_and_mod_dquots) | 351 | #define xfs_trans_reserve_quota_nblks(tp, ip, nblks, ninos, flags) (0) |
353 | 352 | #define xfs_trans_reserve_quota_bydquots(tp, mp, u, g, nb, ni, fl) (0) | |
354 | #define XFS_TRANS_UNRESERVE_QUOTA_NBLKS(mp, tp, ip, nblks, ninos, flags) \ | 353 | #define xfs_qm_vop_create_dqattach(tp, ip, u, g) |
355 | XFS_TRANS_RESERVE_QUOTA_NBLKS(mp, tp, ip, -(nblks), -(ninos), flags) | 354 | #define xfs_qm_vop_rename_dqattach(it) (0) |
356 | #define XFS_TRANS_RESERVE_QUOTA(mp, tp, ud, gd, nb, ni, f) \ | 355 | #define xfs_qm_vop_chown(tp, ip, old, new) (NULL) |
357 | XFS_TRANS_RESERVE_QUOTA_BYDQUOTS(mp, tp, ud, gd, nb, ni, \ | 356 | #define xfs_qm_vop_chown_reserve(tp, ip, u, g, fl) (0) |
358 | f | XFS_QMOPT_RES_REGBLKS) | 357 | #define xfs_qm_dqattach(ip, fl) (0) |
359 | #define XFS_TRANS_UNRESERVE_QUOTA(mp, tp, ud, gd, nb, ni, f) \ | 358 | #define xfs_qm_dqattach_locked(ip, fl) (0) |
360 | XFS_TRANS_RESERVE_QUOTA_BYDQUOTS(mp, tp, ud, gd, -(nb), -(ni), \ | 359 | #define xfs_qm_dqdetach(ip) |
360 | #define xfs_qm_dqrele(d) | ||
361 | #define xfs_qm_statvfs(ip, s) | ||
362 | #define xfs_qm_sync(mp, fl) (0) | ||
363 | #define xfs_qm_newmount(mp, a, b) (0) | ||
364 | #define xfs_qm_mount_quotas(mp) | ||
365 | #define xfs_qm_unmount(mp) | ||
366 | #define xfs_qm_unmount_quotas(mp) (0) | ||
367 | #endif /* CONFIG_XFS_QUOTA */ | ||
368 | |||
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, nb, ni, f) \ | ||
372 | xfs_trans_reserve_quota_bydquots(tp, mp, ud, gd, nb, ni, \ | ||
361 | f | XFS_QMOPT_RES_REGBLKS) | 373 | f | XFS_QMOPT_RES_REGBLKS) |
362 | 374 | ||
363 | extern int xfs_qm_dqcheck(xfs_disk_dquot_t *, xfs_dqid_t, uint, uint, char *); | 375 | extern int xfs_qm_dqcheck(xfs_disk_dquot_t *, xfs_dqid_t, uint, uint, char *); |
364 | extern int xfs_mount_reset_sbqflags(struct xfs_mount *); | 376 | extern int xfs_mount_reset_sbqflags(struct xfs_mount *); |
365 | 377 | ||
366 | extern struct xfs_qmops xfs_qmcore_xfs; | ||
367 | |||
368 | #endif /* __KERNEL__ */ | 378 | #endif /* __KERNEL__ */ |
369 | |||
370 | #endif /* __XFS_QUOTA_H__ */ | 379 | #endif /* __XFS_QUOTA_H__ */ |