diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2018-10-30 00:42:10 +0100 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2018-10-30 00:42:10 +0100 |
commit | eca3654e3cc7d93e9734d0fa96cfb15c7f356244 (patch) | |
tree | 00e5f8bd5de34435872d8cb222daaec79ede3961 /include | |
parent | vfs: plumb remap flags through the vfs dedupe functions (diff) | |
download | linux-eca3654e3cc7d93e9734d0fa96cfb15c7f356244.tar.xz linux-eca3654e3cc7d93e9734d0fa96cfb15c7f356244.zip |
vfs: enable remap callers that can handle short operations
Plumb in a remap flag that enables the filesystem remap handler to
shorten remapping requests for callers that can handle it. Now
copy_file_range can report partial success (in case we run up against
alignment problems, resource limits, etc.).
We also enable CAN_SHORTEN for fideduperange to maintain existing
userspace-visible behavior where xfs/btrfs shorten the dedupe range to
avoid stale post-eof data exposure.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/fs.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 544ab5083b48..34c22d695011 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1727,8 +1727,10 @@ struct block_device_operations; * See Documentation/filesystems/vfs.txt for more details about this call. * * REMAP_FILE_DEDUP: only remap if contents identical (i.e. deduplicate) + * REMAP_FILE_CAN_SHORTEN: caller can handle a shortened request */ #define REMAP_FILE_DEDUP (1 << 0) +#define REMAP_FILE_CAN_SHORTEN (1 << 1) /* * These flags signal that the caller is ok with altering various aspects of @@ -1736,9 +1738,8 @@ struct block_device_operations; * implementation; the vfs remap helper functions can take advantage of them. * Flags in this category exist to preserve the quirky behavior of the hoisted * btrfs clone/dedupe ioctls. - * There are no flags yet, but subsequent commits will add some. */ -#define REMAP_FILE_ADVISORY (0) +#define REMAP_FILE_ADVISORY (REMAP_FILE_CAN_SHORTEN) struct iov_iter; |