btrfs: add .copy_file_range file operation
authorZach Brown <zab@redhat.com>
Tue, 10 Nov 2015 21:53:32 +0000 (16:53 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 1 Dec 2015 19:00:54 +0000 (14:00 -0500)
commit3db11b2eecc02dc0eee943e71822c6d929281aa7
tree4c3e92e765c730a4b6a4acc4c444e043fd66c573
parentcb4c4e8091e86e08cb2d48e7ae6bf454245c36cb
btrfs: add .copy_file_range file operation

This rearranges the existing COPY_RANGE ioctl implementation so that the
.copy_file_range file operation can call the core loop that copies file
data extent items.

The extent copying loop is lifted up into its own function.  It retains
the core btrfs error checks that should be shared.

Signed-off-by: Zach Brown <zab@redhat.com>
[Anna Schumaker: Make flags an unsigned int,
                 Check for COPY_FR_REFLINK]
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Reviewed-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