summaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorAllison Henderson <allison.henderson@oracle.com>2021-03-18 17:25:59 -0700
committerAllison Henderson <allison.henderson@oracle.com>2021-06-01 10:48:41 -0700
commita8490f699f6ec88843879b92cbb21953dab379ee (patch)
tree73f92af789f523637e1f117c7d98b72dd39a54c2 /fs/xfs
parent4126c06e25b38842a254b2de6ffc3019a7b2f0ca (diff)
downloadlinux-stable-a8490f699f6ec88843879b92cbb21953dab379ee.tar.gz
linux-stable-a8490f699f6ec88843879b92cbb21953dab379ee.tar.bz2
linux-stable-a8490f699f6ec88843879b92cbb21953dab379ee.zip
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: Allison Henderson <allison.henderson@oracle.com> Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/libxfs/xfs_attr.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
index 190b46dc0d26..8a08d5b8c433 100644
--- a/fs/xfs/libxfs/xfs_attr.c
+++ b/fs/xfs/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.