RFC: should a copy_file_range(2) syscall work across multiple file systems?

Rick Macklem rmacklem at uoguelph.ca
Wed Jun 19 23:56:06 UTC 2019

I have been working on a copy_file_range(2) syscall for FreeBSD, which is meant
to be compatible with the Linux one. (Current patch is at

One thing the current patch does do is allow the kernel copy to be done across
multiple file systems (ie. source and destination files on different file systems).
The Linux syscall *may* not allow this. The man page specifies EXDEV as an
error return, but discussion of the Linux syscall suggests that it may be (or has
already been) modified to work across multiple file systems.

I thought that this would be a useful feature, but does require the default
code to be above the VOP_xxx() layer and *might* not be Linux compatible.
(The incompatibility would be working for cases where the Linux syscall might not.)

So, should it work across multiple file systems?

More information about the freebsd-fs mailing list