On 5/13/21 5:41 PM, Darrick J. Wong wrote:
On Thu, May 13, 2021 at 04:49:13PM -0700, Darrick J. Wong wrote:
On Wed, May 12, 2021 at 09:14:02AM -0700, Allison Henderson wrote:
This patch separate xfs_attr_node_addname into two functions. This will
help to make it easier to hoist parts of xfs_attr_node_addname that need
state management
Signed-off-by: Allison Henderson <allison.henderson@xxxxxxxxxx>
Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx>
Reviewed-by: Chandan Babu R <chandanrlinux@xxxxxxxxx>
Makes sense...
Reviewed-by: Darrick J. Wong <djwong@xxxxxxxxxx>
Great. Thank you!
--D
---
fs/xfs/libxfs/xfs_attr.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
index 1a618a2..5cf2e71 100644
--- a/fs/xfs/libxfs/xfs_attr.c
+++ b/fs/xfs/libxfs/xfs_attr.c
@@ -54,6 +54,7 @@ STATIC int xfs_attr_leaf_hasname(struct xfs_da_args *args, struct xfs_buf **bp);
STATIC int xfs_attr_node_get(xfs_da_args_t *args);
STATIC int xfs_attr_node_addname(xfs_da_args_t *args);
STATIC int xfs_attr_node_removename(xfs_da_args_t *args);
+STATIC int xfs_attr_node_addname_clear_incomplete(struct xfs_da_args *args);
STATIC int xfs_attr_node_hasname(xfs_da_args_t *args,
struct xfs_da_state **state);
STATIC int xfs_attr_fillstate(xfs_da_state_t *state);
@@ -1073,6 +1074,28 @@ xfs_attr_node_addname(
return error;
}
+ error = xfs_attr_node_addname_clear_incomplete(args);
+ if (error)
+ goto out;
+ retval = 0;
+out:
+ if (state)
+ xfs_da_state_free(state);
+ if (error)
+ return error;
+ return retval;
+}
+
+
+STATIC
+int xfs_attr_node_addname_clear_incomplete(
...well, so long as this gets changed to:
STATIC int
xfs_attr_node_addname_clear_incomplete
Sure, will fix.
--D
+ struct xfs_da_args *args)
+{
+ struct xfs_da_state *state = NULL;
+ struct xfs_da_state_blk *blk;
+ int retval = 0;
+ int error = 0;
+
/*
* Re-find the "old" attribute entry after any split ops. The INCOMPLETE
* flag means that we will find the "old" attr, not the "new" one.
--
2.7.4