From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY 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 BB9B0C388F7 for ; Tue, 10 Nov 2020 23:14:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4B301207BB for ; Tue, 10 Nov 2020 23:14:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="W5qhEqZ4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731746AbgKJXOe (ORCPT ); Tue, 10 Nov 2020 18:14:34 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:44590 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726737AbgKJXOe (ORCPT ); Tue, 10 Nov 2020 18:14:34 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0AANE0AH146856 for ; Tue, 10 Nov 2020 23:14:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=SFhKywqV+jaIfevkcD+YzTJhBwdQuZyuSjPrrKpsbeU=; b=W5qhEqZ4QHadWOuzlH95XO1bw8k5kmMtek++yFWYAxMou6mEWDSjY/fA4rMD5c9dlTh9 9iR0NPoNXO3X+yrqpVS7rDFHyHwYAneKYPgVfn9GGX8gUMNjtq2rb6y6Z8HKYHTJTzsv G3oqE4HT42/9wnUIJ9YKzilrOXcFap5DpYa4QLipzTRBQGCAt2NO47/wVI9GZobr1rG0 4Sm6UyI3t1WzGnxNwDDO7k5BX/aCgg2+zPF/GvzLaW3FarZwQKrzOvSmmgxpujBIH2/C J+yx/fykAdoSkYom0gtVecDfQbYeWTmiPVBPeLklyoRjnCwQdu0V/gJ40LxtY9FZN3xf KQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 34nkhkxe4q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 10 Nov 2020 23:14:33 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0AAN4sST121753 for ; Tue, 10 Nov 2020 23:12:33 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 34p5g10am8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 10 Nov 2020 23:12:33 +0000 Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 0AANCVk8023784 for ; Tue, 10 Nov 2020 23:12:32 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 10 Nov 2020 15:12:31 -0800 Date: Tue, 10 Nov 2020 15:12:30 -0800 From: "Darrick J. Wong" To: Allison Henderson Cc: linux-xfs@vger.kernel.org Subject: Re: [PATCH v13 01/10] xfs: Add helper xfs_attr_node_remove_step Message-ID: <20201110231230.GJ9695@magnolia> References: <20201023063435.7510-1-allison.henderson@oracle.com> <20201023063435.7510-2-allison.henderson@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201023063435.7510-2-allison.henderson@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9801 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 spamscore=0 malwarescore=0 adultscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 suspectscore=2 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011100155 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9801 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 priorityscore=1501 mlxscore=0 suspectscore=2 mlxlogscore=999 lowpriorityscore=0 spamscore=0 malwarescore=0 adultscore=0 clxscore=1015 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011100156 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org On Thu, Oct 22, 2020 at 11:34:26PM -0700, Allison Henderson wrote: > From: Allison Collins > > This patch adds a new helper function xfs_attr_node_remove_step. This > will help simplify and modularize the calling function > xfs_attr_node_remove. > > Signed-off-by: Allison Henderson Looks fine to me, modulo Brian and Chandan's suggestions; Reviewed-by: Darrick J. Wong --D > --- > fs/xfs/libxfs/xfs_attr.c | 46 ++++++++++++++++++++++++++++++++++------------ > 1 file changed, 34 insertions(+), 12 deletions(-) > > diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c > index fd8e641..f4d39bf 100644 > --- a/fs/xfs/libxfs/xfs_attr.c > +++ b/fs/xfs/libxfs/xfs_attr.c > @@ -1228,19 +1228,14 @@ xfs_attr_node_remove_rmt( > * the root node (a special case of an intermediate node). > */ > STATIC int > -xfs_attr_node_removename( > - struct xfs_da_args *args) > +xfs_attr_node_remove_step( > + struct xfs_da_args *args, > + struct xfs_da_state *state) > { > - struct xfs_da_state *state; > struct xfs_da_state_blk *blk; > int retval, error; > struct xfs_inode *dp = args->dp; > > - trace_xfs_attr_node_removename(args); > - > - error = xfs_attr_node_removename_setup(args, &state); > - if (error) > - goto out; > > /* > * If there is an out-of-line value, de-allocate the blocks. > @@ -1250,7 +1245,7 @@ xfs_attr_node_removename( > if (args->rmtblkno > 0) { > error = xfs_attr_node_remove_rmt(args, state); > if (error) > - goto out; > + return error; > } > > /* > @@ -1267,18 +1262,45 @@ xfs_attr_node_removename( > if (retval && (state->path.active > 1)) { > error = xfs_da3_join(state); > if (error) > - goto out; > + return error; > error = xfs_defer_finish(&args->trans); > if (error) > - goto out; > + return error; > /* > * Commit the Btree join operation and start a new trans. > */ > error = xfs_trans_roll_inode(&args->trans, dp); > if (error) > - goto out; > + return error; > } > > + return error; > +} > + > +/* > + * Remove a name from a B-tree attribute list. > + * > + * This routine will find the blocks of the name to remove, remove them and > + * shirnk the tree if needed. > + */ > +STATIC int > +xfs_attr_node_removename( > + struct xfs_da_args *args) > +{ > + struct xfs_da_state *state; > + int error; > + struct xfs_inode *dp = args->dp; > + > + trace_xfs_attr_node_removename(args); > + > + error = xfs_attr_node_removename_setup(args, &state); > + if (error) > + goto out; > + > + error = xfs_attr_node_remove_step(args, state); > + if (error) > + goto out; > + > /* > * If the result is small enough, push it all into the inode. > */ > -- > 2.7.4 >