]> www.infradead.org Git - users/hch/xfs.git/commitdiff
xfs: calculate RT bitmap and summary blocks based on sb_rextents
authorChristoph Hellwig <hch@lst.de>
Fri, 2 Aug 2024 03:28:04 +0000 (05:28 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 6 Aug 2024 13:05:12 +0000 (06:05 -0700)
Use the on-disk rextents to calculate the bitmap and summary blocks
instead of the calculated one so that we can refactor the helpers for
calculating them.

As the RT bitmap and summary scrubbers already check that sb_rextents
match the block count this does not change coverage of the scrubber.

Signed-off-by: Christoph Hellwig <hch@lst.de>
fs/xfs/scrub/rtbitmap.c
fs/xfs/scrub/rtsummary.c

index 7df7f4facc14fd7e6a057423e25a848033240c68..5e1fb4dab0954ef7e0e309846655aca1a32712df 100644 (file)
@@ -67,7 +67,8 @@ xchk_setup_rtbitmap(
        if (mp->m_sb.sb_rblocks) {
                rtb->rextents = xfs_rtb_to_rtx(mp, mp->m_sb.sb_rblocks);
                rtb->rextslog = xfs_compute_rextslog(rtb->rextents);
-               rtb->rbmblocks = xfs_rtbitmap_blockcount(mp, rtb->rextents);
+               rtb->rbmblocks = xfs_rtbitmap_blockcount(mp,
+                               mp->m_sb.sb_rextents);
        }
 
        return 0;
index cc532aaf174ff37fd585ef934fc392ad2f39f7ca..08e82fa4945f9664f380bc749448d23ee24d3d0c 100644 (file)
@@ -105,9 +105,10 @@ xchk_setup_rtsummary(
                int             rextslog;
 
                rts->rextents = xfs_rtb_to_rtx(mp, mp->m_sb.sb_rblocks);
-               rextslog = xfs_compute_rextslog(rts->rextents);
+               rextslog = xfs_compute_rextslog(mp->m_sb.sb_rextents);
                rts->rsumlevels = rextslog + 1;
-               rts->rbmblocks = xfs_rtbitmap_blockcount(mp, rts->rextents);
+               rts->rbmblocks = xfs_rtbitmap_blockcount(mp,
+                               mp->m_sb.sb_rextents);
                rts->rsumblocks = xfs_rtsummary_blockcount(mp, rts->rsumlevels,
                                rts->rbmblocks);
        }