Skip to content

Commit

Permalink
xfs: clean up open-coded fs block unit conversions
Browse files Browse the repository at this point in the history
Replace some open-coded fs block unit conversions with the standard
conversion macro.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
  • Loading branch information
Darrick J. Wong committed Jun 1, 2021
1 parent 8124c8a commit a7bcb14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fs/xfs/libxfs/xfs_inode_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ xfs_inode_validate_extsize(
*/

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
blocksize_bytes = mp->m_sb.sb_blocksize;

Expand Down
4 changes: 2 additions & 2 deletions fs/xfs/xfs_iops.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ xfs_stat_blksize(
* always return the realtime extent size.
*/
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
Expand All @@ -560,7 +560,7 @@ xfs_stat_blksize(
*/
if (mp->m_flags & XFS_MOUNT_LARGEIO) {
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)
return 1U << mp->m_allocsize_log;
}
Expand Down

0 comments on commit a7bcb14

Please sign in to comment.