Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Aug 2025 09:32:42 -0600
From:      Alan Somers <asomers@freebsd.org>
To:        Rick Macklem <rick.macklem@gmail.com>
Cc:        FreeBSD CURRENT <freebsd-current@freebsd.org>
Subject:   Re: RFC: Does ZFS block cloning do this?
Message-ID:  <CAOtMX2jGcQY_AywWv1tVBbAk%2BrOheya%2BHRQBMRDc7ELGrA7qNA@mail.gmail.com>
In-Reply-To: <CAM5tNy7V7Btem%2ByWNK7oyn9qsk6TrQwuGo1kxqhCstLM4_uh9g@mail.gmail.com>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Wed, Aug 6, 2025 at 9:18 AM Rick Macklem <rick.macklem@gmail.com> wrote:

> Hi,
>
> NFSv4.2 has a CLONE operation. It is described as doing:
>    The CLONE operation is used to clone file content from a source file
>    specified by the SAVED_FH value into a destination file specified by
>    CURRENT_FH without actually copying the data, e.g., by using a
>    copy-on-write mechanism.
> (It takes arguments for 2 files, with byte offsets and a length.)
> The offsets must be aligned to a value returned by the NFSv4.2 server.
> 12.2.1.  Attribute 77: clone_blksize
>
>    The clone_blksize attribute indicates the granularity of a CLONE
>    operation.
>
> Does ZFS block cloning do this?
>
> I am asking now, because although it might be too late,
> if the answer is "yes", I'd like to get VOP calls into 15.0
> for it. (Hopefully with the VOP calls in place, the rest could
> go in sometime later, when I find the time to do it.)
>
> Thanks in advance for any comments, rick


Yes, it does that right now, if the feature@block_cloning pool attribute is
enabled.  It works with VOP_COPY_FILE_RANGE.  Does NFS really need a new
VOP?

[-- Attachment #2 --]
<div dir="ltr"><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Aug 6, 2025 at 9:18 AM Rick Macklem &lt;<a href="mailto:rick.macklem@gmail.com">rick.macklem@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
NFSv4.2 has a CLONE operation. It is described as doing:<br>
   The CLONE operation is used to clone file content from a source file<br>
   specified by the SAVED_FH value into a destination file specified by<br>
   CURRENT_FH without actually copying the data, e.g., by using a<br>
   copy-on-write mechanism.<br>
(It takes arguments for 2 files, with byte offsets and a length.)<br>
The offsets must be aligned to a value returned by the NFSv4.2 server.<br>
12.2.1.  Attribute 77: clone_blksize<br>
<br>
   The clone_blksize attribute indicates the granularity of a CLONE<br>
   operation.<br>
<br>
Does ZFS block cloning do this?<br>
<br>
I am asking now, because although it might be too late,<br>
if the answer is &quot;yes&quot;, I&#39;d like to get VOP calls into 15.0<br>
for it. (Hopefully with the VOP calls in place, the rest could<br>
go in sometime later, when I find the time to do it.)<br>
<br>
Thanks in advance for any comments, rick</blockquote><div><br></div><div>Yes, it does that right now, if the feature@block_cloning pool attribute is enabled.  It works with VOP_COPY_FILE_RANGE.  Does NFS really need a new VOP?</div></div></div>
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOtMX2jGcQY_AywWv1tVBbAk%2BrOheya%2BHRQBMRDc7ELGrA7qNA>