DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 50664K9d4004062
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 50664K9d4004062
Authentication-Results: delorie.com;
	dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=LUkf3Do/
X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D13A83858C60
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1736143457;
	bh=M50npTySaP61Tzkx1bW3+KQTDLNgd6UOA8WPVTDKThk=;
	h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
	 From;
	b=LUkf3Do/Xp1Jp23A63ORqOxjz401arph3CasbbQ/RBEo/0z8gxjiMsl2Rrr/sZ1Gu
	 10jbpRG7gLKqDP+PZxKZocvt3VVthmTq1KU59BsZ10DACVXLL/Vn8VDTaToHS0GEdt
	 p5l4Hpn2CwajHEFQM4Yhf6wMQTeH9Z8PF/IYmdBY=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 825DF3858D21
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 825DF3858D21
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736143400; cv=none;
 b=EAZtqHJnuVjTvzr4F3Aor22UY+On/saYpT8IadfmBXpdFbcc7r1jtTqLJt0TQ87CjmKiP0MtLZQNKMs3LL5CzCmoMQA3brRKKYGsEIOlpAev1+klJN1vQofWUVNFO0NPTk6SWEFkrlnBX/9ZdUDse7fr1TkfONWUMklFpnPVV5o=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
 t=1736143400; c=relaxed/simple;
 bh=nYXTwROLaa1MFdAKiiOck/15eQ48k8qishUbB8IXPBE=;
 h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;
 b=RVqWJzv76Jwzvq4inolayBm/sJN9oZj7M6z8lgjvK8VdUsvRm7KT1LPlMHqPyoOt8ASIkmlRhFP2RlGUrmThiIsaEn586ORRvcbEtl8hzrlc0rUjDfDkLrWqET9ZD4f6rSZTvBWJUgVAc/14n2Df4kzmMa2P4MJ59ObAcJ/DAzI=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 825DF3858D21
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1736143398; x=1736748198;
 h=content-transfer-encoding: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=nYXTwROLaa1MFdAKiiOck/15eQ48k8qishUbB8IXPBE=;
 b=xL0i9IduQLslDDU9oWQj9ffaA7g0BBEBPEcugpkueHRxFnF/VG8i1scJJUrq2/hiuF
 0gjWCj/IVuq/UCfEuuG26MAR3hKgOxO36RET9oBlFfNqmOFm7tg09pPaef0rRp7ldBp8
 IeLi2Sp1Sn/OLci//bbrkOZCqYc0Cj1Lonnc+5BGdDnOvka6SJ63QWumodI1gvR+eeRK
 QUnQCPbLY3fp/iOxSldVkjYpkXTxP30Z465PJcR2aKvdEZCwEDEiTUTg/XRSL6vRnPJy
 ym69oSl4o62F0i0T47CNJF0hwj8JjhV72CGPOb6JvGLKOuXUJ+MpT4JlgTpVRtOs8MjA
 X0vA==
X-Gm-Message-State: AOJu0Yx6vr62d+d8erNhf/QI8MoRBY+155ynSUJPQsrnX8UB+fD2QQ0/
 tHK3qWT3xnc53MuNo0wtHaiIj5gObepJEatf8vkQrjQbC7oygy67DemoWftXLmrRy65t/MvzsFx
 EZSVvAZmnJ5S7mRH2LE15l/bnePfHB5d5
X-Gm-Gg: ASbGncu/KTS00QyAXPFKKGv/XovJYQuhTfmkxrFY14q/R42gNx4UxKyIG9yFxac+YCY
 cLIngIY0C4AtWxL7m1PLLXkyqGMtrrFsMPJACGr4=
X-Google-Smtp-Source: AGHT+IGVcb2TRn9vA1LtqP68ZvGsFJNKmt0S7+v2W5uHNzhgVFg3T8yOBeg8NIOU34UamU583+WhgMqESRtuAs/9zSg=
X-Received: by 2002:a05:6402:518f:b0:5d4:4143:c07a with SMTP id
 4fb4d7f45d1cf-5d81ddd657dmr50308467a12.1.1736143398431; Sun, 05 Jan 2025
 22:03:18 -0800 (PST)
MIME-Version: 1.0
References: <CALXu0Uee16dR-X812UpKNiE0CAVfBjQY_z1OBbyPdQgm_4zsZQ@mail.gmail.com>
 <0ddeea07-0b3d-442d-be13-cf9b2379311d@gmail.com>
 <CALWcw=EHwpQJqHjAa06JCsHwn6FzrSQgo2zihOYSM_=VSD0mvQ@mail.gmail.com>
In-Reply-To: <CALWcw=EHwpQJqHjAa06JCsHwn6FzrSQgo2zihOYSM_=VSD0mvQ@mail.gmail.com>
Date: Mon, 6 Jan 2025 07:03:00 +0100
Message-ID: <CALXu0UcLg8mszVvbyJmv9+DQ-uGkwowPb3Di1y38=wdSOG_p9w@mail.gmail.com>
Subject: Re: Cygwin copy_file_range() support with sparse
 file+FSCTL_DUPLICATE_EXTENTS_TO_FILE?
To: cygwin@cygwin.com
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Cedric Blancher via Cygwin <cygwin@cygwin.com>
Reply-To: Cedric Blancher <cedric.blancher@gmail.com>
Content-Type: text/plain; charset="utf-8"
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie.com@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 50664K9d4004062

On Sun, 5 Jan 2025 at 14:53, Takeshi Nishimura via Cygwin
<cygwin@cygwin.com> wrote:
>
> On Sun, Jan 5, 2025 at 1:06 PM Václav Haisman via Cygwin
> <cygwin@cygwin.com> wrote:
> >
> > On 05. 01. 25 7:31, Cedric Blancher via Cygwin wrote:
> > > Good morning!
> > >
> > > Could Cygwin implement copy_file_range() support, including sparse
> > > file support so holes are preserved, and
> > > FSCTL_DUPLICATE_EXTENTS_TO_FILE support?
> >
> > In theory, this could be used to implement that function. In practice,
> > the block cloning is only supported by ReFS. See
> > <https://learn.microsoft.com/en-us/windows/win32/api/winioctl/ni-winioctl-fsctl_duplicate_extents_to_file>
>
> All Windows Server (2019, 2022) installations we have. and those which
> I know about, use ReFS (except in cases where Alternate Streams are
> required).
> AFAIK SMB3 also support FSCTL_DUPLICATE_EXTENTS_TO_FILE, so this would
> be a HUGE win for Cygwin

I agree.

Cygwin has notoriously bad filename lookup performance (because each
open("foo.bar") also looks up "foo.bar.lnk", "foo.bar.exe",
"foo.bar.exe.lnk" and so on *SERIALLY*), and I hope that implementing
copy_file_range() via FSCTL_DUPLICATE_EXTENTS_TO_FILE will win back a
bit of performance for copying large files. Even more so for SMB,
where the filename lookup dominates the total file copying time. But
if IO happens on the server side, that might compensate for it.

Ced
-- 
Cedric Blancher <cedric.blancher@gmail.com>
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

