From 30e2bdaed2b040f30abfcac7e11a357f9426d4d7 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Mon, 12 Aug 2024 14:19:09 -0700 Subject: [PATCH] xfs: online repair of the realtime rmap btree Source kernel commit: f813af307d62d4c4d620a358bbd406f89ffdeca2 Repair the realtime rmap btree while mounted. Signed-off-by: Darrick J. Wong Signed-off-by: Christoph Hellwig --- libxfs/xfs_btree_staging.c | 1 + libxfs/xfs_rtrmap_btree.c | 2 +- libxfs/xfs_rtrmap_btree.h | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libxfs/xfs_btree_staging.c b/libxfs/xfs_btree_staging.c index 48953c12d..4dc75deec 100644 --- a/libxfs/xfs_btree_staging.c +++ b/libxfs/xfs_btree_staging.c @@ -134,6 +134,7 @@ xfs_btree_stage_ifakeroot( cur->bc_ino.ifake = ifake; cur->bc_nlevels = ifake->if_levels; cur->bc_ino.forksize = ifake->if_fork_size; + cur->bc_ino.whichfork = XFS_STAGING_FORK; cur->bc_flags |= XFS_BTREE_STAGING; } diff --git a/libxfs/xfs_rtrmap_btree.c b/libxfs/xfs_rtrmap_btree.c index 005715b72..f11d0acb5 100644 --- a/libxfs/xfs_rtrmap_btree.c +++ b/libxfs/xfs_rtrmap_btree.c @@ -641,7 +641,7 @@ xfs_rtrmapbt_compute_maxlevels( } /* Calculate the rtrmap btree size for some records. */ -static unsigned long long +unsigned long long xfs_rtrmapbt_calc_size( struct xfs_mount *mp, unsigned long long len) diff --git a/libxfs/xfs_rtrmap_btree.h b/libxfs/xfs_rtrmap_btree.h index 33b79daa8..910b26018 100644 --- a/libxfs/xfs_rtrmap_btree.h +++ b/libxfs/xfs_rtrmap_btree.h @@ -197,4 +197,7 @@ void xfs_iflush_rtrmap(struct xfs_inode *ip, struct xfs_dinode *dip); int xfs_rtrmapbt_create(struct xfs_rtgroup *rtg, struct xfs_inode *ip, struct xfs_trans *tp, bool init); +unsigned long long xfs_rtrmapbt_calc_size(struct xfs_mount *mp, + unsigned long long len); + #endif /* __XFS_RTRMAP_BTREE_H__ */ -- 2.50.1