]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: compute the rt refcount btree maxlevels during initialization
authorDarrick J. Wong <djwong@kernel.org>
Mon, 24 Feb 2025 18:22:02 +0000 (10:22 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 25 Feb 2025 17:16:01 +0000 (09:16 -0800)
Compute max rt refcount 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 f92805620c33f1e990ef14f60e0fd39b07632324..00bd46a6013e2841bf51da325791419bb7b77e5d 100644 (file)
@@ -597,7 +597,8 @@ static inline void
 xfs_rtbtree_compute_maxlevels(
        struct xfs_mount        *mp)
 {
-       mp->m_rtbtree_maxlevels = mp->m_rtrmap_maxlevels;
+       mp->m_rtbtree_maxlevels = max(mp->m_rtrmap_maxlevels,
+                                     mp->m_rtrefc_maxlevels);
 }
 
 /* Compute maximum possible height of all btrees. */
@@ -615,6 +616,7 @@ libxfs_compute_all_maxlevels(
        xfs_rmapbt_compute_maxlevels(mp);
        xfs_rtrmapbt_compute_maxlevels(mp);
        xfs_refcountbt_compute_maxlevels(mp);
+       xfs_rtrefcountbt_compute_maxlevels(mp);
 
        xfs_agbtree_compute_maxlevels(mp);
        xfs_rtbtree_compute_maxlevels(mp);