]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
repair: make RT-specific code in {rmap,refcount}_avoid_check xfs-metadir-simplifications
authorChristoph Hellwig <hch@lst.de>
Thu, 11 Jul 2024 04:43:37 +0000 (06:43 +0200)
committerChristoph Hellwig <hch@lst.de>
Thu, 11 Jul 2024 05:04:33 +0000 (07:04 +0200)
Now that we're not allocation the bitmaps for non-rtgroups file systems,
don't touch them here either.

Signed-off-by: Christoph Hellwig <hch@lst.de>
repair/rmap.c

index 88589f7cbe4113dd345e32cd98e969ed3392b56e..5015d121edda747b673e69bd31fb601cae77b4fc 100644 (file)
@@ -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;
 }