summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_alloc_btree.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2024-02-22 23:33:18 +0300
committerDarrick J. Wong <djwong@kernel.org>2024-02-22 23:33:18 +0300
commit056d22c87132cf4968f5e702116439bea9795930 (patch)
tree9d90f676bc6429d6c370b3e1f98e1cee818d3eaf /fs/xfs/libxfs/xfs_alloc_btree.c
parent2ed0b2c7f33159825af1a1a83face66edb52348a (diff)
downloadlinux-056d22c87132cf4968f5e702116439bea9795930.tar.xz
xfs: set the btree cursor bc_ops in xfs_btree_alloc_cursor
This is a precursor to putting more static data in the btree ops structure. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/libxfs/xfs_alloc_btree.c')
-rw-r--r--fs/xfs/libxfs/xfs_alloc_btree.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/xfs/libxfs/xfs_alloc_btree.c b/fs/xfs/libxfs/xfs_alloc_btree.c
index a7032bf0cd37..cdcb2358351c 100644
--- a/fs/xfs/libxfs/xfs_alloc_btree.c
+++ b/fs/xfs/libxfs/xfs_alloc_btree.c
@@ -512,18 +512,17 @@ xfs_allocbt_init_common(
ASSERT(btnum == XFS_BTNUM_BNO || btnum == XFS_BTNUM_CNT);
- cur = xfs_btree_alloc_cursor(mp, tp, btnum, mp->m_alloc_maxlevels,
- xfs_allocbt_cur_cache);
- cur->bc_ag.abt.active = false;
-
if (btnum == XFS_BTNUM_CNT) {
- cur->bc_ops = &xfs_cntbt_ops;
+ cur = xfs_btree_alloc_cursor(mp, tp, btnum, &xfs_cntbt_ops,
+ mp->m_alloc_maxlevels, xfs_allocbt_cur_cache);
cur->bc_statoff = XFS_STATS_CALC_INDEX(xs_abtc_2);
cur->bc_flags = XFS_BTREE_LASTREC_UPDATE;
} else {
- cur->bc_ops = &xfs_bnobt_ops;
+ cur = xfs_btree_alloc_cursor(mp, tp, btnum, &xfs_bnobt_ops,
+ mp->m_alloc_maxlevels, xfs_allocbt_cur_cache);
cur->bc_statoff = XFS_STATS_CALC_INDEX(xs_abtb_2);
}
+ cur->bc_ag.abt.active = false;
cur->bc_ag.pag = xfs_perag_hold(pag);