From ab2b6ee3b8bebc1898df39eb83d4cb823492f525 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Wed, 3 Jul 2024 14:22:19 -0700 Subject: [PATCH] xfs: online repair of the realtime rmap btree Repair the realtime rmap btree while mounted. Signed-off-by: Darrick J. Wong --- 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 e55de26ae..1b8a6950e 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