From: Darrick J. Wong Date: Mon, 24 Feb 2025 18:21:57 +0000 (-0800) Subject: libxfs: compute the rt rmap btree maxlevels during initialization X-Git-Tag: v6.14.0~88 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c522cfc4cd548161cf1a7060273637e6b2e6ebe8;p=thirdparty%2Fxfsprogs-dev.git libxfs: compute the rt rmap btree maxlevels during initialization Compute max rt rmap btree height information when we set up libxfs. Signed-off-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- diff --git a/libxfs/init.c b/libxfs/init.c index 16291466..02a4cfdf 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -21,6 +21,7 @@ #include "xfs_trans.h" #include "xfs_rmap_btree.h" #include "xfs_refcount_btree.h" +#include "xfs_metafile.h" #include "libfrog/platform.h" #include "libfrog/util.h" #include "libxfs/xfile.h" @@ -598,6 +599,14 @@ xfs_agbtree_compute_maxlevels( mp->m_agbtree_maxlevels = max(levels, mp->m_refc_maxlevels); } +/* Compute maximum possible height for realtime btree types for this fs. */ +static inline void +xfs_rtbtree_compute_maxlevels( + struct xfs_mount *mp) +{ + mp->m_rtbtree_maxlevels = mp->m_rtrmap_maxlevels; +} + /* Compute maximum possible height of all btrees. */ void libxfs_compute_all_maxlevels( @@ -611,10 +620,11 @@ libxfs_compute_all_maxlevels( igeo->attr_fork_offset = xfs_bmap_compute_attr_offset(mp); xfs_ialloc_setup_geometry(mp); xfs_rmapbt_compute_maxlevels(mp); + xfs_rtrmapbt_compute_maxlevels(mp); xfs_refcountbt_compute_maxlevels(mp); xfs_agbtree_compute_maxlevels(mp); - + xfs_rtbtree_compute_maxlevels(mp); } /* Mount the metadata files under the metadata directory tree. */