]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: Add helper function xfs_attr_node_removename_rmt
authorAllison Collins <allison.henderson@oracle.com>
Tue, 15 Sep 2020 19:59:37 +0000 (15:59 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Tue, 15 Sep 2020 19:59:37 +0000 (15:59 -0400)
Source kernel commit: 72b97ea40d23b333175323251d6afecb565a0b53

This patch adds another new helper function
xfs_attr_node_removename_rmt. This will also help modularize
xfs_attr_node_removename when we add delay ready attributes later.

Signed-off-by: Allison Collins <allison.henderson@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Chandan Rajendra <chandanrlinux@gmail.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Acked-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_attr.c

index 509a4fcba1aeefea9d37c5ab91a47c00c4acfde0..1b15efc8ac8d97c0cd5d02701708f7e557d3d25a 100644 (file)
@@ -1198,6 +1198,24 @@ int xfs_attr_node_removename_setup(
        return 0;
 }
 
+STATIC int
+xfs_attr_node_remove_rmt(
+       struct xfs_da_args      *args,
+       struct xfs_da_state     *state)
+{
+       int                     error = 0;
+
+       error = xfs_attr_rmtval_remove(args);
+       if (error)
+               return error;
+
+       /*
+        * Refill the state structure with buffers, the prior calls released our
+        * buffers.
+        */
+       return xfs_attr_refillstate(state);
+}
+
 /*
  * Remove a name from a B-tree attribute list.
  *
@@ -1226,15 +1244,7 @@ xfs_attr_node_removename(
         * overflow the maximum size of a transaction and/or hit a deadlock.
         */
        if (args->rmtblkno > 0) {
-               error = xfs_attr_rmtval_remove(args);
-               if (error)
-                       goto out;
-
-               /*
-                * Refill the state structure with buffers, the prior calls
-                * released our buffers.
-                */
-               error = xfs_attr_refillstate(state);
+               error = xfs_attr_node_remove_rmt(args, state);
                if (error)
                        goto out;
        }