On Wed, Oct 11, 2023 at 11:08:03AM -0700, Darrick J. Wong wrote: > +/* Compute the number of rtsummary blocks needed to track the given rt space. */ > +xfs_filblks_t > +xfs_rtsummary_blockcount( > + struct xfs_mount *mp, > + unsigned int rsumlevels, > + xfs_extlen_t rbmblocks) > +{ > + unsigned long long rsumwords; > + > + rsumwords = (unsigned long long)rsumlevels * rbmblocks; > + return XFS_B_TO_FSB(mp, rsumwords << XFS_WORDLOG); > +} This helper and its users make complete sense to me and looks good: Reviewed-by: Christoph Hellwig <hch@xxxxxx> > +/* > + * Compute the number of rtsummary info words needed to populate every block of > + * a summary file that is large enough to track the given rt space. > + */ > +unsigned long long > +xfs_rtsummary_wordcount( > + struct xfs_mount *mp, > + unsigned int rsumlevels, > + xfs_extlen_t rbmblocks) > +{ > + xfs_filblks_t blocks; > + > + blocks = xfs_rtsummary_blockcount(mp, rsumlevels, rbmblocks); > + return XFS_FSB_TO_B(mp, blocks) >> XFS_WORDLOG; > +} > @@ -54,8 +55,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. > */ > + wordcnt = xfs_rtsummary_wordcount(mp, mp->m_rsumlevels, > + mp->m_sb.sb_rbmblocks); > descr = xchk_xfile_descr(sc, "realtime summary file"); > - error = xfile_create(descr, mp->m_rsumsize, &sc->xfile); > + error = xfile_create(descr, wordcnt << XFS_WORDLOG, &sc->xfile); > kfree(descr); But this confuses me. What problem does it solve over just using m_rsumsize?