Skip to content

Commit 8b97215

Browse files
author
Darrick J. Wong
committed
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 <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
1 parent c1ccf96 commit 8b97215

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

fs/xfs/libxfs/xfs_format.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1612,7 +1612,7 @@ unsigned int xfs_refc_block(struct xfs_mount *mp);
16121612
* on the startblock. This speeds up mount time deletion of stale
16131613
* staging extents because they're all at the right side of the tree.
16141614
*/
1615-
#define XFS_REFC_COW_START ((xfs_agblock_t)(1U << 31))
1615+
#define XFS_REFC_COWFLAG (1U << 31)
16161616
#define REFCNTBT_COWFLAG_BITLEN 1
16171617
#define REFCNTBT_AGBLOCK_BITLEN 31
16181618

fs/xfs/libxfs/xfs_refcount.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ xfs_refcount_btrec_to_irec(
108108
uint32_t start;
109109

110110
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;
113113
irec->rc_domain = XFS_REFC_DOMAIN_COW;
114114
} else {
115115
irec->rc_domain = XFS_REFC_DOMAIN_SHARED;
@@ -1799,7 +1799,7 @@ xfs_refcount_recover_cow_leftovers(
17991799
int error;
18001800

18011801
/* 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);
18031803
if (mp->m_sb.sb_agblocks > XFS_MAX_CRC_AG_BLOCKS)
18041804
return -EOPNOTSUPP;
18051805

fs/xfs/libxfs/xfs_refcount.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ xfs_refcount_encode_startblock(
3434
* query functions (which set rc_domain == -1U), so we check that the
3535
* domain is /not/ shared.
3636
*/
37-
start = startblock & ~XFS_REFC_COW_START;
37+
start = startblock & ~XFS_REFC_COWFLAG;
3838
if (domain != XFS_REFC_DOMAIN_SHARED)
39-
start |= XFS_REFC_COW_START;
39+
start |= XFS_REFC_COWFLAG;
4040

4141
return start;
4242
}

0 commit comments

Comments
 (0)