Commit 985a78fd authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: rename dquot incore state flags

Rename the existing incore dquot "dq_flags" field to "q_flags" to match
everything else in the structure, then move the two actual dquot state
flags to the XFS_DQFLAG_ namespace from XFS_DQ_.
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarChandan Babu R <chandanrlinux@gmail.com>
parent 0dcc0728
......@@ -24,17 +24,17 @@ typedef uint16_t xfs_qwarncnt_t;
#define XFS_DQ_USER 0x0001 /* a user quota */
#define XFS_DQ_PROJ 0x0002 /* project quota */
#define XFS_DQ_GROUP 0x0004 /* a group quota */
#define XFS_DQ_DIRTY 0x0008 /* dquot is dirty */
#define XFS_DQ_FREEING 0x0010 /* dquot is being torn down */
#define XFS_DQFLAG_DIRTY 0x0008 /* dquot is dirty */
#define XFS_DQFLAG_FREEING 0x0010 /* dquot is being torn down */
#define XFS_DQ_ALLTYPES (XFS_DQ_USER|XFS_DQ_PROJ|XFS_DQ_GROUP)
#define XFS_DQ_FLAGS \
#define XFS_DQFLAG_STRINGS \
{ XFS_DQ_USER, "USER" }, \
{ XFS_DQ_PROJ, "PROJ" }, \
{ XFS_DQ_GROUP, "GROUP" }, \
{ XFS_DQ_DIRTY, "DIRTY" }, \
{ XFS_DQ_FREEING, "FREEING" }
{ XFS_DQFLAG_DIRTY, "DIRTY" }, \
{ XFS_DQFLAG_FREEING, "FREEING" }
/*
* We have the possibility of all three quota types being active at once, and
......
......@@ -723,7 +723,7 @@ xfs_qm_dqget_cache_lookup(
}
xfs_dqlock(dqp);
if (dqp->dq_flags & XFS_DQ_FREEING) {
if (dqp->q_flags & XFS_DQFLAG_FREEING) {
xfs_dqunlock(dqp);
mutex_unlock(&qi->qi_tree_lock);
trace_xfs_dqget_freeing(dqp);
......@@ -1179,7 +1179,7 @@ xfs_qm_dqflush(
/*
* Clear the dirty field and remember the flush lsn for later use.
*/
dqp->dq_flags &= ~XFS_DQ_DIRTY;
dqp->q_flags &= ~XFS_DQFLAG_DIRTY;
xfs_trans_ail_copy_lsn(mp->m_ail, &dqp->q_logitem.qli_flush_lsn,
&dqp->q_logitem.qli_item.li_lsn);
......@@ -1220,7 +1220,7 @@ xfs_qm_dqflush(
return 0;
out_abort:
dqp->dq_flags &= ~XFS_DQ_DIRTY;
dqp->q_flags &= ~XFS_DQFLAG_DIRTY;
xfs_trans_ail_delete(lip, 0);
xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);
out_unlock:
......
......@@ -31,9 +31,10 @@ enum {
* The incore dquot structure
*/
struct xfs_dquot {
uint dq_flags;
struct list_head q_lru;
struct xfs_mount *q_mount;
uint8_t dq_flags;
uint16_t q_flags;
uint q_nrefs;
xfs_daddr_t q_blkno;
int q_bufoffset;
......@@ -145,7 +146,7 @@ static inline bool xfs_dquot_lowsp(struct xfs_dquot *dqp)
}
#define XFS_DQ_IS_LOCKED(dqp) (mutex_is_locked(&((dqp)->q_qlock)))
#define XFS_DQ_IS_DIRTY(dqp) ((dqp)->dq_flags & XFS_DQ_DIRTY)
#define XFS_DQ_IS_DIRTY(dqp) ((dqp)->q_flags & XFS_DQFLAG_DIRTY)
#define XFS_QM_ISUDQ(dqp) ((dqp)->dq_flags & XFS_DQ_USER)
#define XFS_QM_ISPDQ(dqp) ((dqp)->dq_flags & XFS_DQ_PROJ)
#define XFS_QM_ISGDQ(dqp) ((dqp)->dq_flags & XFS_DQ_GROUP)
......
......@@ -124,10 +124,10 @@ xfs_qm_dqpurge(
int error = -EAGAIN;
xfs_dqlock(dqp);
if ((dqp->dq_flags & XFS_DQ_FREEING) || dqp->q_nrefs != 0)
if ((dqp->q_flags & XFS_DQFLAG_FREEING) || dqp->q_nrefs != 0)
goto out_unlock;
dqp->dq_flags |= XFS_DQ_FREEING;
dqp->q_flags |= XFS_DQFLAG_FREEING;
xfs_dqflock(dqp);
......@@ -148,7 +148,7 @@ xfs_qm_dqpurge(
error = xfs_bwrite(bp);
xfs_buf_relse(bp);
} else if (error == -EAGAIN) {
dqp->dq_flags &= ~XFS_DQ_FREEING;
dqp->q_flags &= ~XFS_DQFLAG_FREEING;
goto out_unlock;
}
xfs_dqflock(dqp);
......@@ -474,7 +474,7 @@ xfs_qm_dquot_isolate(
/*
* Prevent lookups now that we are past the point of no return.
*/
dqp->dq_flags |= XFS_DQ_FREEING;
dqp->q_flags |= XFS_DQFLAG_FREEING;
xfs_dqunlock(dqp);
ASSERT(dqp->q_nrefs == 0);
......@@ -1113,7 +1113,7 @@ xfs_qm_quotacheck_dqadjust(
xfs_qm_adjust_dqtimers(mp, dqp);
}
dqp->dq_flags |= XFS_DQ_DIRTY;
dqp->q_flags |= XFS_DQFLAG_DIRTY;
xfs_qm_dqput(dqp);
return 0;
}
......@@ -1219,7 +1219,7 @@ xfs_qm_flush_one(
int error = 0;
xfs_dqlock(dqp);
if (dqp->dq_flags & XFS_DQ_FREEING)
if (dqp->q_flags & XFS_DQFLAG_FREEING)
goto out_unlock;
if (!XFS_DQ_IS_DIRTY(dqp))
goto out_unlock;
......
......@@ -598,7 +598,7 @@ xfs_qm_scall_setqlim(
*/
xfs_qm_adjust_dqtimers(mp, dqp);
}
dqp->dq_flags |= XFS_DQ_DIRTY;
dqp->q_flags |= XFS_DQFLAG_DIRTY;
xfs_trans_log_dquot(tp, dqp);
error = xfs_trans_commit(tp);
......
......@@ -877,7 +877,7 @@ DECLARE_EVENT_CLASS(xfs_dquot_class,
TP_fast_assign(
__entry->dev = dqp->q_mount->m_super->s_dev;
__entry->id = be32_to_cpu(dqp->q_core.d_id);
__entry->flags = dqp->dq_flags;
__entry->flags = dqp->dq_flags | dqp->q_flags;
__entry->nrefs = dqp->q_nrefs;
__entry->res_bcount = dqp->q_res_bcount;
__entry->bcount = be64_to_cpu(dqp->q_core.d_bcount);
......@@ -896,7 +896,7 @@ DECLARE_EVENT_CLASS(xfs_dquot_class,
"icnt 0x%llx ihardlimit 0x%llx isoftlimit 0x%llx]",
MAJOR(__entry->dev), MINOR(__entry->dev),
__entry->id,
__print_flags(__entry->flags, "|", XFS_DQ_FLAGS),
__print_flags(__entry->flags, "|", XFS_DQFLAG_STRINGS),
__entry->nrefs,
__entry->res_bcount,
__entry->bcount,
......
......@@ -391,7 +391,7 @@ xfs_trans_apply_dquot_deltas(
xfs_qm_adjust_dqtimers(tp->t_mountp, dqp);
}
dqp->dq_flags |= XFS_DQ_DIRTY;
dqp->q_flags |= XFS_DQFLAG_DIRTY;
/*
* add this to the list of items to get logged
*/
......
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