Commit 451d34ee authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: fix xfs_reflink_remap_prep calling conventions

Fix the return value of xfs_reflink_remap_prep so that its return value
conventions match the rest of xfs.
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
parent 168eae80
...@@ -1035,7 +1035,7 @@ xfs_file_remap_range( ...@@ -1035,7 +1035,7 @@ xfs_file_remap_range(
/* Prepare and then clone file data. */ /* Prepare and then clone file data. */
ret = xfs_reflink_remap_prep(file_in, pos_in, file_out, pos_out, ret = xfs_reflink_remap_prep(file_in, pos_in, file_out, pos_out,
&len, remap_flags); &len, remap_flags);
if (ret < 0 || len == 0) if (ret || len == 0)
return ret; return ret;
trace_xfs_reflink_remap_range(src, pos_in, len, dest, pos_out); trace_xfs_reflink_remap_range(src, pos_in, len, dest, pos_out);
......
...@@ -1367,7 +1367,7 @@ xfs_reflink_remap_prep( ...@@ -1367,7 +1367,7 @@ xfs_reflink_remap_prep(
struct inode *inode_out = file_inode(file_out); struct inode *inode_out = file_inode(file_out);
struct xfs_inode *dest = XFS_I(inode_out); struct xfs_inode *dest = XFS_I(inode_out);
bool same_inode = (inode_in == inode_out); bool same_inode = (inode_in == inode_out);
ssize_t ret; int ret;
/* Lock both files against IO */ /* Lock both files against IO */
ret = xfs_iolock_two_inodes_and_break_layout(inode_in, inode_out); ret = xfs_iolock_two_inodes_and_break_layout(inode_in, inode_out);
...@@ -1391,7 +1391,7 @@ xfs_reflink_remap_prep( ...@@ -1391,7 +1391,7 @@ xfs_reflink_remap_prep(
ret = generic_remap_file_range_prep(file_in, pos_in, file_out, pos_out, ret = generic_remap_file_range_prep(file_in, pos_in, file_out, pos_out,
len, remap_flags); len, remap_flags);
if (ret < 0 || *len == 0) if (ret || *len == 0)
goto out_unlock; goto out_unlock;
/* Attach dquots to dest inode before changing block map */ /* Attach dquots to dest inode before changing block map */
...@@ -1426,7 +1426,7 @@ xfs_reflink_remap_prep( ...@@ -1426,7 +1426,7 @@ xfs_reflink_remap_prep(
if (ret) if (ret)
goto out_unlock; goto out_unlock;
return 1; return 0;
out_unlock: out_unlock:
xfs_reflink_remap_unlock(file_in, file_out); xfs_reflink_remap_unlock(file_in, file_out);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment