Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Jun 2024 11:48:47 +0200
From:      Stefan Esser <se@FreeBSD.org>
To:        Yuri Victorovich <yuri@FreeBSD.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: What are equivalents of Linux ioctl functions FICLONE and FICLONERANGE ?
Message-ID:  <1406f7e7-63a9-4f9a-a2e6-2de71bac65cb@FreeBSD.org>
In-Reply-To: <2bcfb025-b639-4696-82e6-bfeb1a291294@FreeBSD.org>
References:  <2bcfb025-b639-4696-82e6-bfeb1a291294@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1406f7e7-63a9-4f9a-a2e6-2de71bac65cb>