xfs: rename the ondisk dquot d_flags to d_type
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 16 Jul 2020 01:05:39 +0000 (18:05 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 29 Jul 2020 03:24:14 +0000 (20:24 -0700)
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 <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_dquot_buf.c
fs/xfs/libxfs/xfs_format.h
fs/xfs/xfs_dquot.c
fs/xfs/xfs_dquot_item_recover.c
fs/xfs/xfs_qm.c

index 39d64fb..5a2db00 100644 (file)
@@ -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)
@@ -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)) {
index 29564bd..31b7ece 100644 (file)
@@ -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 */
index 30cfa0c..799b986 100644 (file)
@@ -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),
@@ -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",
@@ -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);
@@ -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;
index 9317834..5875c7e 100644 (file)
@@ -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;
@@ -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;
index 1237577..be67570 100644 (file)
@@ -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;