diff options
author | Chandra Seetharaman <sekharan@us.ibm.com> | 2012-01-23 12:31:25 -0500 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-02-03 10:42:53 -0500 |
commit | 6967b964c1012231f338445f20f877e680cd4cb8 (patch) | |
tree | bbf07cd6220f957eed9dead914f8603548c21fbb /fs/xfs/xfs_dquot.h | |
parent | b9957308452afcf58e656db834f44df10d7b1662 (diff) |
Define a new function xfs_this_quota_on()
Create a new function xfs_this_quota_on() that takes a xfs_mount
data structure and a disk quota type and returns true if the specified
type of quota is ON in the xfs_mount data structure.
Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_dquot.h')
-rw-r--r-- | fs/xfs/xfs_dquot.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/fs/xfs/xfs_dquot.h b/fs/xfs/xfs_dquot.h index a1d91d8f1802..1c48489423e4 100644 --- a/fs/xfs/xfs_dquot.h +++ b/fs/xfs/xfs_dquot.h | |||
@@ -115,6 +115,19 @@ static inline void xfs_dqunlock_nonotify(struct xfs_dquot *dqp) | |||
115 | mutex_unlock(&dqp->q_qlock); | 115 | mutex_unlock(&dqp->q_qlock); |
116 | } | 116 | } |
117 | 117 | ||
118 | static inline int xfs_this_quota_on(struct xfs_mount *mp, int type) | ||
119 | { | ||
120 | switch (type & XFS_DQ_ALLTYPES) { | ||
121 | case XFS_DQ_USER: | ||
122 | return XFS_IS_UQUOTA_ON(mp); | ||
123 | case XFS_DQ_GROUP: | ||
124 | case XFS_DQ_PROJ: | ||
125 | return XFS_IS_OQUOTA_ON(mp); | ||
126 | default: | ||
127 | return 0; | ||
128 | } | ||
129 | } | ||
130 | |||
118 | #define XFS_DQ_IS_LOCKED(dqp) (mutex_is_locked(&((dqp)->q_qlock))) | 131 | #define XFS_DQ_IS_LOCKED(dqp) (mutex_is_locked(&((dqp)->q_qlock))) |
119 | #define XFS_DQ_IS_DIRTY(dqp) ((dqp)->dq_flags & XFS_DQ_DIRTY) | 132 | #define XFS_DQ_IS_DIRTY(dqp) ((dqp)->dq_flags & XFS_DQ_DIRTY) |
120 | #define XFS_QM_ISUDQ(dqp) ((dqp)->dq_flags & XFS_DQ_USER) | 133 | #define XFS_QM_ISUDQ(dqp) ((dqp)->dq_flags & XFS_DQ_USER) |
@@ -125,10 +138,6 @@ static inline void xfs_dqunlock_nonotify(struct xfs_dquot *dqp) | |||
125 | XFS_DQ_TO_QINF(dqp)->qi_uquotaip : \ | 138 | XFS_DQ_TO_QINF(dqp)->qi_uquotaip : \ |
126 | XFS_DQ_TO_QINF(dqp)->qi_gquotaip) | 139 | XFS_DQ_TO_QINF(dqp)->qi_gquotaip) |
127 | 140 | ||
128 | #define XFS_IS_THIS_QUOTA_OFF(d) (! (XFS_QM_ISUDQ(d) ? \ | ||
129 | (XFS_IS_UQUOTA_ON((d)->q_mount)) : \ | ||
130 | (XFS_IS_OQUOTA_ON((d)->q_mount)))) | ||
131 | |||
132 | extern int xfs_qm_dqread(struct xfs_mount *, xfs_dqid_t, uint, | 141 | extern int xfs_qm_dqread(struct xfs_mount *, xfs_dqid_t, uint, |
133 | uint, struct xfs_dquot **); | 142 | uint, struct xfs_dquot **); |
134 | extern void xfs_qm_dqdestroy(xfs_dquot_t *); | 143 | extern void xfs_qm_dqdestroy(xfs_dquot_t *); |