Implement copy_file_range syscall in FUSE (#3475)

See the man page of copy_file_range:
https://man7.org/linux/man-pages/man2/copy_file_range.2.html
This commit is contained in:
Patrick Schmidt
2022-08-22 02:11:43 +02:00
committed by GitHub
parent fef9c6a520
commit 3a75d7f7aa
4 changed files with 129 additions and 22 deletions

View File

@@ -4,22 +4,6 @@ import "github.com/hanwen/go-fuse/v2/fuse"
// https://github.com/libfuse/libfuse/blob/48ae2e72b39b6a31cb2194f6f11786b7ca06aac6/include/fuse.h#L778
/**
* Copy a range of data from one file to anotherNiels de Vos, 4 years ago: • libfuse: add copy_file_range() support
*
* Performs an optimized copy between two file descriptors without the
* additional cost of transferring data through the FUSE kernel module
* to user space (glibc) and then back into the FUSE filesystem again.
*
* In case this method is not implemented, applications are expected to
* fall back to a regular file copy. (Some glibc versions did this
* emulation automatically, but the emulation has been removed from all
* glibc release branches.)
*/
func (wfs *WFS) CopyFileRange(cancel <-chan struct{}, in *fuse.CopyFileRangeIn) (written uint32, code fuse.Status) {
return 0, fuse.ENOSYS
}
/**
* Allocates space for an open file
*