From 1a9d26291c68fbb8f8d24f9f694b32223a072745 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Thu, 22 Feb 2024 12:35:36 -0800 Subject: xfs: store the btree pointer length in struct xfs_btree_ops Make the pointer length an explicit field in the btree operations structure so that the next patch (which introduces an explicit btree type enum) doesn't have to play a bunch of awkward games with inferring the pointer length from the enumeration. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/xfs/scrub/btree.c | 4 ++-- fs/xfs/scrub/newbt.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'fs/xfs/scrub') diff --git a/fs/xfs/scrub/btree.c b/fs/xfs/scrub/btree.c index e882919996c4..3d3f82007ac6 100644 --- a/fs/xfs/scrub/btree.c +++ b/fs/xfs/scrub/btree.c @@ -244,7 +244,7 @@ xchk_btree_ptr_ok( return true; /* Otherwise, check the pointers. */ - if (bs->cur->bc_ops->geom_flags & XFS_BTGEO_LONG_PTRS) + if (bs->cur->bc_ops->ptr_len == XFS_BTREE_LONG_PTR_LEN) res = xfs_btree_check_lptr(bs->cur, be64_to_cpu(ptr->l), level); else res = xfs_btree_check_sptr(bs->cur, be32_to_cpu(ptr->s), level); @@ -602,7 +602,7 @@ xchk_btree_get_block( return error; xfs_btree_get_block(bs->cur, level, pbp); - if (bs->cur->bc_ops->geom_flags & XFS_BTGEO_LONG_PTRS) + if (bs->cur->bc_ops->ptr_len == XFS_BTREE_LONG_PTR_LEN) failed_at = __xfs_btree_check_lblock(bs->cur, *pblock, level, *pbp); else diff --git a/fs/xfs/scrub/newbt.c b/fs/xfs/scrub/newbt.c index 84267be79dc1..608d7ab01d89 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_ops->geom_flags & XFS_BTGEO_LONG_PTRS) + if (cur->bc_ops->ptr_len == XFS_BTREE_LONG_PTR_LEN) ptr->l = cpu_to_be64(XFS_AGB_TO_FSB(mp, resv->pag->pag_agno, agbno)); else -- cgit v1.2.3