]> git.baikalelectronics.ru Git - kernel.git/commit
vfs: pull btrfs clone API to vfs layer
authorChristoph Hellwig <hch@lst.de>
Thu, 3 Dec 2015 11:59:50 +0000 (12:59 +0100)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 8 Dec 2015 04:11:33 +0000 (23:11 -0500)
commit873dc1a2c2d75b59e2afa5ed80624f39b853efff
tree196b5fa72848de2a98e09af86099d99da70f2833
parentf09aa49f349d548d350033785d3eadb7d31d7ee3
vfs: pull btrfs clone API to vfs layer

The btrfs clone ioctls are now adopted by other file systems, with NFS
and CIFS already having support for them, and XFS being under active
development.  To avoid growth of various slightly incompatible
implementations, add one to the VFS.  Note that clones are different from
file copies in several ways:

 - they are atomic vs other writers
 - they support whole file clones
 - they support 64-bit legth clones
 - they do not allow partial success (aka short writes)
 - clones are expected to be a fast metadata operation

Because of that it would be rather cumbersome to try to piggyback them on
top of the recent clone_file_range infrastructure.  The converse isn't
true and the clone_file_range system call could try clone file range as
a first attempt to copy, something that further patches will enable.

Based on earlier work from Peng Tao.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/btrfs/ctree.h
fs/btrfs/file.c
fs/btrfs/ioctl.c
fs/cifs/cifsfs.c
fs/cifs/cifsfs.h
fs/cifs/ioctl.c
fs/ioctl.c
fs/nfs/nfs4file.c
fs/read_write.c
include/linux/fs.h
include/uapi/linux/fs.h