diff mbox series

[02/18] xfs: fix xfs_reflink_remap_prep calling conventions

Message ID 158812826681.168506.8309047158870409011.stgit@magnolia (mailing list archive)
State New, archived
Headers show
Series xfs: atomic file updates | expand

Commit Message

Darrick J. Wong April 29, 2020, 2:44 a.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

Fix the return value of xfs_reflink_remap_prep so that its calling
conventions match the rest of xfs.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/xfs_file.c    |    2 +-
 fs/xfs/xfs_reflink.c |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Allison Henderson May 1, 2020, 10:54 p.m. UTC | #1
On 4/28/20 7:44 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Fix the return value of xfs_reflink_remap_prep so that its calling
> conventions match the rest of xfs.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Looks fine to me:
Reviewed-by: Allison Collins <allison.henderson@oracle.com>

> ---
>   fs/xfs/xfs_file.c    |    2 +-
>   fs/xfs/xfs_reflink.c |    6 +++---
>   2 files changed, 4 insertions(+), 4 deletions(-)
> 
> 
> diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
> index 994fd3d59872..1759fbcbcd46 100644
> --- a/fs/xfs/xfs_file.c
> +++ b/fs/xfs/xfs_file.c
> @@ -1029,7 +1029,7 @@ xfs_file_remap_range(
>   	/* Prepare and then clone file data. */
>   	ret = xfs_reflink_remap_prep(file_in, pos_in, file_out, pos_out,
>   			&len, remap_flags);
> -	if (ret < 0 || len == 0)
> +	if (ret || len == 0)
>   		return ret;
>   
>   	trace_xfs_reflink_remap_range(src, pos_in, len, dest, pos_out);
> diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
> index d8c8b299cb1f..5e978d1f169d 100644
> --- a/fs/xfs/xfs_reflink.c
> +++ b/fs/xfs/xfs_reflink.c
> @@ -1375,7 +1375,7 @@ xfs_reflink_remap_prep(
>   	struct inode		*inode_out = file_inode(file_out);
>   	struct xfs_inode	*dest = XFS_I(inode_out);
>   	bool			same_inode = (inode_in == inode_out);
> -	ssize_t			ret;
> +	int			ret;
>   
>   	/* Lock both files against IO */
>   	ret = xfs_iolock_two_inodes_and_break_layout(inode_in, inode_out);
> @@ -1399,7 +1399,7 @@ xfs_reflink_remap_prep(
>   
>   	ret = generic_remap_file_range_prep(file_in, pos_in, file_out, pos_out,
>   			len, remap_flags);
> -	if (ret < 0 || *len == 0)
> +	if (ret || *len == 0)
>   		goto out_unlock;
>   
>   	/* Attach dquots to dest inode before changing block map */
> @@ -1434,7 +1434,7 @@ xfs_reflink_remap_prep(
>   	if (ret)
>   		goto out_unlock;
>   
> -	return 1;
> +	return 0;
>   out_unlock:
>   	xfs_reflink_remap_unlock(file_in, file_out);
>   	return ret;
>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 994fd3d59872..1759fbcbcd46 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -1029,7 +1029,7 @@  xfs_file_remap_range(
 	/* Prepare and then clone file data. */
 	ret = xfs_reflink_remap_prep(file_in, pos_in, file_out, pos_out,
 			&len, remap_flags);
-	if (ret < 0 || len == 0)
+	if (ret || len == 0)
 		return ret;
 
 	trace_xfs_reflink_remap_range(src, pos_in, len, dest, pos_out);
diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c
index d8c8b299cb1f..5e978d1f169d 100644
--- a/fs/xfs/xfs_reflink.c
+++ b/fs/xfs/xfs_reflink.c
@@ -1375,7 +1375,7 @@  xfs_reflink_remap_prep(
 	struct inode		*inode_out = file_inode(file_out);
 	struct xfs_inode	*dest = XFS_I(inode_out);
 	bool			same_inode = (inode_in == inode_out);
-	ssize_t			ret;
+	int			ret;
 
 	/* Lock both files against IO */
 	ret = xfs_iolock_two_inodes_and_break_layout(inode_in, inode_out);
@@ -1399,7 +1399,7 @@  xfs_reflink_remap_prep(
 
 	ret = generic_remap_file_range_prep(file_in, pos_in, file_out, pos_out,
 			len, remap_flags);
-	if (ret < 0 || *len == 0)
+	if (ret || *len == 0)
 		goto out_unlock;
 
 	/* Attach dquots to dest inode before changing block map */
@@ -1434,7 +1434,7 @@  xfs_reflink_remap_prep(
 	if (ret)
 		goto out_unlock;
 
-	return 1;
+	return 0;
 out_unlock:
 	xfs_reflink_remap_unlock(file_in, file_out);
 	return ret;