diff options
author | Darrick J. Wong <djwong@kernel.org> | 2021-09-16 21:27:24 +0200 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-10-19 20:45:15 +0200 |
commit | c940a0c54a2e9333478f1d87ed40006a04fcec7e (patch) | |
tree | f02e9ba660f9fe2b33b0a6b7080e437c5a2c6b87 /fs/xfs/libxfs/xfs_rmap_btree.c | |
parent | xfs: encode the max btree height in the cursor (diff) | |
download | linux-c940a0c54a2e9333478f1d87ed40006a04fcec7e.tar.xz linux-c940a0c54a2e9333478f1d87ed40006a04fcec7e.zip |
xfs: dynamically allocate cursors based on maxlevels
To support future btree code, we need to be able to size btree cursors
dynamically for very large btrees. Switch the maxlevels computation to
use the precomputed values in the superblock, and create cursors that
can handle a certain height. For now, we retain the btree cursor cache
that can handle up to 9-level btrees, though a subsequent patch
introduces separate caches for each btree type, where each cache's
objects will be exactly tall enough to handle the specific btree type.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_rmap_btree.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_rmap_btree.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_rmap_btree.c b/fs/xfs/libxfs/xfs_rmap_btree.c index f3c4d0965cc9..1b48b7b3ee30 100644 --- a/fs/xfs/libxfs/xfs_rmap_btree.c +++ b/fs/xfs/libxfs/xfs_rmap_btree.c @@ -452,7 +452,8 @@ xfs_rmapbt_init_common( struct xfs_btree_cur *cur; /* Overlapping btree; 2 keys per pointer. */ - cur = xfs_btree_alloc_cursor(mp, tp, XFS_BTNUM_RMAP); + cur = xfs_btree_alloc_cursor(mp, tp, XFS_BTNUM_RMAP, + mp->m_rmap_maxlevels); cur->bc_flags = XFS_BTREE_CRC_BLOCKS | XFS_BTREE_OVERLAPPING; cur->bc_statoff = XFS_STATS_CALC_INDEX(xs_rmap_2); cur->bc_ops = &xfs_rmapbt_ops; |