]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: Pull up xfs_attr_rmtval_invalidate
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: d4034c4662af5d40de0655c641ddc6eccde0e8fc

This patch pulls xfs_attr_rmtval_invalidate out of
xfs_attr_rmtval_remove and into the calling functions.  Eventually
__xfs_attr_rmtval_remove will replace xfs_attr_rmtval_remove when we
introduce delayed attributes.  These functions are exepcted to return
-EAGAIN when they need a new transaction.  Because the invalidate does
not need a new transaction, we need to separate it from the rest of the
function that does.  This will enable __xfs_attr_rmtval_remove to
smoothly replace xfs_attr_rmtval_remove later.

Signed-off-by: Allison Collins <allison.henderson@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.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
libxfs/xfs_attr_remote.c

index 60cec71c5d1e8765fe091f8bf56da388507dc105..81bea61484b9eb31308b9010f4caad1990dd2503 100644 (file)
@@ -670,6 +670,10 @@ xfs_attr_leaf_addname(
                args->rmtblkcnt = args->rmtblkcnt2;
                args->rmtvaluelen = args->rmtvaluelen2;
                if (args->rmtblkno) {
+                       error = xfs_attr_rmtval_invalidate(args);
+                       if (error)
+                               return error;
+
                        error = xfs_attr_rmtval_remove(args);
                        if (error)
                                return error;
@@ -1023,6 +1027,10 @@ restart:
                args->rmtblkcnt = args->rmtblkcnt2;
                args->rmtvaluelen = args->rmtvaluelen2;
                if (args->rmtblkno) {
+                       error = xfs_attr_rmtval_invalidate(args);
+                       if (error)
+                               return error;
+
                        error = xfs_attr_rmtval_remove(args);
                        if (error)
                                return error;
@@ -1147,6 +1155,10 @@ xfs_attr_node_removename(
                if (error)
                        goto out;
 
+               error = xfs_attr_rmtval_invalidate(args);
+               if (error)
+                       return error;
+
                error = xfs_attr_rmtval_remove(args);
                if (error)
                        goto out;
index 8c7d51b4cc4ed731222f166d96f770f908cd341e..f09ea295e097d30cc89038dcee89cec99e229ddd 100644 (file)
@@ -682,9 +682,6 @@ xfs_attr_rmtval_remove(
 
        trace_xfs_attr_rmtval_remove(args);
 
-       error = xfs_attr_rmtval_invalidate(args);
-       if (error)
-               return error;
        /*
         * Keep de-allocating extents until the remote-value region is gone.
         */