aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_bmap.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-09-23 10:32:06 -0700
committerDarrick J. Wong <djwong@kernel.org>2021-10-19 11:45:16 -0700
commit0ed5f7356daee74244b02e100b3cc043e886e686 (patch)
tree12bc85f663f6be62fff23c583309bcd0bf0c1237 /fs/xfs/libxfs/xfs_bmap.c
parentxfs: kill XFS_BTREE_MAXLEVELS (diff)
downloadlinux-dev-0ed5f7356daee74244b02e100b3cc043e886e686.tar.xz
linux-dev-0ed5f7356daee74244b02e100b3cc043e886e686.zip
xfs: compute absolute maximum nlevels for each btree type
Add code for all five btree types so that we can compute the absolute maximum possible btree height for each btree type. This is a setup for the next patch, which makes every btree type have its own cursor cache. The functions are exported so that we can have xfs_db report the absolute maximum btree heights for each btree type, rather than making everyone run their own ad-hoc computations. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_bmap.c')
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 2ae5bf9a74e7..321617e837ef 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -93,6 +93,7 @@ xfs_bmap_compute_maxlevels(
maxblocks = (maxblocks + minnoderecs - 1) / minnoderecs;
}
mp->m_bm_maxlevels[whichfork] = level;
+ ASSERT(mp->m_bm_maxlevels[whichfork] <= xfs_bmbt_maxlevels_ondisk());
}
unsigned int