diff options
author | Darrick J. Wong <djwong@kernel.org> | 2021-09-23 10:32:06 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-10-19 11:45:16 -0700 |
commit | 0ed5f7356daee74244b02e100b3cc043e886e686 (patch) | |
tree | 12bc85f663f6be62fff23c583309bcd0bf0c1237 /fs/xfs/libxfs/xfs_bmap.c | |
parent | bc8883eb775dd18d8b84733d8b3a3955b72d103a (diff) | |
download | lwn-0ed5f7356daee74244b02e100b3cc043e886e686.tar.gz lwn-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.c | 1 |
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 |