Thread (87 messages) 87 messages, 3 authors, 2021-03-04

Re: [PATCH v15 06/22] xfs: Separate xfs_attr_node_addname and xfs_attr_node_addname_work

From: Allison Henderson <hidden>
Date: 2021-02-25 06:19:11


On 2/24/21 8:04 AM, Brian Foster wrote:
On Thu, Feb 18, 2021 at 09:53:32AM -0700, Allison Henderson wrote:
quoted
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 <redacted>
---
Reviewed-by: Brian Foster <redacted>
Alrighty, thanks!
Allison
quoted
  fs/xfs/libxfs/xfs_attr.c | 20 ++++++++++++++++++++
  1 file changed, 20 insertions(+)
diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
index 205ad26..bee8d3fb 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_work(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);
@@ -1059,6 +1060,25 @@ xfs_attr_node_addname(
  			return error;
  	}
  
+	error = xfs_attr_node_addname_work(args);
+out:
+	if (state)
+		xfs_da_state_free(state);
+	if (error)
+		return error;
+	return retval;
+}
+
+
+STATIC
+int xfs_attr_node_addname_work(
+	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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help