From patchwork Mon Mar 29 05:38:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12169511 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BF9DC433E4 for ; Mon, 29 Mar 2021 05:41:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E774B61968 for ; Mon, 29 Mar 2021 05:41:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230161AbhC2Fka (ORCPT ); Mon, 29 Mar 2021 01:40:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229911AbhC2FkS (ORCPT ); Mon, 29 Mar 2021 01:40:18 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7C06C061762 for ; Sun, 28 Mar 2021 22:40:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=Ui/Av88V4O47B9iVB0H7SDXKsDl60Uob7jzKIE2jmiM=; b=beIAQ+9kPSdH53tz6vQF8pMtgA +gPRYAbKQQ4L4GsRw0K+VloXW3oGZEnycRbQz/10kWgxnQ8ppMyfhckaUhfejN4V22679PQjx0VeY +m8f5Q4C3akoQcXZNWVXLvuTmUEctH6EhRS6iR7LUUIro8YP0aykMrvP1R/hzzIRVRiDFW+caVdNZ 984TDhQE6xor1UB1JttlA+Iz+0iSqYYkwa/nMD8vdPI7G7biwT43rQRWvN4+fLwsnQUcg8BW7GaKz 5myzsigCF1rr7G470MnAJzJ28QRv613d3PYS7iE/WKvagTcleNc2S2zWSDLxGPUxH6PffaK7Rcy7H GUk5uv6g==; Received: from 173.40.253.84.static.wline.lns.sme.cust.swisscom.ch ([84.253.40.173] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lQkcB-006oPy-OL; Mon, 29 Mar 2021 05:39:04 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Cc: "Darrick J . Wong" Subject: [PATCH 13/20] xfs: cleanup xfs_fill_fsxattr Date: Mon, 29 Mar 2021 07:38:22 +0200 Message-Id: <20210329053829.1851318-14-hch@lst.de> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210329053829.1851318-1-hch@lst.de> References: <20210329053829.1851318-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Add a local xfs_mount variable, and use the XFS_FSB_TO_B helper. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_ioctl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index e45bce9b11082c..d589ecef4ec730 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);