Commit 00a342e4 authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: remove the XFS_QM_IS[UGP]DQ macros

Remove these macros and use xfs_dquot_type() for everything.
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent dbcbc7b9
...@@ -128,6 +128,12 @@ static inline void xfs_dqunlock(struct xfs_dquot *dqp) ...@@ -128,6 +128,12 @@ static inline void xfs_dqunlock(struct xfs_dquot *dqp)
mutex_unlock(&dqp->q_qlock); mutex_unlock(&dqp->q_qlock);
} }
static inline int
xfs_dquot_type(const struct xfs_dquot *dqp)
{
return dqp->dq_flags & XFS_DQTYPE_REC_MASK;
}
static inline int xfs_this_quota_on(struct xfs_mount *mp, int type) static inline int xfs_this_quota_on(struct xfs_mount *mp, int type)
{ {
switch (type & XFS_DQTYPE_REC_MASK) { switch (type & XFS_DQTYPE_REC_MASK) {
...@@ -192,9 +198,6 @@ void xfs_dquot_to_disk(struct xfs_disk_dquot *ddqp, struct xfs_dquot *dqp); ...@@ -192,9 +198,6 @@ void xfs_dquot_to_disk(struct xfs_disk_dquot *ddqp, struct xfs_dquot *dqp);
#define XFS_DQ_IS_LOCKED(dqp) (mutex_is_locked(&((dqp)->q_qlock))) #define XFS_DQ_IS_LOCKED(dqp) (mutex_is_locked(&((dqp)->q_qlock)))
#define XFS_DQ_IS_DIRTY(dqp) ((dqp)->q_flags & XFS_DQFLAG_DIRTY) #define XFS_DQ_IS_DIRTY(dqp) ((dqp)->q_flags & XFS_DQFLAG_DIRTY)
#define XFS_QM_ISUDQ(dqp) ((dqp)->dq_flags & XFS_DQTYPE_USER)
#define XFS_QM_ISPDQ(dqp) ((dqp)->dq_flags & XFS_DQTYPE_PROJ)
#define XFS_QM_ISGDQ(dqp) ((dqp)->dq_flags & XFS_DQTYPE_GROUP)
void xfs_qm_dqdestroy(struct xfs_dquot *dqp); void xfs_qm_dqdestroy(struct xfs_dquot *dqp);
int xfs_qm_dqflush(struct xfs_dquot *dqp, struct xfs_buf **bpp); int xfs_qm_dqflush(struct xfs_dquot *dqp, struct xfs_buf **bpp);
......
...@@ -101,17 +101,6 @@ xfs_quota_inode(xfs_mount_t *mp, uint dq_flags) ...@@ -101,17 +101,6 @@ xfs_quota_inode(xfs_mount_t *mp, uint dq_flags)
return NULL; return NULL;
} }
static inline int
xfs_dquot_type(struct xfs_dquot *dqp)
{
if (XFS_QM_ISUDQ(dqp))
return XFS_DQTYPE_USER;
if (XFS_QM_ISGDQ(dqp))
return XFS_DQTYPE_GROUP;
ASSERT(XFS_QM_ISPDQ(dqp));
return XFS_DQTYPE_PROJ;
}
extern void xfs_trans_mod_dquot(struct xfs_trans *tp, struct xfs_dquot *dqp, extern void xfs_trans_mod_dquot(struct xfs_trans *tp, struct xfs_dquot *dqp,
uint field, int64_t delta); uint field, int64_t delta);
extern void xfs_trans_dqjoin(struct xfs_trans *, struct xfs_dquot *); extern void xfs_trans_dqjoin(struct xfs_trans *, struct xfs_dquot *);
......
...@@ -156,14 +156,19 @@ xfs_trans_get_dqtrx( ...@@ -156,14 +156,19 @@ xfs_trans_get_dqtrx(
int i; int i;
struct xfs_dqtrx *qa; struct xfs_dqtrx *qa;
if (XFS_QM_ISUDQ(dqp)) switch (xfs_dquot_type(dqp)) {
case XFS_DQTYPE_USER:
qa = tp->t_dqinfo->dqs[XFS_QM_TRANS_USR]; qa = tp->t_dqinfo->dqs[XFS_QM_TRANS_USR];
else if (XFS_QM_ISGDQ(dqp)) break;
case XFS_DQTYPE_GROUP:
qa = tp->t_dqinfo->dqs[XFS_QM_TRANS_GRP]; qa = tp->t_dqinfo->dqs[XFS_QM_TRANS_GRP];
else if (XFS_QM_ISPDQ(dqp)) break;
case XFS_DQTYPE_PROJ:
qa = tp->t_dqinfo->dqs[XFS_QM_TRANS_PRJ]; qa = tp->t_dqinfo->dqs[XFS_QM_TRANS_PRJ];
else break;
default:
return NULL; return NULL;
}
for (i = 0; i < XFS_QM_TRANS_MAXDQS; i++) { for (i = 0; i < XFS_QM_TRANS_MAXDQS; i++) {
if (qa[i].qt_dquot == NULL || if (qa[i].qt_dquot == NULL ||
...@@ -713,7 +718,7 @@ xfs_trans_dqresv( ...@@ -713,7 +718,7 @@ xfs_trans_dqresv(
error_return: error_return:
xfs_dqunlock(dqp); xfs_dqunlock(dqp);
if (XFS_QM_ISPDQ(dqp)) if (xfs_dquot_type(dqp) == XFS_DQTYPE_PROJ)
return -ENOSPC; return -ENOSPC;
return -EDQUOT; return -EDQUOT;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment