aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_attr.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2019-08-29 12:04:09 -0400
committerDarrick J. Wong <darrick.wong@oracle.com>2019-08-31 01:43:57 -0400
commite3cc4554ce1b2cc43262c93ebe6d8cde780d29ee (patch)
tree05b320e331d3f5cdae95cd73a0b58619b3cbc9ac /fs/xfs/libxfs/xfs_attr.c
parenta0e959d3c9d52a83e01a97ef352a1465550f9329 (diff)
xfs: move remote attr retrieval into xfs_attr3_leaf_getvalue
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>
Diffstat (limited to 'fs/xfs/libxfs/xfs_attr.c')
-rw-r--r--fs/xfs/libxfs/xfs_attr.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
index 32879ab11290..4773eef9d3de 100644
--- a/fs/xfs/libxfs/xfs_attr.c
+++ b/fs/xfs/libxfs/xfs_attr.c
@@ -794,15 +794,7 @@ xfs_attr_leaf_get(xfs_da_args_t *args)
794 } 794 }
795 error = xfs_attr3_leaf_getvalue(bp, args); 795 error = xfs_attr3_leaf_getvalue(bp, args);
796 xfs_trans_brelse(args->trans, bp); 796 xfs_trans_brelse(args->trans, bp);
797 if (error) 797 return error;
798 return error;
799
800 /* check if we have to retrieve a remote attribute to get the value */
801 if (args->flags & ATTR_KERNOVAL)
802 return 0;
803 if (!args->rmtblkno)
804 return 0;
805 return xfs_attr_rmtval_get(args);
806} 798}
807 799
808/*======================================================================== 800/*========================================================================
@@ -1316,12 +1308,6 @@ xfs_attr_node_get(xfs_da_args_t *args)
1316 */ 1308 */
1317 blk = &state->path.blk[state->path.active - 1]; 1309 blk = &state->path.blk[state->path.active - 1];
1318 retval = xfs_attr3_leaf_getvalue(blk->bp, args); 1310 retval = xfs_attr3_leaf_getvalue(blk->bp, args);
1319 if (retval)
1320 goto out_release;
1321 if (args->flags & ATTR_KERNOVAL)
1322 goto out_release;
1323 if (args->rmtblkno > 0)
1324 retval = xfs_attr_rmtval_get(args);
1325 1311
1326 /* 1312 /*
1327 * If not in a transaction, we have to release all the buffers. 1313 * If not in a transaction, we have to release all the buffers.