From patchwork Mon Jul 23 13:04:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Foster X-Patchwork-Id: 10540199 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7047691E for ; Mon, 23 Jul 2018 13:04:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60C0328760 for ; Mon, 23 Jul 2018 13:04:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5527E287A3; Mon, 23 Jul 2018 13:04:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F08C428760 for ; Mon, 23 Jul 2018 13:04:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388109AbeGWOFZ (ORCPT ); Mon, 23 Jul 2018 10:05:25 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:49726 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388116AbeGWOFY (ORCPT ); Mon, 23 Jul 2018 10:05:24 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6BE2C4064307 for ; Mon, 23 Jul 2018 13:04:15 +0000 (UTC) Received: from bfoster.bos.redhat.com (dhcp-41-2.bos.redhat.com [10.18.41.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id 56B39111AF23 for ; Mon, 23 Jul 2018 13:04:15 +0000 (UTC) From: Brian Foster To: linux-xfs@vger.kernel.org Subject: [PATCH v2 10/15] xfs: use internal dfops in attr code Date: Mon, 23 Jul 2018 09:04:09 -0400 Message-Id: <20180723130414.47980-11-bfoster@redhat.com> In-Reply-To: <20180723130414.47980-1-bfoster@redhat.com> References: <20180723130414.47980-1-bfoster@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 23 Jul 2018 13:04:15 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 23 Jul 2018 13:04:15 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'bfoster@redhat.com' RCPT:'' Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove the unnecessary on-stack dfops structure and use the internal transaction dfops instead. The lower level xattr code already appropriately accesses ->t_dfops throughout. Signed-off-by: Brian Foster Reviewed-by: Bill O'Donnell Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- fs/xfs/libxfs/xfs_attr.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c index 927d4c968f9a..66a22c80a0db 100644 --- a/fs/xfs/libxfs/xfs_attr.c +++ b/fs/xfs/libxfs/xfs_attr.c @@ -202,7 +202,6 @@ xfs_attr_set( struct xfs_mount *mp = dp->i_mount; struct xfs_buf *leaf_bp = NULL; struct xfs_da_args args; - struct xfs_defer_ops dfops; struct xfs_trans_res tres; int rsvd = (flags & ATTR_ROOT) != 0; int error, err2, local; @@ -251,7 +250,6 @@ xfs_attr_set( rsvd ? XFS_TRANS_RESERVE : 0, &args.trans); if (error) return error; - xfs_defer_init(args.trans, &dfops); xfs_ilock(dp, XFS_ILOCK_EXCL); error = xfs_trans_reserve_quota_nblks(args.trans, dp, args.total, 0, @@ -315,18 +313,18 @@ xfs_attr_set( */ error = xfs_attr_shortform_to_leaf(&args, &leaf_bp); if (error) - goto out_defer_cancel; + goto out; /* * Prevent the leaf buffer from being unlocked so that a * concurrent AIL push cannot grab the half-baked leaf * buffer and run into problems with the write verifier. */ xfs_trans_bhold(args.trans, leaf_bp); - xfs_defer_bjoin(&dfops, leaf_bp); - xfs_defer_ijoin(&dfops, dp); - error = xfs_defer_finish(&args.trans, &dfops); + xfs_defer_bjoin(args.trans->t_dfops, leaf_bp); + xfs_defer_ijoin(args.trans->t_dfops, dp); + error = xfs_defer_finish(&args.trans, args.trans->t_dfops); if (error) - goto out_defer_cancel; + goto out; /* * Commit the leaf transformation. We'll need another (linked) @@ -366,8 +364,6 @@ xfs_attr_set( return error; -out_defer_cancel: - xfs_defer_cancel(&dfops); out: if (leaf_bp) xfs_trans_brelse(args.trans, leaf_bp); @@ -389,7 +385,6 @@ xfs_attr_remove( { struct xfs_mount *mp = dp->i_mount; struct xfs_da_args args; - struct xfs_defer_ops dfops; int error; XFS_STATS_INC(mp, xs_attr_remove); @@ -422,7 +417,6 @@ xfs_attr_remove( &args.trans); if (error) return error; - xfs_defer_init(args.trans, &dfops); xfs_ilock(dp, XFS_ILOCK_EXCL); /*