Commit 8b972158 authored by Darrick J. Wong's avatar Darrick J. Wong

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: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
parent c1ccf967
...@@ -1612,7 +1612,7 @@ unsigned int xfs_refc_block(struct xfs_mount *mp); ...@@ -1612,7 +1612,7 @@ unsigned int xfs_refc_block(struct xfs_mount *mp);
* on the startblock. This speeds up mount time deletion of stale * on the startblock. This speeds up mount time deletion of stale
* staging extents because they're all at the right side of the tree. * 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_COWFLAG_BITLEN 1
#define REFCNTBT_AGBLOCK_BITLEN 31 #define REFCNTBT_AGBLOCK_BITLEN 31
......
...@@ -108,8 +108,8 @@ xfs_refcount_btrec_to_irec( ...@@ -108,8 +108,8 @@ xfs_refcount_btrec_to_irec(
uint32_t start; uint32_t start;
start = be32_to_cpu(rec->refc.rc_startblock); start = be32_to_cpu(rec->refc.rc_startblock);
if (start & XFS_REFC_COW_START) { if (start & XFS_REFC_COWFLAG) {
start &= ~XFS_REFC_COW_START; start &= ~XFS_REFC_COWFLAG;
irec->rc_domain = XFS_REFC_DOMAIN_COW; irec->rc_domain = XFS_REFC_DOMAIN_COW;
} else { } else {
irec->rc_domain = XFS_REFC_DOMAIN_SHARED; irec->rc_domain = XFS_REFC_DOMAIN_SHARED;
...@@ -1799,7 +1799,7 @@ xfs_refcount_recover_cow_leftovers( ...@@ -1799,7 +1799,7 @@ xfs_refcount_recover_cow_leftovers(
int error; int error;
/* reflink filesystems mustn't have AGs larger than 2^31-1 blocks */ /* 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) if (mp->m_sb.sb_agblocks > XFS_MAX_CRC_AG_BLOCKS)
return -EOPNOTSUPP; return -EOPNOTSUPP;
......
...@@ -34,9 +34,9 @@ xfs_refcount_encode_startblock( ...@@ -34,9 +34,9 @@ xfs_refcount_encode_startblock(
* query functions (which set rc_domain == -1U), so we check that the * query functions (which set rc_domain == -1U), so we check that the
* domain is /not/ shared. * domain is /not/ shared.
*/ */
start = startblock & ~XFS_REFC_COW_START; start = startblock & ~XFS_REFC_COWFLAG;
if (domain != XFS_REFC_DOMAIN_SHARED) if (domain != XFS_REFC_DOMAIN_SHARED)
start |= XFS_REFC_COW_START; start |= XFS_REFC_COWFLAG;
return start; return start;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment