xfs: support returning partial reflink results
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 29 Oct 2018 23:47:06 +0000 (10:47 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 29 Oct 2018 23:47:06 +0000 (10:47 +1100)
commit3f68c1f562f1e4c5e1a515b392a2e0a509a342d5
tree0514695ce6f460cc00d532e88438c14af1431594
parent9f04aaffddb3e487f3eda1945f1a9531d6cc7628
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>
fs/xfs/xfs_file.c
fs/xfs/xfs_reflink.c
fs/xfs/xfs_reflink.h