]> git.baikalelectronics.ru Git - kernel.git/commit
Introduce cifs_copy_file_range()
authorSachin Prabhu <sprabhu@redhat.com>
Fri, 10 Feb 2017 10:33:51 +0000 (16:03 +0530)
committerSteve French <smfrench@gmail.com>
Fri, 7 Apr 2017 13:04:41 +0000 (08:04 -0500)
commit4e57a116fd5a15446ede5b3b71a6bf9b2c0d18b0
treea634c2ac96c3920c979869e66eb28ff032406a51
parent9678d14a1c2ad276be89b217de3bf1199ec829fd
Introduce cifs_copy_file_range()

The earlier changes to copy range for cifs unintentionally disabled the more
common form of server side copy.

The patch introduces the file_operations helper cifs_copy_file_range()
which is used by the syscall copy_file_range. The new file operations
helper allows us to perform server side copies for SMB2.0 and 2.1
servers as well as SMB 3.0+ servers which do not support the ioctl
FSCTL_DUPLICATE_EXTENTS_TO_FILE.

The new helper uses the ioctl FSCTL_SRV_COPYCHUNK_WRITE to perform
server side copies. The helper is called by vfs_copy_file_range() only
once an attempt to clone the file using the ioctl
FSCTL_DUPLICATE_EXTENTS_TO_FILE has failed.

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
CC: Stable <stable@vger.kernel.org>
Signed-off-by: Steve French <smfrench@gmail.com>
fs/cifs/cifsfs.c
fs/cifs/cifsfs.h
fs/cifs/cifsglob.h
fs/cifs/ioctl.c
fs/cifs/smb2ops.c