Commit a7bcb147 authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: clean up open-coded fs block unit conversions

Replace some open-coded fs block unit conversions with the standard
conversion macro.
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarCarlos Maiolino <cmaiolino@redhat.com>
parent 8124c8a6
...@@ -612,7 +612,7 @@ xfs_inode_validate_extsize( ...@@ -612,7 +612,7 @@ xfs_inode_validate_extsize(
*/ */
if (rt_flag) if (rt_flag)
blocksize_bytes = mp->m_sb.sb_rextsize << mp->m_sb.sb_blocklog; blocksize_bytes = XFS_FSB_TO_B(mp, mp->m_sb.sb_rextsize);
else else
blocksize_bytes = mp->m_sb.sb_blocksize; blocksize_bytes = mp->m_sb.sb_blocksize;
......
...@@ -543,7 +543,7 @@ xfs_stat_blksize( ...@@ -543,7 +543,7 @@ xfs_stat_blksize(
* always return the realtime extent size. * always return the realtime extent size.
*/ */
if (XFS_IS_REALTIME_INODE(ip)) if (XFS_IS_REALTIME_INODE(ip))
return xfs_get_extsz_hint(ip) << mp->m_sb.sb_blocklog; return XFS_FSB_TO_B(mp, xfs_get_extsz_hint(ip));
/* /*
* Allow large block sizes to be reported to userspace programs if the * Allow large block sizes to be reported to userspace programs if the
...@@ -560,7 +560,7 @@ xfs_stat_blksize( ...@@ -560,7 +560,7 @@ xfs_stat_blksize(
*/ */
if (mp->m_flags & XFS_MOUNT_LARGEIO) { if (mp->m_flags & XFS_MOUNT_LARGEIO) {
if (mp->m_swidth) if (mp->m_swidth)
return mp->m_swidth << mp->m_sb.sb_blocklog; return XFS_FSB_TO_B(mp, mp->m_swidth);
if (mp->m_flags & XFS_MOUNT_ALLOCSIZE) if (mp->m_flags & XFS_MOUNT_ALLOCSIZE)
return 1U << mp->m_allocsize_log; return 1U << mp->m_allocsize_log;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment