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=-16.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 12C19C433EF for ; Wed, 15 Sep 2021 23:07:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EFD80610A2 for ; Wed, 15 Sep 2021 23:07:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232193AbhIOXIt (ORCPT ); Wed, 15 Sep 2021 19:08:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:60412 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231579AbhIOXIt (ORCPT ); Wed, 15 Sep 2021 19:08:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8FDB3600D4; Wed, 15 Sep 2021 23:07:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631747249; bh=wtQu2qBXDJ8IF82g4kaFVKyBstFtYK3kuE+Pzsd5q4w=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=cDCtlciOwstQKUE2N/rIUIbgvUuUuat0H38/k9d4Qp4/pMM7KHViAnPgaioBxqoOp WR0A4ZwSLfpb0xKanucdUPDM/iCWiF73jhNhgqjUaoTeKXMQJ4o770zmbL+CSksBfd 0KEbNpRnfN01XBG1bki9AytuWfV4AcVmtwvHOWBcT6cBGxYZX3usYAqWjxF5AVOeQY BmrZzO2g1aa3pn3t+WrYf2sYxyLWgfnC1DvS5LhQBU3IeWUgRU45I+01wNWfjTwKsG NkOwNNTeCDUliQn+DBQIVzVgvud0MHjGjFfv4q5kCv4ylp0gbf8OJ/ryxr8k78iTBV IaFDpAmdT/yfw== Subject: [PATCH 10/61] xfs: Add xfs_attr_node_remove_name From: "Darrick J. Wong" To: sandeen@sandeen.net, djwong@kernel.org Cc: Allison Henderson , Chandan Babu R , Brian Foster , linux-xfs@vger.kernel.org Date: Wed, 15 Sep 2021 16:07:29 -0700 Message-ID: <163174724933.350433.8577622925304925081.stgit@magnolia> In-Reply-To: <163174719429.350433.8562606396437219220.stgit@magnolia> References: <163174719429.350433.8562606396437219220.stgit@magnolia> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Allison Henderson Source kernel commit: a8490f699f6ec88843879b92cbb21953dab379ee This patch pulls a new helper function xfs_attr_node_remove_name out of xfs_attr_node_remove_step. This helps to modularize xfs_attr_node_remove_step which will help make the delayed attribute code easier to follow Signed-off-by: Allison Henderson Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong Reviewed-by: Brian Foster Signed-off-by: Darrick J. Wong --- libxfs/xfs_attr.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index 1c60bddd..5da3ec39 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -1214,6 +1214,25 @@ int xfs_attr_node_removename_setup( return 0; } +STATIC int +xfs_attr_node_remove_name( + struct xfs_da_args *args, + struct xfs_da_state *state) +{ + struct xfs_da_state_blk *blk; + int retval; + + /* + * Remove the name and update the hashvals in the tree. + */ + blk = &state->path.blk[state->path.active-1]; + ASSERT(blk->magic == XFS_ATTR_LEAF_MAGIC); + retval = xfs_attr3_leaf_remove(blk->bp, args); + xfs_da3_fixhashpath(state, &state->path); + + return retval; +} + /* * Remove a name from a B-tree attribute list. * @@ -1226,7 +1245,6 @@ xfs_attr_node_removename( struct xfs_da_args *args) { struct xfs_da_state *state; - struct xfs_da_state_blk *blk; int retval, error; struct xfs_inode *dp = args->dp; @@ -1254,14 +1272,7 @@ xfs_attr_node_removename( if (error) goto out; } - - /* - * Remove the name and update the hashvals in the tree. - */ - blk = &state->path.blk[ state->path.active-1 ]; - ASSERT(blk->magic == XFS_ATTR_LEAF_MAGIC); - retval = xfs_attr3_leaf_remove(blk->bp, args); - xfs_da3_fixhashpath(state, &state->path); + retval = xfs_attr_node_remove_name(args, state); /* * Check to see if the tree needs to be collapsed.