Re: What are equivalents of Linux ioctl functions FICLONE and FICLONERANGE ?

From: Stefan Esser <se_at_FreeBSD.org>
Date: Fri, 07 Jun 2024 09:48:47 UTC
Am 07.06.24 um 08:59 schrieb Yuri:
> On Linux files can be copied with:
> ioctl(destFd, FICLONE, srcFd)
> 
> 
> What would be the equivalent of this on FreeBSD?

That would be copy_file_range(), but as on Linux, it does only
offer any benefit on filesystems that support copy-on-write or
potentially on network attached storage.

NFSv4 has recently gained support for server-side copies if
copy_file_range is used, for example. But UFS will fall back
to a normal copy operation.

ZFS should do this via block cloning, but that has not been
enabled by default, since it has a history of corrupted files
(and it is not clear, whether all border cases are covered in
the latest version).

Regards, STefan