From 6e6ba26940ece6ace56ee32aba2b7e11aa9c6498 Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Fri, 15 Nov 2019 17:16:23 -0500 Subject: [PATCH] xfs: move remote attr retrieval into xfs_attr3_leaf_getvalue 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 Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen 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. diff --git a/libxfs/xfs_attr_leaf.c b/libxfs/xfs_attr_leaf.c index 67cf3dc82..ab6d053de 100644 --- a/libxfs/xfs_attr_leaf.c +++ b/libxfs/xfs_attr_leaf.c @@ -2406,7 +2406,7 @@ xfs_attr3_leaf_getvalue( return -ERANGE; } args->valuelen = args->rmtvaluelen; - return 0; + return xfs_attr_rmtval_get(args); } /*======================================================================== -- 2.50.1