From nobody Fri Jun 7 09:48:47 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vwbxc115Nz5NBR5 for ; Fri, 07 Jun 2024 09:48:52 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vwbxb6xNjz49D8; Fri, 7 Jun 2024 09:48:51 +0000 (UTC) (envelope-from se@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717753732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ePcgGNR4j8Kds6Dkwu7QJ8BfZRLetw5yfxAhJe/42u0=; b=Se0uG9LOyAibD9Iis/5cXLBDWN5oOeGMRXZOaTu+B/ZBC9aznrfCVbCd7p+TXOGt1UO7sR GnmJ2ptIP84JdY5VIpyqVamZwyy0GHfrX6O2oczk/5TUEa4hAuYuv+kVUK89ZlwPdWLtK8 OanGho5+1aMexNOWhCLyzwX/Kam13s0OV4CtDf6yxVP89701R+DMrM3TvXgCmUJu2deTyJ btFafycN2N6g40xl6/DapI+iusQAjL6eHRVGfRXBpQn2OQdXtCqqNYZWL1pPnFaiDmYD3P KrkiINZ5EEH7kHqof+uCCOFIlsx/bc9QsDhT6Z4frESAl24NTqJ1JDTFIrvcgg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717753732; a=rsa-sha256; cv=none; b=uX0iElNBzXl52EGv1fnMfA4D/06M/VM2uxsQ23a2m8OAbjyh1OF0zwW9L64l/0W01FxPF5 AUVwxUwpZ6MjqyclTr7wz4eT1vqQGIiB5EWaiDVfkOl75rw+NhsqOI/4RJjq1BzzItOr87 /jAZBfENiJeiFcT5aFPpeUw6/6aqzgl6Ipjm9VlWzaC+oWH6QeA3L/08rtuep3eEDF2hQm 7EjGiotDktBfxnzcYMIZIGFqViZH+aE2OT86PPcDQhlcWzLO8cOy6Lj9DLEyzWU9t9Z8A3 g0dzuG8oUKuSIgIiIsPnSxZRfh9NzgF9z/sK/frbebuqaRLKXurwOXgFrJgpZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717753732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ePcgGNR4j8Kds6Dkwu7QJ8BfZRLetw5yfxAhJe/42u0=; b=Iqrm5prv+U2JjWlGT49Eb66H6EyXnACMq+m+8L6C+mJNVIYJvXbHjks6FlmT2C2NMAzLAk RswtYg7WgaU9pmnE5IczxlKIH+3r/FYdSUSxpAqhrbqKqiHR9I0Qx30cDSCMPv5XQKlx9d Ugh14QQ+uW5przDZ7lHHClM0upTO1UDIxQeS/CtJoDCP6LZMwm4nV1s/DZWoZjolMjSzAM 7LMlOa0mHCYLRLbHpRvxQydBazkBT8ehl68fuwg1AZJbNQ64C8C35m+W+Ka8s1hAgBnKs0 IeJtApJcbhWoX5Fr6991rsSABUhwNB5Aq41U0LiHtkMu1NI0a+9ULk64SfScMQ== Received: from [192.168.119.168] (p5dc83c4c.dip0.t-ipconnect.de [93.200.60.76]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Vwbxb2kzRzLJt; Fri, 7 Jun 2024 09:48:51 +0000 (UTC) (envelope-from se@FreeBSD.org) Message-ID: <1406f7e7-63a9-4f9a-a2e6-2de71bac65cb@FreeBSD.org> Date: Fri, 7 Jun 2024 11:48:47 +0200 List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Stefan Esser Subject: Re: What are equivalents of Linux ioctl functions FICLONE and FICLONERANGE ? To: Yuri Victorovich References: <2bcfb025-b639-4696-82e6-bfeb1a291294@FreeBSD.org> Content-Language: de-DE, en-US Cc: freebsd-hackers@freebsd.org In-Reply-To: <2bcfb025-b639-4696-82e6-bfeb1a291294@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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