From: Christoph Hellwig Date: Thu, 11 Jul 2024 04:43:37 +0000 (+0200) Subject: repair: make RT-specific code in {rmap,refcount}_avoid_check X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Fxfs-metadir-simplifications;p=users%2Fhch%2Fxfsprogs.git repair: make RT-specific code in {rmap,refcount}_avoid_check Now that we're not allocation the bitmaps for non-rtgroups file systems, don't touch them here either. Signed-off-by: Christoph Hellwig --- diff --git a/repair/rmap.c b/repair/rmap.c index 88589f7cb..5015d121e 100644 --- a/repair/rmap.c +++ b/repair/rmap.c @@ -1405,13 +1405,15 @@ rmap_avoid_check( struct xfs_rtgroup *rtg; xfs_rgnumber_t rgno; - for_each_rtgroup(mp, rgno, rtg) { - struct xfs_ag_rmap *ar = rmaps_for_group(true, rtg->rtg_rgno); + if (xfs_has_rtgroups(mp)) { + for_each_rtgroup(mp, rgno, rtg) { + struct xfs_ag_rmap *ar = rmaps_for_group(true, rtg->rtg_rgno); - ar->rg_rmap_ino = NULLFSINO; - } + ar->rg_rmap_ino = NULLFSINO; + } - bitmap_clear(rmap_inodes, 0, XFS_MAXINUMBER); + bitmap_clear(rmap_inodes, 0, XFS_MAXINUMBER); + } rmapbt_suspect = true; } @@ -1992,13 +1994,15 @@ refcount_avoid_check( struct xfs_rtgroup *rtg; xfs_rgnumber_t rgno; - for_each_rtgroup(mp, rgno, rtg) { - struct xfs_ag_rmap *ar = rmaps_for_group(true, rtg->rtg_rgno); + if (xfs_has_rtgroups(mp)) { + for_each_rtgroup(mp, rgno, rtg) { + struct xfs_ag_rmap *ar = rmaps_for_group(true, rtg->rtg_rgno); - ar->rg_refcount_ino = NULLFSINO; - } + ar->rg_refcount_ino = NULLFSINO; + } - bitmap_clear(refcount_inodes, 0, XFS_MAXINUMBER); + bitmap_clear(refcount_inodes, 0, XFS_MAXINUMBER); + } refcbt_suspect = true; }