Commit 20bd8e63 authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: remove unnecessary shifts

The superblock verifier already validates that (1 << blocklog) ==
blocksize, so use the value directly instead of doing math.
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 a7bcb147
...@@ -945,7 +945,7 @@ xfs_flush_unmap_range( ...@@ -945,7 +945,7 @@ xfs_flush_unmap_range(
xfs_off_t rounding, start, end; xfs_off_t rounding, start, end;
int error; int error;
rounding = max_t(xfs_off_t, 1 << mp->m_sb.sb_blocklog, PAGE_SIZE); rounding = max_t(xfs_off_t, mp->m_sb.sb_blocksize, PAGE_SIZE);
start = round_down(offset, rounding); start = round_down(offset, rounding);
end = round_up(offset + len, rounding) - 1; end = round_up(offset + len, rounding) - 1;
...@@ -1053,9 +1053,9 @@ xfs_prepare_shift( ...@@ -1053,9 +1053,9 @@ xfs_prepare_shift(
* extent (after split) during the shift and corrupt the file. Start * extent (after split) during the shift and corrupt the file. Start
* with the block just prior to the start to stabilize the boundary. * with the block just prior to the start to stabilize the boundary.
*/ */
offset = round_down(offset, 1 << mp->m_sb.sb_blocklog); offset = round_down(offset, mp->m_sb.sb_blocksize);
if (offset) if (offset)
offset -= (1 << mp->m_sb.sb_blocklog); offset -= mp->m_sb.sb_blocksize;
/* /*
* Writeback and invalidate cache for the remainder of the file as we're * Writeback and invalidate cache for the remainder of the file as we're
......
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