summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_file.c
diff options
context:
space:
mode:
authorDarrick J. Wong2018-10-30 00:47:06 +0100
committerDave Chinner2018-10-30 00:47:06 +0100
commit3f68c1f562f1e4c5e1a515b392a2e0a509a342d5 (patch)
tree0514695ce6f460cc00d532e88438c14af1431594 /fs/xfs/xfs_file.c
parentxfs: clean up xfs_reflink_remap_blocks call site (diff)
downloadkernel-qcow2-linux-3f68c1f562f1e4c5e1a515b392a2e0a509a342d5.tar.gz
kernel-qcow2-linux-3f68c1f562f1e4c5e1a515b392a2e0a509a342d5.tar.xz
kernel-qcow2-linux-3f68c1f562f1e4c5e1a515b392a2e0a509a342d5.zip
xfs: support returning partial reflink results
Back when the XFS reflink code only supported clone_file_range, we were only able to return zero or negative error codes to userspace. However, now that copy_file_range (which returns bytes copied) can use XFS' clone_file_range, we have the opportunity to return partial results. For example, if userspace sends a 1GB clone request and we run out of space halfway through, we at least can tell userspace that we completed 512M of that request like a regular write. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_file.c')
-rw-r--r--fs/xfs/xfs_file.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 38fde4e11714..7d42ab8fe6e1 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -928,14 +928,11 @@ xfs_file_remap_range(
loff_t len,
unsigned int remap_flags)
{
- int ret;
-
if (remap_flags & ~(REMAP_FILE_DEDUP | REMAP_FILE_ADVISORY))
return -EINVAL;
- ret = xfs_reflink_remap_range(file_in, pos_in, file_out, pos_out,
+ return xfs_reflink_remap_range(file_in, pos_in, file_out, pos_out,
len, remap_flags);
- return ret < 0 ? ret : len;
}
STATIC int