]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: remove the xfs_inode argument to xfs_attr_get_ilocked
authorChristoph Hellwig <hch@lst.de>
Fri, 1 May 2020 21:01:32 +0000 (17:01 -0400)
committerEric Sandeen <sandeen@redhat.com>
Fri, 1 May 2020 21:01:32 +0000 (17:01 -0400)
Source kernel commit: c36f533f14075fee35f8beeb1729d0975fb2e137

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>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_attr.c
libxfs/xfs_attr.h

index 6fa88ed883652629b9f4d1970f09708a42c33c2c..d18efb2245118f731c9110629e4a581e133a50aa 100644 (file)
@@ -77,19 +77,18 @@ xfs_inode_hasattr(
  */
 int
 xfs_attr_get_ilocked(
-       struct xfs_inode        *ip,
        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;
-       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);
-       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);
-       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;
 
        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);
 
        /* on error, we have to clean up allocated value buffers */
index be77d13a290243c486e97e75929ffc6cf2ed165a..b8c4ed27f626707ef3a9a78f5467f21194ab720f 100644 (file)
@@ -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(struct xfs_attr_list_context *);
 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_set(struct xfs_da_args *args);
 int xfs_attr_set_args(struct xfs_da_args *args);