From mboxrd@z Thu Jan 1 00:00:00 1970
From: =?UTF-8?Q?P=c3=a1draig_Brady?=
Subject: Re: [PATCH v3 8/9] vfs: copy_file_range() can do a pagecache copy
with splice
Date: Fri, 25 Sep 2015 22:58:42 +0100
Message-ID: <5605C392.80008@draigBrady.com>
References: <1443214096-12769-1-git-send-email-Anna.Schumaker@Netapp.com>
<1443214096-12769-9-git-send-email-Anna.Schumaker@Netapp.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: QUOTED-PRINTABLE
Return-path:
In-Reply-To: <1443214096-12769-9-git-send-email-Anna.Schumaker-ZwjVKphTwtPQT0dZR+AlfA@public.gmane.org>
Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
To: Anna Schumaker , linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-btrfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, zab-ugsP4Wv/S6ZeoWH0uzbU5w@public.gmane.org, viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org, clm-b10kYP2dOMg@public.gmane.org, darrick.wong-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org, mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, andros-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org, hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org
List-Id: linux-api@vger.kernel.org
On 25/09/15 21:48, Anna Schumaker wrote:
> The NFS server will need some kind offallback for filesystems that do=
n't
> have any kind of copy acceleration, and it should be generally useful=
to
> have an in-kernel copy to avoid lots of switches between kernel and u=
ser
> space.
>=20
> I make this configurable by adding two new flags. Users who only wan=
t a
> reflink can pass COPY_FR_REFLINK, and users who want a full data copy=
can
> pass COPY_FR_COPY. The default (flags=3D0) means to first attempt a
> reflink, but use the pagecache if that fails.
>=20
> I moved the rw_verify_area() calls into the fallback code since some
> filesystems can handle reflinking a large range.
>=20
> Signed-off-by: Anna Schumaker
Reviewed-by: P=E1draig Brady
LGTM. For my reference, for cp(1), mv(1), install(1), this will avoid
user space copies in the normal case, client side copies in the network
file system case, and provide a more generalized interface to reflink()=
=2E
coreutils pseudo code is:
unsigned int cfr_flags =3D COPY_FR_COPY;
if (mode =3D=3D mv)
cfr_flags =3D 0; /* reflink falling back to normal */
else if (mode =3D=3D cp) {
if --reflink || --reflink=3D=3Dalways
cfr_flags =3D COPY_FR_REFLINK;
else if --reflink=3D=3Dauto
cfr_flags =3D 0; /* reflink falling back to normal */
}
if vfs_copy_file_range(..., cfr_flags) =3D=3D ENOTSUP
normal_user_space_copy();
thanks,
P=E1draig.
From mboxrd@z Thu Jan 1 00:00:00 1970
Return-Path:
Received: from mail2.vodafone.ie ([213.233.128.44]:52357 "EHLO
mail2.vodafone.ie" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
with ESMTP id S1750906AbbIYV6r (ORCPT
);
Fri, 25 Sep 2015 17:58:47 -0400
Subject: Re: [PATCH v3 8/9] vfs: copy_file_range() can do a pagecache copy
with splice
To: Anna Schumaker , linux-nfs@vger.kernel.org,
linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-api@vger.kernel.org, zab@zabbo.net, viro@zeniv.linux.org.uk,
clm@fb.com, darrick.wong@oracle.com, mtk.manpages@gmail.com,
andros@netapp.com, hch@infradead.org
References: <1443214096-12769-1-git-send-email-Anna.Schumaker@Netapp.com>
<1443214096-12769-9-git-send-email-Anna.Schumaker@Netapp.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?=
Message-ID: <5605C392.80008@draigBrady.com>
Date: Fri, 25 Sep 2015 22:58:42 +0100
MIME-Version: 1.0
In-Reply-To: <1443214096-12769-9-git-send-email-Anna.Schumaker@Netapp.com>
Content-Type: text/plain; charset=windows-1252
Sender: linux-btrfs-owner@vger.kernel.org
List-ID:
On 25/09/15 21:48, Anna Schumaker wrote:
> The NFS server will need some kind offallback for filesystems that don't
> have any kind of copy acceleration, and it should be generally useful to
> have an in-kernel copy to avoid lots of switches between kernel and user
> space.
>
> I make this configurable by adding two new flags. Users who only want a
> reflink can pass COPY_FR_REFLINK, and users who want a full data copy can
> pass COPY_FR_COPY. The default (flags=0) means to first attempt a
> reflink, but use the pagecache if that fails.
>
> I moved the rw_verify_area() calls into the fallback code since some
> filesystems can handle reflinking a large range.
>
> Signed-off-by: Anna Schumaker
Reviewed-by: Pádraig Brady
LGTM. For my reference, for cp(1), mv(1), install(1), this will avoid
user space copies in the normal case, client side copies in the network
file system case, and provide a more generalized interface to reflink().
coreutils pseudo code is:
unsigned int cfr_flags = COPY_FR_COPY;
if (mode == mv)
cfr_flags = 0; /* reflink falling back to normal */
else if (mode == cp) {
if --reflink || --reflink==always
cfr_flags = COPY_FR_REFLINK;
else if --reflink==auto
cfr_flags = 0; /* reflink falling back to normal */
}
if vfs_copy_file_range(..., cfr_flags) == ENOTSUP
normal_user_space_copy();
thanks,
Pádraig.