From nobody Sat Jun 8 08:01:52 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 4Vx9Ww5jSDz5NdX5 for ; Sat, 08 Jun 2024 08:02:04 +0000 (UTC) (envelope-from theraven@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 4Vx9Ww5BH9z4bK7; Sat, 8 Jun 2024 08:02:04 +0000 (UTC) (envelope-from theraven@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717833724; 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=Vyu1ubttwD+UMj/EHk4kbzrLsadVmh6VmJyD00oQ9cA=; b=b3UliyZcXARr0TDJ1HOE8glK8HLu/z7ZWJ5irlMGD56w8IGY+o4iU3sy+Dqfr9Rg4E+jaa 3BsZmj6OXon2gSCWUAG7zM9YbR1d9kWsCxfP/XJfwCxrELjuwiQs3I9WGUgMHuZvBB0ctA 1Sl1xzzvrjEvQQnWbzZjZmn3bROxfCld2r+WfUR2a0Qyoflpu2D+Wo/Em7eVYBY3qlgn/R TNIgtfCaF7h1wLOdtvitO4nOXgM74sA/HXxb20Qu7P3mCBrikSxs3C0BwkmakatNiLb7Mo jNamRePXL1svPacAbXwc01xBRn/EkUr/4bdkdcvMnmhF12JeTVDXnolSMIy1TQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717833724; a=rsa-sha256; cv=none; b=ke1SQjzYJ/7Xw9LmMnnjsj56aGnsqFbv1b5HqmmmXuTthnyIn6/9r2ohWEjH+AIlQ02je7 pDY7CpJp4iZZR2iTnocGanKY3EuADWUyfymDdRpHrtUc+T81obVU2RCDH3QKE3ifkM5sbq ZbzBxebtNalYk8Jw34yXr5t/8TDSfH8nU3BBf8nbEyfjMqzhsa5yn4uOgOOmpfwINO3oLl pbMWKGutv2Dv3Ku8Y9nlRMzQmEK4A8eReGPh9z33SAFZyzAqy89V0qlhyoqM8d0j6JgXtL PdDqGaK0Ze26Wo9UaR9FFaR8KKnAi+//QJDggq5UauUacyOTavj68gOT6m25NQ== 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=1717833724; 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=Vyu1ubttwD+UMj/EHk4kbzrLsadVmh6VmJyD00oQ9cA=; b=BCQ/Ad4FJprUqR9iDmaHVN/qUrTk3BpGbW9WztupmiVI9fHWMVb2O4LS9GJQ1LuObSTqMn up0KPJWUiV9oJW0fjYjJ5jPlQ0GAM3z5fwo5/14sadPZHKSMuh4b3x5x+ocCwMoBlEmweI o4qw3etDR/REokwkPvMQ4sLCg3tJgGJ2SxG90vxvTJyPaW5/bgfEoyod/v8bqRTU1UZSrF fKDq2sDc/7+scCqU1+AJzNAt39H8WwyayOHi8Gh93nOxF4NckQapBUfzXo+Lw2O5MxwM9C Mm1Wb3MTcXEVejkZss0K3rQOhsVXJDaruZzyf4SWHT6SnDBbFEw0Y8B2nsfxWg== Received: from smtp.theravensnest.org (smtp.theravensnest.org [45.77.103.195]) (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 did not present a certificate) (Authenticated sender: theraven) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Vx9Ww4mBhz134n; Sat, 8 Jun 2024 08:02:04 +0000 (UTC) (envelope-from theraven@freebsd.org) Received: from smtpclient.apple (host81-131-179-19.range81-131.btcentralplus.com [81.131.179.19]) by smtp.theravensnest.org (Postfix) with ESMTPSA id D647DB500; Sat, 8 Jun 2024 09:02:03 +0100 (BST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: David Chisnall 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 (1.0) Subject: Re: What are equivalents of Linux ioctl functions FICLONE and FICLONERANGE ? Date: Sat, 8 Jun 2024 09:01:52 +0100 Message-Id: References: <86o78c2dxu.fsf@ltc.des.dev> Cc: Stefan Esser , Yuri Victorovich , freebsd-hackers@freebsd.org In-Reply-To: <86o78c2dxu.fsf@ltc.des.dev> To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= X-Mailer: iPad Mail (21F90) On 8 Jun 2024, at 06:36, Dag-Erling Sm=C3=B8rgrav wrote: >=20 > =EF=BB=BFStefan Esser writes: >> Yuri Victorovich writes: >>> 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. >=20 > Even without filesystem support, it still avoids copying the contents of > the file out to user space, so it's faster than a regular copy. Note that there is no in-kernel fallback path for if the file descriptor typ= e does not support it. This means that you cannot use it, for example, for c= opies from an anonymous shared memory object to a regular file. David=