]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add kernel support for a Linux compatible copy_file_range(2) syscall.
authorrmacklem <rmacklem@FreeBSD.org>
Thu, 25 Jul 2019 05:46:16 +0000 (05:46 +0000)
committerrmacklem <rmacklem@FreeBSD.org>
Thu, 25 Jul 2019 05:46:16 +0000 (05:46 +0000)
commit1a4bc2f9d354de36b37f9944b1aa8c70ec3f695c
treec3a2167140c061b34660089301d37a4b0586b854
parentfe9b36388a0c872fb567ba3a6d9fce433e00bbb6
Add kernel support for a Linux compatible copy_file_range(2) syscall.

This patch adds support to the kernel for a Linux compatible
copy_file_range(2) syscall and the related VOP_COPY_FILE_RANGE(9).
This syscall/VOP can be used by the NFSv4.2 client to implement the
Copy operation against an NFSv4.2 server to do file copies locally on
the server.
The vn_generic_copy_file_range() function in this patch can be used
by the NFSv4.2 server to implement the Copy operation.
Fuse may also me able to use the VOP_COPY_FILE_RANGE() method.

vn_generic_copy_file_range() attempts to maintain holes in the output
file in the range to be copied, but may fail to do so if the input and
output files are on different file systems with different _PC_MIN_HOLE_SIZE
values.

Separate commits will be done for the generated syscall files and userland
changes. A commit for a compat32 syscall will be done later.

Reviewed by: kib, asomers (plus comments by brooks, jilles)
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D20584
sys/kern/syscalls.master
sys/kern/vfs_default.c
sys/kern/vfs_syscalls.c
sys/kern/vfs_vnops.c
sys/kern/vnode_if.src
sys/sys/syscallsubr.h
sys/sys/vnode.h