Skip to content

Commit d8c1af0

Browse files
committed
xfs: rename the ondisk dquot d_flags to d_type
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]>
1 parent a990f7a commit d8c1af0

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

fs/xfs/libxfs/xfs_dquot_buf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ xfs_dquot_verify(
6161
if (ddq->d_version != XFS_DQUOT_VERSION)
6262
return __this_address;
6363

64-
if (ddq->d_flags & ~XFS_DQTYPE_ANY)
64+
if (ddq->d_type & ~XFS_DQTYPE_ANY)
6565
return __this_address;
66-
ddq_type = ddq->d_flags & XFS_DQTYPE_REC_MASK;
66+
ddq_type = ddq->d_type & XFS_DQTYPE_REC_MASK;
6767
if (ddq_type != XFS_DQTYPE_USER &&
6868
ddq_type != XFS_DQTYPE_PROJ &&
6969
ddq_type != XFS_DQTYPE_GROUP)
@@ -124,7 +124,7 @@ xfs_dqblk_repair(
124124

125125
dqb->dd_diskdq.d_magic = cpu_to_be16(XFS_DQUOT_MAGIC);
126126
dqb->dd_diskdq.d_version = XFS_DQUOT_VERSION;
127-
dqb->dd_diskdq.d_flags = type;
127+
dqb->dd_diskdq.d_type = type;
128128
dqb->dd_diskdq.d_id = cpu_to_be32(id);
129129

130130
if (xfs_sb_version_hascrc(&mp->m_sb)) {

fs/xfs/libxfs/xfs_format.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
11681168
struct xfs_disk_dquot {
11691169
__be16 d_magic; /* dquot magic = XFS_DQUOT_MAGIC */
11701170
__u8 d_version; /* dquot version */
1171-
__u8 d_flags; /* XFS_DQTYPE_USER/PROJ/GROUP */
1171+
__u8 d_type; /* XFS_DQTYPE_USER/PROJ/GROUP */
11721172
__be32 d_id; /* user,project,group id */
11731173
__be64 d_blk_hardlimit;/* absolute limit on disk blks */
11741174
__be64 d_blk_softlimit;/* preferred limit on disk blks */

fs/xfs/xfs_dquot.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ xfs_qm_init_dquot_blk(
200200
d->dd_diskdq.d_magic = cpu_to_be16(XFS_DQUOT_MAGIC);
201201
d->dd_diskdq.d_version = XFS_DQUOT_VERSION;
202202
d->dd_diskdq.d_id = cpu_to_be32(curid);
203-
d->dd_diskdq.d_flags = type;
203+
d->dd_diskdq.d_type = type;
204204
if (xfs_sb_version_hascrc(&mp->m_sb)) {
205205
uuid_copy(&d->dd_uuid, &mp->m_sb.sb_meta_uuid);
206206
xfs_update_cksum((char *)d, sizeof(struct xfs_dqblk),
@@ -488,7 +488,7 @@ xfs_dquot_from_disk(
488488
* Ensure that we got the type and ID we were looking for.
489489
* Everything else was checked by the dquot buffer verifier.
490490
*/
491-
if ((ddqp->d_flags & XFS_DQTYPE_REC_MASK) != xfs_dquot_type(dqp) ||
491+
if ((ddqp->d_type & XFS_DQTYPE_REC_MASK) != xfs_dquot_type(dqp) ||
492492
be32_to_cpu(ddqp->d_id) != dqp->q_id) {
493493
xfs_alert_tag(bp->b_mount, XFS_PTAG_VERIFIER_ERROR,
494494
"Metadata corruption detected at %pS, quota %u",
@@ -498,7 +498,7 @@ xfs_dquot_from_disk(
498498
}
499499

500500
/* copy everything from disk dquot to the incore dquot */
501-
dqp->q_type = ddqp->d_flags;
501+
dqp->q_type = ddqp->d_type;
502502
dqp->q_blk.hardlimit = be64_to_cpu(ddqp->d_blk_hardlimit);
503503
dqp->q_blk.softlimit = be64_to_cpu(ddqp->d_blk_softlimit);
504504
dqp->q_ino.hardlimit = be64_to_cpu(ddqp->d_ino_hardlimit);
@@ -539,7 +539,7 @@ xfs_dquot_to_disk(
539539
{
540540
ddqp->d_magic = cpu_to_be16(XFS_DQUOT_MAGIC);
541541
ddqp->d_version = XFS_DQUOT_VERSION;
542-
ddqp->d_flags = dqp->q_type;
542+
ddqp->d_type = dqp->q_type;
543543
ddqp->d_id = cpu_to_be32(dqp->q_id);
544544
ddqp->d_pad0 = 0;
545545
ddqp->d_pad = 0;

fs/xfs/xfs_dquot_item_recover.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ xlog_recover_dquot_ra_pass2(
3939
if (item->ri_buf[1].i_len < sizeof(struct xfs_disk_dquot))
4040
return;
4141

42-
type = recddq->d_flags & XFS_DQTYPE_REC_MASK;
42+
type = recddq->d_type & XFS_DQTYPE_REC_MASK;
4343
ASSERT(type);
4444
if (log->l_quotaoffs_flag & type)
4545
return;
@@ -91,7 +91,7 @@ xlog_recover_dquot_commit_pass2(
9191
/*
9292
* This type of quotas was turned off, so ignore this record.
9393
*/
94-
type = recddq->d_flags & XFS_DQTYPE_REC_MASK;
94+
type = recddq->d_type & XFS_DQTYPE_REC_MASK;
9595
ASSERT(type);
9696
if (log->l_quotaoffs_flag & type)
9797
return 0;

fs/xfs/xfs_qm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -855,14 +855,14 @@ xfs_qm_reset_dqcounts(
855855
* xfs_dquot_verify.
856856
*/
857857
if (xfs_dqblk_verify(mp, &dqb[j], id + j) ||
858-
(dqb[j].dd_diskdq.d_flags & XFS_DQTYPE_REC_MASK) != type)
858+
(dqb[j].dd_diskdq.d_type & XFS_DQTYPE_REC_MASK) != type)
859859
xfs_dqblk_repair(mp, &dqb[j], id + j, type);
860860

861861
/*
862862
* Reset type in case we are reusing group quota file for
863863
* project quotas or vice versa
864864
*/
865-
ddq->d_flags = type;
865+
ddq->d_type = type;
866866
ddq->d_bcount = 0;
867867
ddq->d_icount = 0;
868868
ddq->d_rtbcount = 0;

0 commit comments

Comments
 (0)