xfs: dynamically allocate cursors based on maxlevels
authorDarrick J. Wong <djwong@kernel.org>
Thu, 16 Sep 2021 19:27:24 +0000 (12:27 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 19 Oct 2021 18:45:15 +0000 (11:45 -0700)
commitc940a0c54a2e9333478f1d87ed40006a04fcec7e
treef02e9ba660f9fe2b33b0a6b7080e437c5a2c6b87
parentc0643f6fdd6d3c448142ed1492a9a6b6505f9afb
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>
fs/xfs/libxfs/xfs_alloc_btree.c
fs/xfs/libxfs/xfs_bmap_btree.c
fs/xfs/libxfs/xfs_btree.h
fs/xfs/libxfs/xfs_ialloc_btree.c
fs/xfs/libxfs/xfs_refcount_btree.c
fs/xfs/libxfs/xfs_rmap_btree.c
fs/xfs/xfs_super.c