Skip to content

Commit

Permalink
xfs: move remote attr retrieval into xfs_attr3_leaf_getvalue
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dave Chinner authored and Darrick J. Wong committed Aug 31, 2019
1 parent a0e959d commit e3cc455
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
16 changes: 1 addition & 15 deletions fs/xfs/libxfs/xfs_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,15 +794,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;
}

/*========================================================================
Expand Down Expand Up @@ -1316,12 +1308,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.
Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/libxfs/xfs_attr_leaf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2410,7 +2410,7 @@ xfs_attr3_leaf_getvalue(
return -ERANGE;
}
args->valuelen = args->rmtvaluelen;
return 0;
return xfs_attr_rmtval_get(args);
}

/*========================================================================
Expand Down

0 comments on commit e3cc455

Please sign in to comment.