]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: move remote attr retrieval into xfs_attr3_leaf_getvalue
authorDave Chinner <dchinner@redhat.com>
Fri, 15 Nov 2019 22:16:23 +0000 (17:16 -0500)
committerEric Sandeen <sandeen@redhat.com>
Fri, 15 Nov 2019 22:16:23 +0000 (17:16 -0500)
Source kernel commit: e3cc4554ce1b2cc43262c93ebe6d8cde780d29ee

Because we repeat exactly the same code to get the remote attribute
value after both calls to xfs_attr3_leaf_getvalue() if it's a remote
attr. Just do it in xfs_attr3_leaf_getvalue() so the callers don't
have to care about it.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net
libxfs/xfs_attr.c
libxfs/xfs_attr_leaf.c

index bfe102f2928aa7738ddbf95bc4f99f547aa4901f..c9c04eb1f92c2e23e327641ef6adb11f655f5731 100644 (file)
@@ -793,15 +793,7 @@ xfs_attr_leaf_get(xfs_da_args_t *args)
        }
        error = xfs_attr3_leaf_getvalue(bp, args);
        xfs_trans_brelse(args->trans, bp);
-       if (error)
-               return error;
-
-       /* check if we have to retrieve a remote attribute to get the value */
-       if (args->flags & ATTR_KERNOVAL)
-               return 0;
-       if (!args->rmtblkno)
-               return 0;
-       return xfs_attr_rmtval_get(args);
+       return error;
 }
 
 /*========================================================================
@@ -1315,12 +1307,6 @@ xfs_attr_node_get(xfs_da_args_t *args)
         */
        blk = &state->path.blk[state->path.active - 1];
        retval = xfs_attr3_leaf_getvalue(blk->bp, args);
-       if (retval)
-               goto out_release;
-       if (args->flags & ATTR_KERNOVAL)
-               goto out_release;
-       if (args->rmtblkno > 0)
-               retval = xfs_attr_rmtval_get(args);
 
        /*
         * If not in a transaction, we have to release all the buffers.
index 67cf3dc824c1d4c93f0171f70f7699fdf5642e04..ab6d053de74e7d32f90994945d879a4f29f8095a 100644 (file)
@@ -2406,7 +2406,7 @@ xfs_attr3_leaf_getvalue(
                return -ERANGE;
        }
        args->valuelen = args->rmtvaluelen;
-       return 0;
+       return xfs_attr_rmtval_get(args);
 }
 
 /*========================================================================