Message ID | 162250084916.490289.453146390591474194.stgit@locust (mailing list archive) |
---|---|
State | Accepted, archived |
Headers | show |
Series | xfs: various unit conversion | expand |
On Mon, May 31, 2021 at 03:40:49PM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong <djwong@kernel.org> > > The superblock verifier already validates that (1 << blocklog) == > blocksize, so use the value directly instead of doing math. > > Signed-off-by: Darrick J. Wong <djwong@kernel.org> Looks fine. Reviewed-by: Dave Chinner <dchinner@redhat.com>
On Mon, May 31, 2021 at 03:40:49PM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong <djwong@kernel.org> > > The superblock verifier already validates that (1 << blocklog) == > blocksize, so use the value directly instead of doing math. > > Signed-off-by: Darrick J. Wong <djwong@kernel.org> Looks good. Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> > --- > fs/xfs/xfs_bmap_util.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > > diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c > index 0936f3a96fe6..997eb5c6e9b4 100644 > --- a/fs/xfs/xfs_bmap_util.c > +++ b/fs/xfs/xfs_bmap_util.c > @@ -945,7 +945,7 @@ xfs_flush_unmap_range( > xfs_off_t rounding, start, end; > 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); > end = round_up(offset + len, rounding) - 1; > > @@ -1053,9 +1053,9 @@ xfs_prepare_shift( > * extent (after split) during the shift and corrupt the file. Start > * 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) > - 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 >
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index 0936f3a96fe6..997eb5c6e9b4 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -945,7 +945,7 @@ xfs_flush_unmap_range( xfs_off_t rounding, start, end; 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); end = round_up(offset + len, rounding) - 1; @@ -1053,9 +1053,9 @@ xfs_prepare_shift( * extent (after split) during the shift and corrupt the file. Start * 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) - 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