]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: rename XFS_REFC_COW_START to _COWFLAG
authorDarrick J. Wong <djwong@kernel.org>
Fri, 18 Nov 2022 11:23:57 +0000 (12:23 +0100)
committerCarlos Maiolino <cem@kernel.org>
Mon, 21 Nov 2022 14:26:49 +0000 (15:26 +0100)
Source kernel commit: 8b972158afcaa66c538c3ee1d394f096fcd238a8

We've been (ab)using XFS_REFC_COW_START as both an integer quantity and
a bit flag, even though it's *only* a bit flag.  Rename the variable to
reflect its nature and update the cast target since we're not supposed
to be comparing it to xfs_agblock_t now.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
db/check.c
libxfs/xfs_format.h
libxfs/xfs_refcount.c
libxfs/xfs_refcount.h
repair/scan.c

index c9149daadfc120d83efb14d17e469b074fc78756..680edf1f9ed455539de1d0c2dde64224bb9fc376 100644 (file)
@@ -4848,8 +4848,8 @@ scanfunc_refcnt(
                                char            *msg;
 
                                agbno = be32_to_cpu(rp[i].rc_startblock);
-                               if (agbno >= XFS_REFC_COW_START) {
-                                       agbno -= XFS_REFC_COW_START;
+                               if (agbno >= XFS_REFC_COWFLAG) {
+                                       agbno -= XFS_REFC_COWFLAG;
                                        msg = _(
                "leftover CoW extent (%u/%u) len %u\n");
                                } else {
index 005dd65b71cd6347835f2a3554e7431af28f790b..371dc07233e059a95545629107d409f21653dbe4 100644 (file)
@@ -1612,7 +1612,7 @@ unsigned int xfs_refc_block(struct xfs_mount *mp);
  * on the startblock.  This speeds up mount time deletion of stale
  * staging extents because they're all at the right side of the tree.
  */
-#define XFS_REFC_COW_START             ((xfs_agblock_t)(1U << 31))
+#define XFS_REFC_COWFLAG               (1U << 31)
 #define REFCNTBT_COWFLAG_BITLEN                1
 #define REFCNTBT_AGBLOCK_BITLEN                31
 
index 0a934aecc6cbea23807f1ec488a5823495115547..64e66861b86ebc96300e85abb68b4528049fbc71 100644 (file)
@@ -107,8 +107,8 @@ xfs_refcount_btrec_to_irec(
        uint32_t                        start;
 
        start = be32_to_cpu(rec->refc.rc_startblock);
-       if (start & XFS_REFC_COW_START) {
-               start &= ~XFS_REFC_COW_START;
+       if (start & XFS_REFC_COWFLAG) {
+               start &= ~XFS_REFC_COWFLAG;
                irec->rc_domain = XFS_REFC_DOMAIN_COW;
        } else {
                irec->rc_domain = XFS_REFC_DOMAIN_SHARED;
@@ -1798,7 +1798,7 @@ xfs_refcount_recover_cow_leftovers(
        int                             error;
 
        /* reflink filesystems mustn't have AGs larger than 2^31-1 blocks */
-       BUILD_BUG_ON(XFS_MAX_CRC_AG_BLOCKS >= XFS_REFC_COW_START);
+       BUILD_BUG_ON(XFS_MAX_CRC_AG_BLOCKS >= XFS_REFC_COWFLAG);
        if (mp->m_sb.sb_agblocks > XFS_MAX_CRC_AG_BLOCKS)
                return -EOPNOTSUPP;
 
index ee32e8eb5a993178fabed2b7a280d59047c3b814..452f30556f5a9ad9606ddd46ad3b59f5da81fc41 100644 (file)
@@ -34,9 +34,9 @@ xfs_refcount_encode_startblock(
         * query functions (which set rc_domain == -1U), so we check that the
         * domain is /not/ shared.
         */
-       start = startblock & ~XFS_REFC_COW_START;
+       start = startblock & ~XFS_REFC_COWFLAG;
        if (domain != XFS_REFC_DOMAIN_SHARED)
-               start |= XFS_REFC_COW_START;
+               start |= XFS_REFC_COWFLAG;
 
        return start;
 }
index 7e4d4d8b8efe852f0191af1dcb3628dec354f544..859a6e69374f1d2cf086b840f5261bb3bff049cb 100644 (file)
@@ -1374,16 +1374,16 @@ _("%s btree block claimed (state %d), agno %d, bno %d, suspect %d\n"),
                        b = agb = be32_to_cpu(rp[i].rc_startblock);
                        len = be32_to_cpu(rp[i].rc_blockcount);
                        nr = be32_to_cpu(rp[i].rc_refcount);
-                       if (b >= XFS_REFC_COW_START && nr != 1)
+                       if (b >= XFS_REFC_COWFLAG && nr != 1)
                                do_warn(
 _("leftover CoW extent has incorrect refcount in record %u of %s btree block %u/%u\n"),
                                        i, name, agno, bno);
                        if (nr == 1) {
-                               if (agb < XFS_REFC_COW_START)
+                               if (agb < XFS_REFC_COWFLAG)
                                        do_warn(
 _("leftover CoW extent has invalid startblock in record %u of %s btree block %u/%u\n"),
                                                i, name, agno, bno);
-                               agb -= XFS_REFC_COW_START;
+                               agb -= XFS_REFC_COWFLAG;
                        }
                        end = agb + len;