summaryrefslogtreecommitdiffstats
path: root/fs/xfs/scrub/newbt.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2024-02-22 12:34:29 -0800
committerDarrick J. Wong <djwong@kernel.org>2024-02-22 12:34:29 -0800
commitfd9c7f7722d815527269b80d9990aecffa06957c (patch)
tree01ac875e0e6d63bf68b105aadbc834f9bf0bfacd /fs/xfs/scrub/newbt.c
parentc0afba9a8363f17d4efed22a8764df33389aebe8 (diff)
downloadlinux-stable-fd9c7f7722d815527269b80d9990aecffa06957c.tar.gz
linux-stable-fd9c7f7722d815527269b80d9990aecffa06957c.tar.bz2
linux-stable-fd9c7f7722d815527269b80d9990aecffa06957c.zip
xfs: encode the btree geometry flags in the btree ops structure
Certain btree flags never change for the life of a btree cursor because they describe the geometry of the btree itself. Encode these in the btree ops structure and reduce the amount of code required in each btree type's init_cursor functions. This also frees up most of the bits in bc_flags. A previous version of this patch also converted the open-coded flags logic to helpers. This was removed due to the pending refactoring (that follows this patch) to eliminate most of the state flags. Conversion script: sed \ -e 's/XFS_BTREE_LONG_PTRS/XFS_BTGEO_LONG_PTRS/g' \ -e 's/XFS_BTREE_ROOT_IN_INODE/XFS_BTGEO_ROOT_IN_INODE/g' \ -e 's/XFS_BTREE_LASTREC_UPDATE/XFS_BTGEO_LASTREC_UPDATE/g' \ -e 's/XFS_BTREE_OVERLAPPING/XFS_BTGEO_OVERLAPPING/g' \ -e 's/cur->bc_flags & XFS_BTGEO_/cur->bc_ops->geom_flags \& XFS_BTGEO_/g' \ -i $(git ls-files fs/xfs/*.[ch] fs/xfs/libxfs/*.[ch] fs/xfs/scrub/*.[ch]) Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/scrub/newbt.c')
-rw-r--r--fs/xfs/scrub/newbt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/scrub/newbt.c b/fs/xfs/scrub/newbt.c
index bb6d980b4fcd..84267be79dc1 100644
--- a/fs/xfs/scrub/newbt.c
+++ b/fs/xfs/scrub/newbt.c
@@ -535,7 +535,7 @@ xrep_newbt_claim_block(
trace_xrep_newbt_claim_block(mp, resv->pag->pag_agno, agbno, 1,
xnr->oinfo.oi_owner);
- if (cur->bc_flags & XFS_BTREE_LONG_PTRS)
+ if (cur->bc_ops->geom_flags & XFS_BTGEO_LONG_PTRS)
ptr->l = cpu_to_be64(XFS_AGB_TO_FSB(mp, resv->pag->pag_agno,
agbno));
else