From: Allison Henderson <allison.henderson@oracle.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH v20 12/14] xfs: Clean up xfs_attr_node_addname_clear_incomplete
Date: Sun, 6 Jun 2021 22:27:45 -0700 [thread overview]
Message-ID: <20210607052747.31422-3-allison.henderson@oracle.com> (raw)
In-Reply-To: <20210607052747.31422-1-allison.henderson@oracle.com>
We can use the helper function xfs_attr_node_remove_name to reduce
duplicate code in this function
Signed-off-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
---
fs/xfs/libxfs/xfs_attr.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
index df20537..2387a41 100644
--- a/fs/xfs/libxfs/xfs_attr.c
+++ b/fs/xfs/libxfs/xfs_attr.c
@@ -63,6 +63,8 @@ STATIC int xfs_attr_fillstate(xfs_da_state_t *state);
STATIC int xfs_attr_refillstate(xfs_da_state_t *state);
STATIC int xfs_attr_set_iter(struct xfs_delattr_context *dac,
struct xfs_buf **leaf_bp);
+STATIC int xfs_attr_node_remove_name(struct xfs_da_args *args,
+ struct xfs_da_state *state);
int
xfs_inode_hasattr(
@@ -1207,7 +1209,6 @@ xfs_attr_node_addname_clear_incomplete(
{
struct xfs_da_args *args = dac->da_args;
struct xfs_da_state *state = NULL;
- struct xfs_da_state_blk *blk;
int retval = 0;
int error = 0;
@@ -1222,13 +1223,7 @@ xfs_attr_node_addname_clear_incomplete(
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);
- error = xfs_attr3_leaf_remove(blk->bp, args);
- xfs_da3_fixhashpath(state, &state->path);
+ error = xfs_attr_node_remove_name(args, state);
/*
* Check to see if the tree needs to be collapsed.
--
2.7.4
next prev parent reply other threads:[~2021-06-07 5:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-07 5:27 [PATCH v20 10/14] xfs: Add delay ready attr set routines Allison Henderson
2021-06-07 5:27 ` [PATCH v20 11/14] xfs: Remove xfs_attr_rmtval_set Allison Henderson
2021-06-07 5:27 ` Allison Henderson [this message]
2021-06-07 5:27 ` [PATCH v20 13/14] xfs: Fix default ASSERT in xfs_attr_set_iter Allison Henderson
2021-06-07 8:33 ` Chandan Babu R
2021-06-07 16:19 ` Darrick J. Wong
2021-06-07 5:27 ` [PATCH v20 14/14] xfs: Make attr name schemes consistent Allison Henderson
2021-06-07 8:35 ` Chandan Babu R
2021-06-07 16:20 ` Darrick J. Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210607052747.31422-3-allison.henderson@oracle.com \
--to=allison.henderson@oracle.com \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.