From 4800887b457460a0a1edbf7d657be47d4d8758cd Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 29 Mar 2021 11:11:42 -0700 Subject: xfs: cleanup xfs_fill_fsxattr Add a local xfs_mount variable, and use the XFS_FSB_TO_B helper. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_ioctl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'fs/xfs') diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index e45bce9b1108..d589ecef4ec7 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -1117,11 +1117,13 @@ xfs_fill_fsxattr( bool attr, struct fsxattr *fa) { + struct xfs_mount *mp = ip->i_mount; struct xfs_ifork *ifp = attr ? ip->i_afp : &ip->i_df; simple_fill_fsxattr(fa, xfs_ip2xflags(ip)); - fa->fsx_extsize = ip->i_extsize << ip->i_mount->m_sb.sb_blocklog; - fa->fsx_cowextsize = ip->i_cowextsize << ip->i_mount->m_sb.sb_blocklog; + + fa->fsx_extsize = XFS_FSB_TO_B(mp, ip->i_extsize); + fa->fsx_cowextsize = XFS_FSB_TO_B(mp, ip->i_cowextsize); fa->fsx_projid = ip->i_projid; if (ifp && (ifp->if_flags & XFS_IFEXTENTS)) fa->fsx_nextents = xfs_iext_count(ifp); -- cgit v1.2.3