diff options
author | Darrick J. Wong <djwong@kernel.org> | 2023-10-16 09:40:11 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2023-10-17 16:26:25 -0700 |
commit | ef5a83b7e597038d1c734ddb4bc00638082c2bf1 (patch) | |
tree | 9b5aa12266f11b3748c81079e004f6d5ecfc4640 /fs/xfs/libxfs/xfs_sb.c | |
parent | 5f57f7309d9ab9d24d50c5707472b1ed8af4eabc (diff) |
xfs: use shifting and masking when converting rt extents, if possiblerefactor-rt-unit-conversions-6.7_2023-10-19
Avoid the costs of integer division (32-bit and 64-bit) if the realtime
extent size is a power of two.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/libxfs/xfs_sb.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_sb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c index 6264daaab37b..1f74d0cd1618 100644 --- a/fs/xfs/libxfs/xfs_sb.c +++ b/fs/xfs/libxfs/xfs_sb.c @@ -975,6 +975,8 @@ xfs_sb_mount_common( mp->m_blockmask = sbp->sb_blocksize - 1; mp->m_blockwsize = sbp->sb_blocksize >> XFS_WORDLOG; mp->m_blockwmask = mp->m_blockwsize - 1; + mp->m_rtxblklog = log2_if_power2(sbp->sb_rextsize); + mp->m_rtxblkmask = mask64_if_power2(sbp->sb_rextsize); mp->m_alloc_mxr[0] = xfs_allocbt_maxrecs(mp, sbp->sb_blocksize, 1); mp->m_alloc_mxr[1] = xfs_allocbt_maxrecs(mp, sbp->sb_blocksize, 0); |