Skip to content

Commit

Permalink
xfs: rename the ondisk dquot d_flags to d_type
Browse files Browse the repository at this point in the history
The ondisk dquot stores the quota record type in the flags field.
Rename this field to d_type to make the _type relationship between the
ondisk and incore dquot more obvious.

Signed-off-by: Darrick J. Wong <[email protected]>
Reviewed-by: Dave Chinner <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
  • Loading branch information
djwong committed Jul 29, 2020
1 parent a990f7a commit d8c1af0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions fs/xfs/libxfs/xfs_dquot_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ xfs_dquot_verify(
if (ddq->d_version != XFS_DQUOT_VERSION)
return __this_address;

if (ddq->d_flags & ~XFS_DQTYPE_ANY)
if (ddq->d_type & ~XFS_DQTYPE_ANY)
return __this_address;
ddq_type = ddq->d_flags & XFS_DQTYPE_REC_MASK;
ddq_type = ddq->d_type & XFS_DQTYPE_REC_MASK;
if (ddq_type != XFS_DQTYPE_USER &&
ddq_type != XFS_DQTYPE_PROJ &&
ddq_type != XFS_DQTYPE_GROUP)
Expand Down Expand Up @@ -124,7 +124,7 @@ xfs_dqblk_repair(

dqb->dd_diskdq.d_magic = cpu_to_be16(XFS_DQUOT_MAGIC);
dqb->dd_diskdq.d_version = XFS_DQUOT_VERSION;
dqb->dd_diskdq.d_flags = type;
dqb->dd_diskdq.d_type = type;
dqb->dd_diskdq.d_id = cpu_to_be32(id);

if (xfs_sb_version_hascrc(&mp->m_sb)) {
Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/libxfs/xfs_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
struct xfs_disk_dquot {
__be16 d_magic; /* dquot magic = XFS_DQUOT_MAGIC */
__u8 d_version; /* dquot version */
__u8 d_flags; /* XFS_DQTYPE_USER/PROJ/GROUP */
__u8 d_type; /* XFS_DQTYPE_USER/PROJ/GROUP */
__be32 d_id; /* user,project,group id */
__be64 d_blk_hardlimit;/* absolute limit on disk blks */
__be64 d_blk_softlimit;/* preferred limit on disk blks */
Expand Down
8 changes: 4 additions & 4 deletions fs/xfs/xfs_dquot.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ xfs_qm_init_dquot_blk(
d->dd_diskdq.d_magic = cpu_to_be16(XFS_DQUOT_MAGIC);
d->dd_diskdq.d_version = XFS_DQUOT_VERSION;
d->dd_diskdq.d_id = cpu_to_be32(curid);
d->dd_diskdq.d_flags = type;
d->dd_diskdq.d_type = type;
if (xfs_sb_version_hascrc(&mp->m_sb)) {
uuid_copy(&d->dd_uuid, &mp->m_sb.sb_meta_uuid);
xfs_update_cksum((char *)d, sizeof(struct xfs_dqblk),
Expand Down Expand Up @@ -488,7 +488,7 @@ xfs_dquot_from_disk(
* Ensure that we got the type and ID we were looking for.
* Everything else was checked by the dquot buffer verifier.
*/
if ((ddqp->d_flags & XFS_DQTYPE_REC_MASK) != xfs_dquot_type(dqp) ||
if ((ddqp->d_type & XFS_DQTYPE_REC_MASK) != xfs_dquot_type(dqp) ||
be32_to_cpu(ddqp->d_id) != dqp->q_id) {
xfs_alert_tag(bp->b_mount, XFS_PTAG_VERIFIER_ERROR,
"Metadata corruption detected at %pS, quota %u",
Expand All @@ -498,7 +498,7 @@ xfs_dquot_from_disk(
}

/* copy everything from disk dquot to the incore dquot */
dqp->q_type = ddqp->d_flags;
dqp->q_type = ddqp->d_type;
dqp->q_blk.hardlimit = be64_to_cpu(ddqp->d_blk_hardlimit);
dqp->q_blk.softlimit = be64_to_cpu(ddqp->d_blk_softlimit);
dqp->q_ino.hardlimit = be64_to_cpu(ddqp->d_ino_hardlimit);
Expand Down Expand Up @@ -539,7 +539,7 @@ xfs_dquot_to_disk(
{
ddqp->d_magic = cpu_to_be16(XFS_DQUOT_MAGIC);
ddqp->d_version = XFS_DQUOT_VERSION;
ddqp->d_flags = dqp->q_type;
ddqp->d_type = dqp->q_type;
ddqp->d_id = cpu_to_be32(dqp->q_id);
ddqp->d_pad0 = 0;
ddqp->d_pad = 0;
Expand Down
4 changes: 2 additions & 2 deletions fs/xfs/xfs_dquot_item_recover.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ xlog_recover_dquot_ra_pass2(
if (item->ri_buf[1].i_len < sizeof(struct xfs_disk_dquot))
return;

type = recddq->d_flags & XFS_DQTYPE_REC_MASK;
type = recddq->d_type & XFS_DQTYPE_REC_MASK;
ASSERT(type);
if (log->l_quotaoffs_flag & type)
return;
Expand Down Expand Up @@ -91,7 +91,7 @@ xlog_recover_dquot_commit_pass2(
/*
* This type of quotas was turned off, so ignore this record.
*/
type = recddq->d_flags & XFS_DQTYPE_REC_MASK;
type = recddq->d_type & XFS_DQTYPE_REC_MASK;
ASSERT(type);
if (log->l_quotaoffs_flag & type)
return 0;
Expand Down
4 changes: 2 additions & 2 deletions fs/xfs/xfs_qm.c
Original file line number Diff line number Diff line change
Expand Up @@ -855,14 +855,14 @@ xfs_qm_reset_dqcounts(
* xfs_dquot_verify.
*/
if (xfs_dqblk_verify(mp, &dqb[j], id + j) ||
(dqb[j].dd_diskdq.d_flags & XFS_DQTYPE_REC_MASK) != type)
(dqb[j].dd_diskdq.d_type & XFS_DQTYPE_REC_MASK) != type)
xfs_dqblk_repair(mp, &dqb[j], id + j, type);

/*
* Reset type in case we are reusing group quota file for
* project quotas or vice versa
*/
ddq->d_flags = type;
ddq->d_type = type;
ddq->d_bcount = 0;
ddq->d_icount = 0;
ddq->d_rtbcount = 0;
Expand Down

0 comments on commit d8c1af0

Please sign in to comment.