]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: compute the rt rmap btree maxlevels during initialization
authorDarrick J. Wong <djwong@kernel.org>
Mon, 24 Feb 2025 18:21:57 +0000 (10:21 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 25 Feb 2025 17:16:00 +0000 (09:16 -0800)
Compute max rt rmap btree height information when we set up libxfs.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
libxfs/init.c

index 16291466ac86d3f5cfd4f82ed76c32d62e9c902d..02a4cfdf38b198f03ea9b3c701b9e3a96029dfbe 100644 (file)
@@ -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. */