Use copy_file_range() if available
https://bugzilla.samba.org/show_bug.cgi?id=12033
With this optimisation, on Linux we can benefit from filesystems that support block refcounting like XFS and btrfs by default. We already support this with btrfs when the btrfs VFS module is used.
Edited by Ralph Böhme