diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2018-10-30 10:47:06 +1100 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2018-10-30 10:47:06 +1100 |
commit | 3f68c1f562f1e4c5e1a515b392a2e0a509a342d5 (patch) | |
tree | 0514695ce6f460cc00d532e88438c14af1431594 /fs/xfs/xfs_file.c | |
parent | 9f04aaffddb3e487f3eda1945f1a9531d6cc7628 (diff) | |
download | linux-3f68c1f562f1e4c5e1a515b392a2e0a509a342d5.tar.bz2 |
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.c | 5 |
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 |