xfs: remove the xfs_inode argument to xfs_attr_get_ilocked
The inode can easily be derived from the args structure. Also don't bother with else statements after early returns. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Chandan Rajendra <chandanrlinux@gmail.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:
parent
e5171d7e98
commit
c36f533f14
|
@ -77,19 +77,18 @@ xfs_inode_hasattr(
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
xfs_attr_get_ilocked(
|
xfs_attr_get_ilocked(
|
||||||
struct xfs_inode *ip,
|
|
||||||
struct xfs_da_args *args)
|
struct xfs_da_args *args)
|
||||||
{
|
{
|
||||||
ASSERT(xfs_isilocked(ip, XFS_ILOCK_SHARED | XFS_ILOCK_EXCL));
|
ASSERT(xfs_isilocked(args->dp, XFS_ILOCK_SHARED | XFS_ILOCK_EXCL));
|
||||||
|
|
||||||
if (!xfs_inode_hasattr(ip))
|
if (!xfs_inode_hasattr(args->dp))
|
||||||
return -ENOATTR;
|
return -ENOATTR;
|
||||||
else if (ip->i_d.di_aformat == XFS_DINODE_FMT_LOCAL)
|
|
||||||
|
if (args->dp->i_d.di_aformat == XFS_DINODE_FMT_LOCAL)
|
||||||
return xfs_attr_shortform_getvalue(args);
|
return xfs_attr_shortform_getvalue(args);
|
||||||
else if (xfs_bmap_one_block(ip, XFS_ATTR_FORK))
|
if (xfs_bmap_one_block(args->dp, XFS_ATTR_FORK))
|
||||||
return xfs_attr_leaf_get(args);
|
return xfs_attr_leaf_get(args);
|
||||||
else
|
return xfs_attr_node_get(args);
|
||||||
return xfs_attr_node_get(args);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -133,7 +132,7 @@ xfs_attr_get(
|
||||||
args->op_flags |= XFS_DA_OP_ALLOCVAL;
|
args->op_flags |= XFS_DA_OP_ALLOCVAL;
|
||||||
|
|
||||||
lock_mode = xfs_ilock_attr_map_shared(args->dp);
|
lock_mode = xfs_ilock_attr_map_shared(args->dp);
|
||||||
error = xfs_attr_get_ilocked(args->dp, args);
|
error = xfs_attr_get_ilocked(args);
|
||||||
xfs_iunlock(args->dp, lock_mode);
|
xfs_iunlock(args->dp, lock_mode);
|
||||||
|
|
||||||
/* on error, we have to clean up allocated value buffers */
|
/* on error, we have to clean up allocated value buffers */
|
||||||
|
|
|
@ -145,7 +145,7 @@ int xfs_attr_inactive(struct xfs_inode *dp);
|
||||||
int xfs_attr_list_int_ilocked(struct xfs_attr_list_context *);
|
int xfs_attr_list_int_ilocked(struct xfs_attr_list_context *);
|
||||||
int xfs_attr_list_int(struct xfs_attr_list_context *);
|
int xfs_attr_list_int(struct xfs_attr_list_context *);
|
||||||
int xfs_inode_hasattr(struct xfs_inode *ip);
|
int xfs_inode_hasattr(struct xfs_inode *ip);
|
||||||
int xfs_attr_get_ilocked(struct xfs_inode *ip, struct xfs_da_args *args);
|
int xfs_attr_get_ilocked(struct xfs_da_args *args);
|
||||||
int xfs_attr_get(struct xfs_da_args *args);
|
int xfs_attr_get(struct xfs_da_args *args);
|
||||||
int xfs_attr_set(struct xfs_da_args *args);
|
int xfs_attr_set(struct xfs_da_args *args);
|
||||||
int xfs_attr_set_args(struct xfs_da_args *args);
|
int xfs_attr_set_args(struct xfs_da_args *args);
|
||||||
|
|
|
@ -162,7 +162,7 @@ xchk_xattr_listent(
|
||||||
args.value = xchk_xattr_valuebuf(sx->sc);
|
args.value = xchk_xattr_valuebuf(sx->sc);
|
||||||
args.valuelen = valuelen;
|
args.valuelen = valuelen;
|
||||||
|
|
||||||
error = xfs_attr_get_ilocked(context->dp, &args);
|
error = xfs_attr_get_ilocked(&args);
|
||||||
if (!xchk_fblock_process_error(sx->sc, XFS_ATTR_FORK, args.blkno,
|
if (!xchk_fblock_process_error(sx->sc, XFS_ATTR_FORK, args.blkno,
|
||||||
&error))
|
&error))
|
||||||
goto fail_xref;
|
goto fail_xref;
|
||||||
|
|
Loading…
Reference in New Issue