Skip to content

Commit

Permalink
xfs: Clean up xfs_attr_node_addname_clear_incomplete
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Allison Henderson committed Jun 1, 2021
1 parent 0e6acf2 commit 4fd084d
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions fs/xfs/libxfs/xfs_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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;

Expand All @@ -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.
Expand Down

0 comments on commit 4fd084d

Please sign in to comment.