xfs: cleanup xfs_fill_fsxattr

Add a local xfs_mount variable, and use the XFS_FSB_TO_B helper.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
This commit is contained in:
Christoph Hellwig 2021-03-29 11:11:42 -07:00 committed by Darrick J. Wong
parent 965e0a1ad2
commit 4800887b45

View File

@ -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);