Skip to content

Commit cb9cd6e

Browse files
Christoph HellwigDarrick J. Wong
authored andcommitted
xfs: calculate RT bitmap and summary blocks based on sb_rextents
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 <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
1 parent c1442d2 commit cb9cd6e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

fs/xfs/scrub/rtbitmap.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ xchk_setup_rtbitmap(
6767
if (mp->m_sb.sb_rblocks) {
6868
rtb->rextents = xfs_rtb_to_rtx(mp, mp->m_sb.sb_rblocks);
6969
rtb->rextslog = xfs_compute_rextslog(rtb->rextents);
70-
rtb->rbmblocks = xfs_rtbitmap_blockcount(mp, rtb->rextents);
70+
rtb->rbmblocks = xfs_rtbitmap_blockcount(mp,
71+
mp->m_sb.sb_rextents);
7172
}
7273

7374
return 0;

fs/xfs/scrub/rtsummary.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,10 @@ xchk_setup_rtsummary(
105105
int rextslog;
106106

107107
rts->rextents = xfs_rtb_to_rtx(mp, mp->m_sb.sb_rblocks);
108-
rextslog = xfs_compute_rextslog(rts->rextents);
108+
rextslog = xfs_compute_rextslog(mp->m_sb.sb_rextents);
109109
rts->rsumlevels = rextslog + 1;
110-
rts->rbmblocks = xfs_rtbitmap_blockcount(mp, rts->rextents);
110+
rts->rbmblocks = xfs_rtbitmap_blockcount(mp,
111+
mp->m_sb.sb_rextents);
111112
rts->rsumblocks = xfs_rtsummary_blockcount(mp, rts->rsumlevels,
112113
rts->rbmblocks);
113114
}

0 commit comments

Comments
 (0)