diff options
author | Darrick J. Wong <djwong@kernel.org> | 2022-09-21 09:47:38 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2022-11-09 19:07:56 -0800 |
commit | a5145f77ddb467390cda03330c2f035cdcdd57de (patch) | |
tree | 32c8d11ca5619faf60e73b6a125013ad55973a33 /fs/xfs/scrub/rtsummary.c | |
parent | 7e997b6704c25c7eab3614b8609a3cc5aff35a0a (diff) |
xfs: create helpers for rtsummary block/wordcount computations
Create helper functions that compute the number of blocks or words
necessary to store the rt summary file.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/scrub/rtsummary.c')
-rw-r--r-- | fs/xfs/scrub/rtsummary.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/xfs/scrub/rtsummary.c b/fs/xfs/scrub/rtsummary.c index 302ed8e1189b..3a98391732a0 100644 --- a/fs/xfs/scrub/rtsummary.c +++ b/fs/xfs/scrub/rtsummary.c @@ -40,6 +40,7 @@ xchk_setup_rtsummary( { struct xfs_mount *mp = sc->mp; size_t bufsize = mp->m_sb.sb_blocksize; + unsigned int wordcnt; unsigned int resblks = 0; int error; @@ -53,8 +54,10 @@ xchk_setup_rtsummary( * Create an xfile to construct a new rtsummary file. The xfile allows * us to avoid pinning kernel memory for this purpose. */ - error = xfile_create(mp, "realtime summary file", mp->m_rsumsize, - &sc->xfile); + wordcnt = xfs_rtsummary_wordcount(mp, mp->m_rsumlevels, + mp->m_sb.sb_rbmblocks); + error = xfile_create(mp, "realtime summary file", + wordcnt << XFS_WORDLOG, &sc->xfile); if (error) return error; |