From nobody Wed Aug 06 15:32:42 2025 X-Original-To: freebsd-current@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 4bxvSV1t7bz63sHD for ; Wed, 06 Aug 2025 15:32:58 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (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-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bxvST2mFBz48lw for ; Wed, 06 Aug 2025 15:32:57 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.208.47 as permitted sender) smtp.mailfrom=asomers@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none) Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-61530559887so11359a12.1 for ; Wed, 06 Aug 2025 08:32:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754494376; x=1755099176; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VeuANaeINjJdsxnB3g/0mYyuU/GtnIhEcYo6QkDyfFo=; b=j8iP7t0700HlcS0I9Myz8YOi7BjlkoRxkNf+aUmfNsIG+3ma1T/LvI+khV+r/FzYWV o2kBuY6zTAYdkBwvIizuBu22bsW9iOAFveHqAD1mnDs37Q2IikTKM5YL96lKJzLcSuwp ahwJ3ZwNMWg4z9gYVmc2tW7xrhrZSsUxMLO8PlPIwSCElHiYkShvD3ZhePZLW1z8zEus GWSyhcCwKicuCjuB26YhiDOLnfVnYuSU1O/R8mVyT9ncAArRm0v3SvRE40V/yEiV6fT5 rNWMSfXwGKzrQsaHdMBNvskoyfJ7khYs4syegXDcMC47SCBRX62/0jP+kY0NpZfy1Bmu JXpQ== X-Gm-Message-State: AOJu0YxwZDmIeZqwpp7JVXZ/0mXHp94SJ4XwQ562Xgqn+V4J2Lx+AP5q gOSJiz9My3RkAM0c+b6bZXEjaSNCtWy8ICP4JOZQpJ3MH0FuqAAsiyF13oEgQS5h+GbOcM309JV RXNIX7TMACxPuKn1NW4nTTYG4Kzwco2niz+ln X-Gm-Gg: ASbGncvmqSoJXgsvwGgh1EQxPYEmlN7RraFGSNIFyZpvLUGhy9yKwCK/qSAkZY4KZQg KMYUMWUmBV/2f7/M0k9Gto6TDMwkGuFJpBlcaygBsy1Kd0DWaCehrFo773wwlRqkd9ckpfDSeGv F0OxjizkY7j0HboYAsxOJ8KMAZTxecN2At4mmMA6VxXDK92Y+SDdZZg11q7aePmft8qxfOufDho vtzz64= X-Google-Smtp-Source: AGHT+IG1zYRprwDyNQ4lvGA5ZWQGEY2fbCK9pPmxs9oNyFzKx3fd4ZmKmErn3sOcD8sCYc6dwtwmggIBmR0RZ7L+b/c= X-Received: by 2002:a05:6402:27cc:b0:614:ff14:9faf with SMTP id 4fb4d7f45d1cf-61796191ce5mr2934617a12.19.1754494375202; Wed, 06 Aug 2025 08:32:55 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 References: In-Reply-To: From: Alan Somers Date: Wed, 6 Aug 2025 09:32:42 -0600 X-Gm-Features: Ac12FXwXppDjYzcNBmqACBefigIpjJmvRXNYPE9NTRNHE2X-6u-prfgyPnw-pqY Message-ID: Subject: Re: RFC: Does ZFS block cloning do this? To: Rick Macklem Cc: FreeBSD CURRENT Content-Type: multipart/alternative; boundary="000000000000fecb57063bb40d66" X-Spamd-Result: default: False [0.10 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_SPAM_LONG(1.00)[0.996]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; TO_DN_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; MISSING_XM_UA(0.00)[]; FREEFALL_USER(0.00)[asomers]; FREEMAIL_ENVFROM(0.00)[gmail.com]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.47:from]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_RCPT(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.47:from] X-Rspamd-Queue-Id: 4bxvST2mFBz48lw X-Spamd-Bar: / --000000000000fecb57063bb40d66 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Aug 6, 2025 at 9:18=E2=80=AFAM Rick Macklem 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? --000000000000fecb57063bb40d66 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Aug 6, 2025 at 9:18=E2=80=AFAM Rick M= acklem <rick.macklem@gmail.com= > wrote:
= Hi,

NFSv4.2 has a CLONE operation. It is described as doing:
=C2=A0 =C2=A0The CLONE operation is used to clone file content from a sourc= e file
=C2=A0 =C2=A0specified by the SAVED_FH value into a destination file specif= ied by
=C2=A0 =C2=A0CURRENT_FH without actually copying the data, e.g., by using a=
=C2=A0 =C2=A0copy-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.=C2=A0 Attribute 77: clone_blksize

=C2=A0 =C2=A0The clone_blksize attribute indicates the granularity of a CLO= NE
=C2=A0 =C2=A0operation.

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

Ye= s, it does that right now, if the feature@block_cloning pool attribute is e= nabled.=C2=A0 It works with=C2=A0VOP_COPY_FILE_RANGE.=C2=A0 Does NFS really= need a new VOP?
--000000000000fecb57063bb40d66--