From patchwork Sun Feb 23 02:06:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Allison Henderson X-Patchwork-Id: 11398563 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 4F98E109A for ; Sun, 23 Feb 2020 02:06:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2E9C920707 for ; Sun, 23 Feb 2020 02:06:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="YgYViSbH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727180AbgBWCGY (ORCPT ); Sat, 22 Feb 2020 21:06:24 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:45850 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727185AbgBWCGX (ORCPT ); Sat, 22 Feb 2020 21:06:23 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01N21A7u188928 for ; Sun, 23 Feb 2020 02:06:22 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-2020-01-29; bh=pjPFKxHF8Y6S6eLu7Dcu/kbGR13Uo2v8HZYO3MkFzYo=; b=YgYViSbHX3bTua8GkuX02Ytdawz9ASUkojhO+eMxq9Xbjes2GrDUZw/DlPuGT1mfs0i7 zkLtrcK2g97jXMEE2LtHydTYdvaf/A60FAOFTzHz0nElvs2cOtU5BzG6rvLmKhb5SKYE PyR/VD1g47v9vZGFdYqmib4IP/+xyrcQls8Y3kEANm387nFVkKSz3+8xdnnhlUh0jGer U1M6MaHkUHkglGfVs8Fl27qk3PGlordgleN/7oykqifd/DYrs6X+RwQCJ7+yofG/Ek48 GYKVUBUg88XsFgispk6hwl3H73iMOrd2djdRvYCB/waSKzhWXjGIYfLo3rQrGSAlLEzz Dg== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 2yauqu21xp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sun, 23 Feb 2020 02:06:22 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01N1x6Ek147534 for ; Sun, 23 Feb 2020 02:06:22 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3030.oracle.com with ESMTP id 2ybdsd6qb4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sun, 23 Feb 2020 02:06:22 +0000 Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 01N26LB9028955 for ; Sun, 23 Feb 2020 02:06:21 GMT Received: from localhost.localdomain (/67.1.3.112) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 23 Feb 2020 02:06:21 +0000 From: Allison Collins To: linux-xfs@vger.kernel.org Subject: [PATCH v7 11/19] xfs: Factor out trans roll in xfs_attr3_leaf_clearflag Date: Sat, 22 Feb 2020 19:06:03 -0700 Message-Id: <20200223020611.1802-12-allison.henderson@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200223020611.1802-1-allison.henderson@oracle.com> References: <20200223020611.1802-1-allison.henderson@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9539 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=1 spamscore=0 malwarescore=0 mlxscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002230014 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9539 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 bulkscore=0 clxscore=1015 malwarescore=0 impostorscore=0 adultscore=0 phishscore=0 priorityscore=1501 mlxlogscore=999 spamscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002230014 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org New delayed allocation routines cannot be handling transactions so factor them out into the calling functions Signed-off-by: Allison Collins Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Rajendra --- fs/xfs/libxfs/xfs_attr.c | 16 ++++++++++++++++ fs/xfs/libxfs/xfs_attr_leaf.c | 5 +---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c index 26412da..5d73bdf 100644 --- a/fs/xfs/libxfs/xfs_attr.c +++ b/fs/xfs/libxfs/xfs_attr.c @@ -822,6 +822,14 @@ xfs_attr_leaf_addname( * Added a "remote" value, just clear the incomplete flag. */ error = xfs_attr3_leaf_clearflag(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); } return error; } @@ -1185,6 +1193,14 @@ xfs_attr_node_addname( error = xfs_attr3_leaf_clearflag(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; } retval = error = 0; diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c index 67339f0..1742f0a 100644 --- a/fs/xfs/libxfs/xfs_attr_leaf.c +++ b/fs/xfs/libxfs/xfs_attr_leaf.c @@ -2804,10 +2804,7 @@ xfs_attr3_leaf_clearflag( XFS_DA_LOGRANGE(leaf, name_rmt, sizeof(*name_rmt))); } - /* - * Commit the flag value change and start the next trans in series. - */ - return xfs_trans_roll_inode(&args->trans, args->dp); + return 0; } /*