diff mbox series

[14/20] xfs: use XFS_B_TO_FSB in xfs_ioctl_setattr

Message ID 20210329053829.1851318-15-hch@lst.de (mailing list archive)
State Accepted
Headers show
Series [01/20] xfs: split xfs_imap_to_bp | expand

Commit Message

Christoph Hellwig March 29, 2021, 5:38 a.m. UTC
Clean up xfs_ioctl_setattr a bit by using XFS_B_TO_FSB.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_ioctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Darrick J. Wong March 30, 2021, 3:20 p.m. UTC | #1
On Mon, Mar 29, 2021 at 07:38:23AM +0200, Christoph Hellwig wrote:
> Clean up xfs_ioctl_setattr a bit by using XFS_B_TO_FSB.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Yay!
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  fs/xfs/xfs_ioctl.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> index d589ecef4ec730..7909e46b5c5a18 100644
> --- a/fs/xfs/xfs_ioctl.c
> +++ b/fs/xfs/xfs_ioctl.c
> @@ -1520,12 +1520,12 @@ xfs_ioctl_setattr(
>  	 * are set on the inode then unconditionally clear the extent size hint.
>  	 */
>  	if (ip->i_d.di_flags & (XFS_DIFLAG_EXTSIZE | XFS_DIFLAG_EXTSZINHERIT))
> -		ip->i_extsize = fa->fsx_extsize >> mp->m_sb.sb_blocklog;
> +		ip->i_extsize = XFS_B_TO_FSB(mp, fa->fsx_extsize);
>  	else
>  		ip->i_extsize = 0;
>  	if (xfs_sb_version_has_v3inode(&mp->m_sb) &&
>  	    (ip->i_d.di_flags2 & XFS_DIFLAG2_COWEXTSIZE))
> -		ip->i_cowextsize = fa->fsx_cowextsize >> mp->m_sb.sb_blocklog;
> +		ip->i_cowextsize = XFS_B_TO_FSB(mp, fa->fsx_cowextsize);
>  	else
>  		ip->i_cowextsize = 0;
>  
> -- 
> 2.30.1
>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index d589ecef4ec730..7909e46b5c5a18 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -1520,12 +1520,12 @@  xfs_ioctl_setattr(
 	 * are set on the inode then unconditionally clear the extent size hint.
 	 */
 	if (ip->i_d.di_flags & (XFS_DIFLAG_EXTSIZE | XFS_DIFLAG_EXTSZINHERIT))
-		ip->i_extsize = fa->fsx_extsize >> mp->m_sb.sb_blocklog;
+		ip->i_extsize = XFS_B_TO_FSB(mp, fa->fsx_extsize);
 	else
 		ip->i_extsize = 0;
 	if (xfs_sb_version_has_v3inode(&mp->m_sb) &&
 	    (ip->i_d.di_flags2 & XFS_DIFLAG2_COWEXTSIZE))
-		ip->i_cowextsize = fa->fsx_cowextsize >> mp->m_sb.sb_blocklog;
+		ip->i_cowextsize = XFS_B_TO_FSB(mp, fa->fsx_cowextsize);
 	else
 		ip->i_cowextsize = 0;