Commit a8490f69 authored by Allison Henderson's avatar Allison Henderson

xfs: Add xfs_attr_node_remove_name

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: default avatarAllison Henderson <allison.henderson@oracle.com>
Reviewed-by: default avatarChandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
parent 4126c06e
...@@ -1214,6 +1214,25 @@ int xfs_attr_node_removename_setup( ...@@ -1214,6 +1214,25 @@ int xfs_attr_node_removename_setup(
return 0; 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. * Remove a name from a B-tree attribute list.
* *
...@@ -1226,7 +1245,6 @@ xfs_attr_node_removename( ...@@ -1226,7 +1245,6 @@ xfs_attr_node_removename(
struct xfs_da_args *args) struct xfs_da_args *args)
{ {
struct xfs_da_state *state; struct xfs_da_state *state;
struct xfs_da_state_blk *blk;
int retval, error; int retval, error;
struct xfs_inode *dp = args->dp; struct xfs_inode *dp = args->dp;
...@@ -1254,14 +1272,7 @@ xfs_attr_node_removename( ...@@ -1254,14 +1272,7 @@ xfs_attr_node_removename(
if (error) if (error)
goto out; goto out;
} }
retval = xfs_attr_node_remove_name(args, state);
/*
* 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);
/* /*
* Check to see if the tree needs to be collapsed. * Check to see if the tree needs to be collapsed.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment