From patchwork Thu Sep 5 22:18:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 11134083 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C6C221599 for ; Thu, 5 Sep 2019 22:19:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DCC4020828 for ; Thu, 5 Sep 2019 22:19:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="aTSwbGZ+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389781AbfIEWTk (ORCPT ); Thu, 5 Sep 2019 18:19:40 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:33758 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389801AbfIEWTj (ORCPT ); Thu, 5 Sep 2019 18:19:39 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x85MJ7bc078087 for ; Thu, 5 Sep 2019 22:19:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2019-08-05; bh=Cw8ITrtAfW3vi3/3iSKT20OFRFSCI9XlkBC2IlCGBkM=; b=aTSwbGZ+4NugX8XgCzktyqVqxxaDLEEsuVDaToOg9eJryZe5om7C9q6+7luccZusbKjR NzjhtJVDD5jloUqBooDNEXQlB+MonK/qDfdPv3838bsVFiZ5MKGFEFklu7VtFhecowxR 33vUxygM/si/3ODFuB41Qg2gDL3LPt+XlRDD6LSz3LKEi4ROet2A+Ogm2Zd2swtiFeZm Vrh2i7dUuQEKHtw9+Fwj/fT6K0004Fa0/n10ehRfdkjb4AJh8Tk46Kr3OS3z/ngJWzaX XL/Wh3v4kzP/RbDc6VGYqNMc6vd5ngK0OOqyRhEd8F4Ui+ysiXcleyhWgRpaEMwCZknE Hw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 2uuaqj02qr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 05 Sep 2019 22:19:38 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x85MIepU123383 for ; Thu, 5 Sep 2019 22:19:37 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 2uthq27va4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 05 Sep 2019 22:19:37 +0000 Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x85MIj5T011580 for ; Thu, 5 Sep 2019 22:18:45 GMT Received: from localhost.localdomain (/67.1.183.122) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 05 Sep 2019 15:18:45 -0700 From: Allison Collins To: linux-xfs@vger.kernel.org Subject: [PATCH v3 06/19] xfs: Factor up trans handling in xfs_attr3_leaf_flipflags Date: Thu, 5 Sep 2019 15:18:24 -0700 Message-Id: <20190905221837.17388-7-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190905221837.17388-1-allison.henderson@oracle.com> References: <20190905221837.17388-1-allison.henderson@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9371 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909050207 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9371 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909050207 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Since delayed operations cannot roll transactions, factor up the transaction handling into the calling function Signed-off-by: Allison Collins Reviewed-by: Brian Foster --- fs/xfs/libxfs/xfs_attr.c | 14 ++++++++++++++ fs/xfs/libxfs/xfs_attr_leaf.c | 5 ----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c index a297857..7a6dd37 100644 --- a/fs/xfs/libxfs/xfs_attr.c +++ b/fs/xfs/libxfs/xfs_attr.c @@ -710,6 +710,13 @@ xfs_attr_leaf_addname( error = xfs_attr3_leaf_flipflags(args); if (error) return error; + /* + * Commit the flag value change and start the next trans in + * series. + */ + error = xfs_trans_roll_inode(&args->trans, args->dp); + if (error) + return error; /* * Dismantle the "old" attribute/value pair by removing @@ -1046,6 +1053,13 @@ xfs_attr_node_addname( error = xfs_attr3_leaf_flipflags(args); if (error) goto out; + /* + * Commit the flag value change and start the next trans in + * series + */ + error = xfs_trans_roll_inode(&args->trans, args->dp); + if (error) + goto out; /* * Dismantle the "old" attribute/value pair by removing diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c index a501538..3903e5c 100644 --- a/fs/xfs/libxfs/xfs_attr_leaf.c +++ b/fs/xfs/libxfs/xfs_attr_leaf.c @@ -2919,10 +2919,5 @@ xfs_attr3_leaf_flipflags( XFS_DA_LOGRANGE(leaf2, name_rmt, sizeof(*name_rmt))); } - /* - * Commit the flag value change and start the next trans in series. - */ - error = xfs_trans_roll_inode(&args->trans, args->dp); - return error; }