diff options
author | Darrick J. Wong <djwong@kernel.org> | 2023-10-16 09:48:20 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2023-10-18 10:58:58 -0700 |
commit | d0448fe76ac1a9ccbce574577a4c82246d17eec4 (patch) | |
tree | acec3f73d1e01b5589bb8daac4bcca6ef2fa301e /fs/xfs/scrub | |
parent | 097b4b7b64ef67a4703b89fd4064480b61557fd5 (diff) | |
download | linux-stable-d0448fe76ac1a9ccbce574577a4c82246d17eec4.tar.gz linux-stable-d0448fe76ac1a9ccbce574577a4c82246d17eec4.tar.bz2 linux-stable-d0448fe76ac1a9ccbce574577a4c82246d17eec4.zip |
xfs: create helpers for rtbitmap block/wordcount computations
Create helper functions that compute the number of blocks or words
necessary to store the rt bitmap.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/scrub')
-rw-r--r-- | fs/xfs/scrub/rtsummary.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/xfs/scrub/rtsummary.c b/fs/xfs/scrub/rtsummary.c index 3c8a6cc33800..0971d002d906 100644 --- a/fs/xfs/scrub/rtsummary.c +++ b/fs/xfs/scrub/rtsummary.c @@ -160,12 +160,11 @@ xchk_rtsum_compute( struct xfs_scrub *sc) { struct xfs_mount *mp = sc->mp; - unsigned long long rtbmp_bytes; + unsigned long long rtbmp_blocks; /* If the bitmap size doesn't match the computed size, bail. */ - rtbmp_bytes = howmany_64(mp->m_sb.sb_rextents, NBBY); - if (roundup_64(rtbmp_bytes, mp->m_sb.sb_blocksize) != - mp->m_rbmip->i_disk_size) + rtbmp_blocks = xfs_rtbitmap_blockcount(mp, mp->m_sb.sb_rextents); + if (XFS_FSB_TO_B(mp, rtbmp_blocks) != mp->m_rbmip->i_disk_size) return -EFSCORRUPTED; return xfs_rtalloc_query_all(sc->mp, sc->tp, xchk_rtsum_record_free, |