Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xfs: rename XFS_REFC_COW_START to _COWFLAG

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>

+6 -6
+1 -1
fs/xfs/libxfs/xfs_format.h
··· 1612 1612 * on the startblock. This speeds up mount time deletion of stale 1613 1613 * staging extents because they're all at the right side of the tree. 1614 1614 */ 1615 - #define XFS_REFC_COW_START ((xfs_agblock_t)(1U << 31)) 1615 + #define XFS_REFC_COWFLAG (1U << 31) 1616 1616 #define REFCNTBT_COWFLAG_BITLEN 1 1617 1617 #define REFCNTBT_AGBLOCK_BITLEN 31 1618 1618
+3 -3
fs/xfs/libxfs/xfs_refcount.c
··· 108 108 uint32_t start; 109 109 110 110 start = be32_to_cpu(rec->refc.rc_startblock); 111 - if (start & XFS_REFC_COW_START) { 112 - start &= ~XFS_REFC_COW_START; 111 + if (start & XFS_REFC_COWFLAG) { 112 + start &= ~XFS_REFC_COWFLAG; 113 113 irec->rc_domain = XFS_REFC_DOMAIN_COW; 114 114 } else { 115 115 irec->rc_domain = XFS_REFC_DOMAIN_SHARED; ··· 1799 1799 int error; 1800 1800 1801 1801 /* reflink filesystems mustn't have AGs larger than 2^31-1 blocks */ 1802 - BUILD_BUG_ON(XFS_MAX_CRC_AG_BLOCKS >= XFS_REFC_COW_START); 1802 + BUILD_BUG_ON(XFS_MAX_CRC_AG_BLOCKS >= XFS_REFC_COWFLAG); 1803 1803 if (mp->m_sb.sb_agblocks > XFS_MAX_CRC_AG_BLOCKS) 1804 1804 return -EOPNOTSUPP; 1805 1805
+2 -2
fs/xfs/libxfs/xfs_refcount.h
··· 34 34 * query functions (which set rc_domain == -1U), so we check that the 35 35 * domain is /not/ shared. 36 36 */ 37 - start = startblock & ~XFS_REFC_COW_START; 37 + start = startblock & ~XFS_REFC_COWFLAG; 38 38 if (domain != XFS_REFC_DOMAIN_SHARED) 39 - start |= XFS_REFC_COW_START; 39 + start |= XFS_REFC_COWFLAG; 40 40 41 41 return start; 42 42 }