[PATCH v1 2/8] x86: add sys_copy_file_range to syscall tables

2015-09-04 Thread Anna Schumaker
From: Zach Brown Add sys_copy_file_range to the x86 syscall tables. Signed-off-by: Zach Brown Signed-off-by: Anna Schumaker --- arch/x86/entry/syscalls/syscall_32.tbl | 1 + arch/x86/entry/syscalls/syscall_64.tbl | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/x86/entry/syscalls

[PATCH v1 7/8] vfs: Copy should use file_out rather than file_in

2015-09-04 Thread Anna Schumaker
The way to think about this is that the destination filesystem reads the data from the source file and processes it accordingly. This is especially important to avoid an infinate loop when doing a "server to server" copy on NFS. Signed-off-by: Anna Schumaker --- fs/read_write.c | 6

[PATCH v1 1/9] vfs: add copy_file_range syscall and vfs helper

2015-09-04 Thread Anna Schumaker
: Zach Brown [Anna Schumaker: Change -EINVAL to -EBADF during file verification] Signed-off-by: Anna Schumaker --- fs/read_write.c | 129 ++ include/linux/fs.h| 3 + include/uapi/asm-generic/unistd.h | 4 +- kernel/sys_ni.c

[PATCH v1 3/8] btrfs: add .copy_file_range file operation

2015-09-04 Thread Anna Schumaker
shared. Signed-off-by: Zach Brown Signed-off-by: Anna Schumaker --- fs/btrfs/ctree.h | 3 ++ fs/btrfs/file.c | 1 + fs/btrfs/ioctl.c | 91 3 files changed, 56 insertions(+), 39 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs

[PATCH v1 9/8] copy_file_range.2: New page documenting copy_file_range()

2015-09-04 Thread Anna Schumaker
copy_file_range() is a new system call for copying ranges of data completely in the kernel. This gives filesystems an opportunity to implement some kind of "copy acceleration", such as reflinks or server-side-copy (in the case of NFS). Signed-off-by: Anna Schumaker --- man2/copy_fi

[PATCH v1 0/8] VFS: In-kernel copy system call

2015-09-04 Thread Anna Schumaker
0.33s | 0.49s | 0.76s | 0.99s cpu | 77% | 62% | 60% |59% total | 0.422 | 0.777 | 1.267 | 1.655 Questions? Comments? Thoughts? Anna Anna Schumaker (5): btrfs: Add mountpoint checking during btrfs_copy_file_range vfs: Remove copy_f

[PATCH v1 8/8] vfs: Fall back on splice if no copy function defined

2015-09-04 Thread Anna Schumaker
e the fallback. Signed-off-by: Anna Schumaker --- fs/read_write.c | 16 include/linux/copy.h | 6 ++ include/uapi/linux/Kbuild | 1 + include/uapi/linux/copy.h | 6 ++ 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 include/linux/c

[PATCH v1 5/8] vfs: Remove copy_file_range mountpoint checks

2015-09-04 Thread Anna Schumaker
I still want to do an in-kernel copy even if the files are on different mountpoints, and NFS has a "server to server" copy that expects two files on different mountpoints. Let's have individual filesystems implement this check instead. Signed-off-by: Anna Schumaker --- fs/r

[PATCH v1 4/8] btrfs: Add mountpoint checking during btrfs_copy_file_range

2015-09-04 Thread Anna Schumaker
We need to verify that both the source and the destination files are part of the same filesystem, otherwise we can't create a reflink. Signed-off-by: Anna Schumaker --- fs/btrfs/ioctl.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 62

[PATCH v1 6/8] vfs: Copy should check len after file open mode

2015-09-04 Thread Anna Schumaker
I don't think it makes sense to report that a copy succeeded if the files aren't open properly. Signed-off-by: Anna Schumaker --- fs/read_write.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/read_write.c b/fs/read_write.c index 922ca58..59637ed 10064

Re: [PATCH v1 8/8] vfs: Fall back on splice if no copy function defined

2015-09-08 Thread Anna Schumaker
On 09/04/2015 05:08 PM, Darrick J. Wong wrote: > On Fri, Sep 04, 2015 at 04:17:02PM -0400, Anna Schumaker wrote: >> The NFS server will need a fallback for filesystems that don't have any >> kind of copy acceleration yet, and it should be generally useful to have >> an in

Re: [PATCH v1 9/8] copy_file_range.2: New page documenting copy_file_range()

2015-09-08 Thread Anna Schumaker
On 09/04/2015 05:38 PM, Darrick J. Wong wrote: > On Fri, Sep 04, 2015 at 04:17:03PM -0400, Anna Schumaker wrote: >> copy_file_range() is a new system call for copying ranges of data >> completely in the kernel. This gives filesystems an opportunity to >> implement some kind

Re: [PATCH v1 9/8] copy_file_range.2: New page documenting copy_file_range()

2015-09-08 Thread Anna Schumaker
On 09/04/2015 06:31 PM, Andreas Dilger wrote: > On Sep 4, 2015, at 3:38 PM, Darrick J. Wong wrote: >> >> On Fri, Sep 04, 2015 at 04:17:03PM -0400, Anna Schumaker wrote: >>> copy_file_range() is a new system call for copying ranges of data >>> completely in the k

Re: [PATCH v1 0/8] VFS: In-kernel copy system call

2015-09-08 Thread Anna Schumaker
On 09/04/2015 06:25 PM, Andreas Dilger wrote: > On Sep 4, 2015, at 2:16 PM, Anna Schumaker wrote: >> >> Copy system calls came up during Plumbers a couple of weeks ago, >> because several filesystems (including NFS and XFS) are currently >> working on copy accele

Re: [PATCH v1 0/8] VFS: In-kernel copy system call

2015-09-08 Thread Anna Schumaker
On 09/05/2015 04:33 AM, Al Viro wrote: > On Fri, Sep 04, 2015 at 04:25:27PM -0600, Andreas Dilger wrote: > >> This is a bit of a surprising result, since in my testing in the >> past, copy_{to/from}_user() is a major consumer of CPU time (50% >> of a CPU core at 1GB/s). What backing filesystem di

Re: [PATCH v1 0/8] VFS: In-kernel copy system call

2015-09-08 Thread Anna Schumaker
On 09/08/2015 11:21 AM, Pádraig Brady wrote: > On 04/09/15 21:16, Anna Schumaker wrote: >> Copy system calls came up during Plumbers a couple of weeks ago, because >> several filesystems (including NFS and XFS) are currently working on copy >> acceleration implementations.

Re: [PATCH v1 0/8] VFS: In-kernel copy system call

2015-09-08 Thread Anna Schumaker
On 09/08/2015 04:45 PM, Darrick J. Wong wrote: > On Tue, Sep 08, 2015 at 11:08:03AM -0400, Anna Schumaker wrote: >> On 09/05/2015 04:33 AM, Al Viro wrote: >>> On Fri, Sep 04, 2015 at 04:25:27PM -0600, Andreas Dilger wrote: >>> >>>> This is a bit of a surpri

Re: [PATCH v1 4/8] btrfs: Add mountpoint checking during btrfs_copy_file_range

2015-09-09 Thread Anna Schumaker
On 09/09/2015 05:18 AM, David Sterba wrote: > On Fri, Sep 04, 2015 at 04:16:58PM -0400, Anna Schumaker wrote: >> We need to verify that both the source and the destination files are >> part of the same filesystem, otherwise we can't create a reflink. >> >&g

Re: [PATCH v1 9/8] copy_file_range.2: New page documenting copy_file_range()

2015-09-09 Thread Anna Schumaker
On 09/09/2015 01:17 PM, Darrick J. Wong wrote: > On Wed, Sep 09, 2015 at 07:38:14AM -0400, Austin S Hemmelgarn wrote: >> On 2015-09-08 16:39, Darrick J. Wong wrote: >>> On Tue, Sep 08, 2015 at 11:04:03AM -0400, Anna Schumaker wrote: >>>> On 09/04/2015 05:38 PM, Darri

Re: [PATCH v1 0/8] VFS: In-kernel copy system call

2015-09-09 Thread Anna Schumaker
8/09/15 20:10, Andy Lutomirski wrote: >>>>> On Tue, Sep 8, 2015 at 11:23 AM, Anna Schumaker >>>>> wrote: >>>>>> On 09/08/2015 11:21 AM, Pádraig Brady wrote: >>>>>>> I see copy_file_range() is a reflink() on BTRFS? >>>>>&

Re: [PATCH v1 9/8] copy_file_range.2: New page documenting copy_file_range()

2015-09-09 Thread Anna Schumaker
On 09/09/2015 02:12 PM, Darrick J. Wong wrote: > On Wed, Sep 09, 2015 at 01:31:24PM -0400, Anna Schumaker wrote: >> On 09/09/2015 01:17 PM, Darrick J. Wong wrote: >>> On Wed, Sep 09, 2015 at 07:38:14AM -0400, Austin S Hemmelgarn wrote: >>>> On 2015-09-08 16:39, Darri

Re: [PATCH v1 0/8] VFS: In-kernel copy system call

2015-09-09 Thread Anna Schumaker
On 09/09/2015 04:38 PM, Chris Mason wrote: > On Wed, Sep 09, 2015 at 04:26:58PM -0400, Trond Myklebust wrote: >> On Wed, Sep 9, 2015 at 4:09 PM, Chris Mason wrote: >>> On Tue, Sep 08, 2015 at 04:08:43PM -0700, Andy Lutomirski wrote: On Tue, Sep 8, 2015 at 3:39 PM, Darrick J. Wong wrote

Re: [PATCH v1 0/8] VFS: In-kernel copy system call

2015-09-10 Thread Anna Schumaker
On 09/09/2015 05:16 PM, Darrick J. Wong wrote: > On Wed, Sep 09, 2015 at 02:52:08PM -0400, Anna Schumaker wrote: >> On 09/08/2015 06:39 PM, Darrick J. Wong wrote: >>> On Tue, Sep 08, 2015 at 02:45:39PM -0700, Andy Lutomirski wrote: >>>> On Tue, Sep 8, 2015 at 2:29 PM

[PATCH v2 6/9] vfs: Copy should use file_out rather than file_in

2015-09-11 Thread Anna Schumaker
The way to think about this is that the destination filesystem reads the data from the source file and processes it accordingly. This is especially important to avoid an infinate loop when doing a "server to server" copy on NFS. Signed-off-by: Anna Schumaker --- fs/read_write.c | 6

[PATCH v2 10/9] copy_file_range.2: New page documenting copy_file_range()

2015-09-11 Thread Anna Schumaker
copy_file_range() is a new system call for copying ranges of data completely in the kernel. This gives filesystems an opportunity to implement some kind of "copy acceleration", such as reflinks or server-side-copy (in the case of NFS). Signed-off-by: Anna Schumaker --- man2/copy_fi

[PATCH v2 2/9] x86: add sys_copy_file_range to syscall tables

2015-09-11 Thread Anna Schumaker
From: Zach Brown Add sys_copy_file_range to the x86 syscall tables. Signed-off-by: Zach Brown [Anna Schumaker: Update syscall number in syscall_32.tbl] Signed-off-by: Anna Schumaker --- arch/x86/entry/syscalls/syscall_32.tbl | 1 + arch/x86/entry/syscalls/syscall_64.tbl | 1 + 2 files

[PATCH v2 9/9] btrfs: btrfs_copy_file_range() only supports reflinks

2015-09-11 Thread Anna Schumaker
Reject copies that don't have the COPY_FR_REFLINK flag set. Signed-off-by: Anna Schumaker --- fs/btrfs/ioctl.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 4311554..2e14b91 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -44,6

[PATCH v2 5/9] vfs: Copy shouldn't forbid ranges inside the same file

2015-09-11 Thread Anna Schumaker
This is perfectly valid for BTRFS and XFS, so let's leave this up to filesystems to check. Signed-off-by: Anna Schumaker --- fs/read_write.c | 4 1 file changed, 4 deletions(-) diff --git a/fs/read_write.c b/fs/read_write.c index 38cc251..d32549b 100644 --- a/fs/read_write.c +++

[PATCH v2 4/9] vfs: Copy should check len after file open mode

2015-09-11 Thread Anna Schumaker
I don't think it makes sense to report that a copy succeeded if the files aren't open properly. Signed-off-by: Anna Schumaker --- fs/read_write.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/read_write.c b/fs/read_write.c index 82c4933..38cc251 10064

[PATCH v2 8/9] vfs: copy_file_range() can do a pagecache copy with splice

2015-09-11 Thread Anna Schumaker
large range. Signed-off-by: Anna Schumaker --- v2: - Rename COPY_REFLINK -> COPY_FR_REFLINK - Introduce COPY_FR_COPY flag - Flags == 0 is really COPY_FR_COPY|COPY_FR_REFLINK - Drop check for invalid flags - Move call to do_splice_direct() into a new function - Move rw_verify_area() checks into

[PATCH v2 1/9] vfs: add copy_file_range syscall and vfs helper

2015-09-11 Thread Anna Schumaker
: Zach Brown [Anna Schumaker: Change -EINVAL to -EBADF during file verification] Signed-off-by: Anna Schumaker --- fs/read_write.c | 129 ++ include/linux/fs.h| 3 + include/uapi/asm-generic/unistd.h | 4 +- kernel/sys_ni.c

[PATCH v2 3/9] btrfs: add .copy_file_range file operation

2015-09-11 Thread Anna Schumaker
shared. Signed-off-by: Zach Brown Signed-off-by: Anna Schumaker Reviewed-by: Josef Bacik Reviewed-by: David Sterba --- fs/btrfs/ctree.h | 3 ++ fs/btrfs/file.c | 1 + fs/btrfs/ioctl.c | 91 3 files changed, 56 insertions(+), 39

[PATCH v2 0/9] VFS: In-kernel copy system call

2015-09-11 Thread Anna Schumaker
.00s | 0.00s | 0.00s | 0.00s | 0.00s system | 0.65s | 0.46s | 0.70s | 0.93s | 1.18s | 1.41s | 2.37s cpu |35% |14% |15% |14% |14% |14% |14% total | 1.870 | 3.084 | 4.613 | 6.206 | 7.884 | 9.372 | 15.904 Questions? Comments? Thoughts?

[PATCH v2 7/9] vfs: Remove copy_file_range mountpoint checks

2015-09-11 Thread Anna Schumaker
I still want to do an in-kernel copy even if the files are on different mountpoints, and NFS has a "server to server" copy that expects two files on different mountpoints. Let's have individual filesystems implement this check instead. Signed-off-by: Anna Schumaker --- fs/r

Re: [PATCH v2 8/9] vfs: copy_file_range() can do a pagecache copy with splice

2015-09-15 Thread Anna Schumaker
On 09/14/2015 11:32 PM, Darrick J. Wong wrote: > On Fri, Sep 11, 2015 at 04:30:21PM -0400, 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 >>

Re: [PATCH v2 1/9] vfs: add copy_file_range syscall and vfs helper

2015-09-22 Thread Anna Schumaker
On 09/22/2015 07:44 AM, David Sterba wrote: > On Fri, Sep 11, 2015 at 04:30:14PM -0400, Anna Schumaker wrote: >> From: Zach Brown >> +/* >> + * copy_file_range() differs from regular file read and write in that it >> + * specifically allows return partial success

Re: [PATCH v2 10/9] copy_file_range.2: New page documenting copy_file_range()

2015-09-22 Thread Anna Schumaker
On 09/14/2015 02:32 PM, Darrick J. Wong wrote: > On Sun, Sep 13, 2015 at 09:50:18AM +0200, Michael Kerrisk (man-pages) wrote: >> Hi Anna, >> >> On 09/11/2015 10:30 PM, Anna Schumaker wrote: >>> copy_file_range() is a new system call for copying ranges of data >&

Re: [PATCH v2 10/9] copy_file_range.2: New page documenting copy_file_range()

2015-09-22 Thread Anna Schumaker
Hi Michael, On 09/13/2015 03:50 AM, Michael Kerrisk (man-pages) wrote: > Hi Anna, > > On 09/11/2015 10:30 PM, Anna Schumaker wrote: >> copy_file_range() is a new system call for copying ranges of data >> completely in the kernel. This gives filesystems an opportunity to &

[PATCH v3 1/9] vfs: add copy_file_range syscall and vfs helper

2015-09-25 Thread Anna Schumaker
: Zach Brown [Anna Schumaker: Change -EINVAL to -EBADF during file verification] [Anna Schumaker: Change flags parameter from int to unsigned int] Signed-off-by: Anna Schumaker --- v3: - Change flags parameter to take an unsigned int instead of an int --- fs/read_write.c | 129

[PATCH v3 9/9] btrfs: btrfs_copy_file_range() only supports reflinks

2015-09-25 Thread Anna Schumaker
Reject copies that don't have the COPY_FR_REFLINK flag set. Signed-off-by: Anna Schumaker Reviewed-by: David Sterba --- fs/btrfs/ioctl.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 4311554..2e14b91 100644 --- a/fs/btrfs/ioctl.c +++

[PATCH v3 3/9] btrfs: add .copy_file_range file operation

2015-09-25 Thread Anna Schumaker
shared. Signed-off-by: Zach Brown Signed-off-by: Anna Schumaker Reviewed-by: Josef Bacik Reviewed-by: David Sterba --- fs/btrfs/ctree.h | 3 ++ fs/btrfs/file.c | 1 + fs/btrfs/ioctl.c | 91 3 files changed, 56 insertions(+), 39

[PATCH v3 6/9] vfs: Copy should use file_out rather than file_in

2015-09-25 Thread Anna Schumaker
The way to think about this is that the destination filesystem reads the data from the source file and processes it accordingly. This is especially important to avoid an infinate loop when doing a "server to server" copy on NFS. Signed-off-by: Anna Schumaker --- fs/read_write.c | 6

[PATCH v3 4/9] vfs: Copy should check len after file open mode

2015-09-25 Thread Anna Schumaker
I don't think it makes sense to report that a copy succeeded if the files aren't open properly. Signed-off-by: Anna Schumaker Reviewed-by: David Sterba --- fs/read_write.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/read_write.c b/fs/read_write.c ind

[PATCH v3 5/9] vfs: Copy shouldn't forbid ranges inside the same file

2015-09-25 Thread Anna Schumaker
This is perfectly valid for BTRFS and XFS, so let's leave this up to filesystems to check. Signed-off-by: Anna Schumaker Reviewed-by: David Sterba --- fs/read_write.c | 4 1 file changed, 4 deletions(-) diff --git a/fs/read_write.c b/fs/read_write.c index f3d6c48..8e7cb33 100644 ---

[PATCH v3 2/9] x86: add sys_copy_file_range to syscall tables

2015-09-25 Thread Anna Schumaker
From: Zach Brown Add sys_copy_file_range to the x86 syscall tables. Signed-off-by: Zach Brown [Anna Schumaker: Update syscall number in syscall_32.tbl] Signed-off-by: Anna Schumaker --- arch/x86/entry/syscalls/syscall_32.tbl | 1 + arch/x86/entry/syscalls/syscall_64.tbl | 1 + 2 files

[PATCH v3 8/9] vfs: copy_file_range() can do a pagecache copy with splice

2015-09-25 Thread Anna Schumaker
large range. Signed-off-by: Anna Schumaker --- v3: - Check that both filesystems have the same filesystem type - Add COPY_FR_DEDUPE flag for Darrick - Check that at most one flag is set at a time --- fs/read_write.c | 61 +++ include/linux/c

[PATCH v3 0/9] VFS: In-kernel copy system call

2015-09-25 Thread Anna Schumaker
| 0.00s | 0.00s | 0.00s | 0.00s | 0.00s system | 0.80s | 0.56s | 0.84s | 1.10s | 1.39s | 1.67s | 2.81s cpu |41% |18% |19% |17% |17% |17% |17% total | 1.922 | 2.990 | 4.448 | 6.292 | 7.855 | 9.480 | 15.944 Questions? Comments?

[PATCH v3 7/9] vfs: Remove copy_file_range mountpoint checks

2015-09-25 Thread Anna Schumaker
I still want to do an in-kernel copy even if the files are on different mountpoints, and NFS has a "server to server" copy that expects two files on different mountpoints. Let's have individual filesystems implement this check instead. Signed-off-by: Anna Schumaker Reviewed-b

[PATCH v3 10/9] copy_file_range.2: New page documenting copy_file_range()

2015-09-25 Thread Anna Schumaker
copy_file_range() is a new system call for copying ranges of data completely in the kernel. This gives filesystems an opportunity to implement some kind of "copy acceleration", such as reflinks or server-side-copy (in the case of NFS). Signed-off-by: Anna Schumaker --- v3: - Add

Re: [PATCH v3 8/9] vfs: copy_file_range() can do a pagecache copy with splice

2015-09-28 Thread Anna Schumaker
On 09/25/2015 08:14 PM, Andy Lutomirski wrote: > On Fri, Sep 25, 2015 at 1:48 PM, 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

Re: [PATCH v3 8/9] vfs: copy_file_range() can do a pagecache copy with splice

2015-09-28 Thread Anna Schumaker
On 09/28/2015 02:31 PM, Darrick J. Wong wrote: > On Fri, Sep 25, 2015 at 04:48:14PM -0400, Anna Schumaker wrote: >> The NFS server will need some kind offallback for filesystems that don't > > "some kind of fallback" I'll rephrase that :) > >> have

Re: [PATCH v3 10/9] copy_file_range.2: New page documenting copy_file_range()

2015-09-28 Thread Anna Schumaker
On 09/28/2015 02:40 PM, Darrick J. Wong wrote: > On Fri, Sep 25, 2015 at 04:48:16PM -0400, Anna Schumaker wrote: >> copy_file_range() is a new system call for copying ranges of data >> completely in the kernel. This gives filesystems an opportunity to >> implement some kind

[PATCH v4 9/9] btrfs: btrfs_copy_file_range() only supports reflinks

2015-09-29 Thread Anna Schumaker
Reject copies that don't have the COPY_FR_REFLINK flag set. Signed-off-by: Anna Schumaker Reviewed-by: David Sterba --- fs/btrfs/ioctl.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 4311554..2e14b91 100644 --- a/fs/btrfs/ioctl.c +++

[PATCH v4 2/9] x86: add sys_copy_file_range to syscall tables

2015-09-29 Thread Anna Schumaker
From: Zach Brown Add sys_copy_file_range to the x86 syscall tables. Signed-off-by: Zach Brown [Anna Schumaker: Update syscall number in syscall_32.tbl] Signed-off-by: Anna Schumaker --- arch/x86/entry/syscalls/syscall_32.tbl | 1 + arch/x86/entry/syscalls/syscall_64.tbl | 1 + 2 files

[PATCH v4 6/9] vfs: Copy should use file_out rather than file_in

2015-09-29 Thread Anna Schumaker
The way to think about this is that the destination filesystem reads the data from the source file and processes it accordingly. This is especially important to avoid an infinate loop when doing a "server to server" copy on NFS. Signed-off-by: Anna Schumaker --- fs/read_write.c | 6

[PATCH v4 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-09-29 Thread Anna Schumaker
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: Darrick J. Wong --- v4: - Reword commit message - Rename COPY_FR_DEDUPE -> COPY_FR_DEDUP --- fs/read_write.c |

[PATCH v4 7/9] vfs: Remove copy_file_range mountpoint checks

2015-09-29 Thread Anna Schumaker
I still want to do an in-kernel copy even if the files are on different mountpoints, and NFS has a "server to server" copy that expects two files on different mountpoints. Let's have individual filesystems implement this check instead. Signed-off-by: Anna Schumaker Reviewed-b

[PATCH v4 5/9] vfs: Copy shouldn't forbid ranges inside the same file

2015-09-29 Thread Anna Schumaker
This is perfectly valid for BTRFS and XFS, so let's leave this up to filesystems to check. Signed-off-by: Anna Schumaker Reviewed-by: David Sterba Reviewed-by: Darrick J. Wong --- fs/read_write.c | 4 1 file changed, 4 deletions(-) diff --git a/fs/read_write.c b/fs/read_write.c

[PATCH v4 10/9] copy_file_range.2: New page documenting copy_file_range()

2015-09-29 Thread Anna Schumaker
copy_file_range() is a new system call for copying ranges of data completely in the kernel. This gives filesystems an opportunity to implement some kind of "copy acceleration", such as reflinks or server-side-copy (in the case of NFS). Signed-off-by: Anna Schumaker Reviewed-by: Darri

[PATCH v4 4/9] vfs: Copy should check len after file open mode

2015-09-29 Thread Anna Schumaker
I don't think it makes sense to report that a copy succeeded if the files aren't open properly. Signed-off-by: Anna Schumaker Reviewed-by: David Sterba --- fs/read_write.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/read_write.c b/fs/read_write.c ind

[PATCH v4 3/9] btrfs: add .copy_file_range file operation

2015-09-29 Thread Anna Schumaker
shared. Signed-off-by: Zach Brown Signed-off-by: Anna Schumaker Reviewed-by: Josef Bacik Reviewed-by: David Sterba --- fs/btrfs/ctree.h | 3 ++ fs/btrfs/file.c | 1 + fs/btrfs/ioctl.c | 91 3 files changed, 56 insertions(+), 39

[PATCH v4 1/9] vfs: add copy_file_range syscall and vfs helper

2015-09-29 Thread Anna Schumaker
: Zach Brown [Anna Schumaker: Change -EINVAL to -EBADF during file verification] [Anna Schumaker: Change flags parameter from int to unsigned int] Signed-off-by: Anna Schumaker --- fs/read_write.c | 129 ++ include/linux/fs.h| 3

[PATCH v4 0/9] VFS: In-kernel copy system call

2015-09-29 Thread Anna Schumaker
ons? Comments? Thoughts? Anna Anna Schumaker (6): vfs: Copy should check len after file open mode vfs: Copy shouldn't forbid ranges inside the same file vfs: Copy should use file_out rather than file_in vfs: Remove copy_file_range mountpoint checks vfs: Add vfs_copy_file_range(

Re: [PATCH v4 3/9] btrfs: add .copy_file_range file operation

2015-09-30 Thread Anna Schumaker
On 09/29/2015 11:20 PM, Zhao Lei wrote: > Hi, Anna Schumaker > >> -Original Message- >> From: linux-btrfs-ow...@vger.kernel.org >> [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Anna Schumaker >> Sent: Wednesday, September 30, 2015 2:05 AM >>

[PATCH v5 5/9] vfs: Copy shouldn't forbid ranges inside the same file

2015-09-30 Thread Anna Schumaker
This is perfectly valid for BTRFS and XFS, so let's leave this up to filesystems to check. Signed-off-by: Anna Schumaker Reviewed-by: David Sterba Reviewed-by: Darrick J. Wong --- fs/read_write.c | 4 1 file changed, 4 deletions(-) diff --git a/fs/read_write.c b/fs/read_write.c

[PATCH v5 9/9] btrfs: btrfs_copy_file_range() only supports reflinks

2015-09-30 Thread Anna Schumaker
Reject copies that don't have the COPY_FR_REFLINK flag set. Signed-off-by: Anna Schumaker Reviewed-by: David Sterba --- fs/btrfs/ioctl.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index d3697e8..c1f115d 100644 --- a/fs/btrfs/ioctl.c +++

[PATCH v5 4/9] vfs: Copy should check len after file open mode

2015-09-30 Thread Anna Schumaker
I don't think it makes sense to report that a copy succeeded if the files aren't open properly. Signed-off-by: Anna Schumaker Reviewed-by: David Sterba --- fs/read_write.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/read_write.c b/fs/read_write.c ind

[PATCH v5 10/9] copy_file_range.2: New page documenting copy_file_range()

2015-09-30 Thread Anna Schumaker
copy_file_range() is a new system call for copying ranges of data completely in the kernel. This gives filesystems an opportunity to implement some kind of "copy acceleration", such as reflinks or server-side-copy (in the case of NFS). Signed-off-by: Anna Schumaker Reviewed-by: Darri

[PATCH v5 1/9] vfs: add copy_file_range syscall and vfs helper

2015-09-30 Thread Anna Schumaker
: Zach Brown [Anna Schumaker: Change -EINVAL to -EBADF during file verification] [Anna Schumaker: Change flags parameter from int to unsigned int] [Anna Schumaker: Add function to include/linux/syscalls.h] Signed-off-by: Anna Schumaker --- v5: - Bump syscall number again - Add to include/linux

[PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-09-30 Thread Anna Schumaker
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: Darrick J. Wong Reviewed-by: Padraig Brady --- fs/read_write.c | 61 +++ include/linux

[PATCH v5 7/9] vfs: Remove copy_file_range mountpoint checks

2015-09-30 Thread Anna Schumaker
I still want to do an in-kernel copy even if the files are on different mountpoints, and NFS has a "server to server" copy that expects two files on different mountpoints. Let's have individual filesystems implement this check instead. Signed-off-by: Anna Schumaker Reviewed-b

[PATCH v5 3/9] btrfs: add .copy_file_range file operation

2015-09-30 Thread Anna Schumaker
shared. Signed-off-by: Zach Brown [Anna Schumaker: Make flags an unsigned int] Signed-off-by: Anna Schumaker Reviewed-by: Josef Bacik Reviewed-by: David Sterba --- v5: - Make flags variable an unsigned int --- fs/btrfs/ctree.h | 3 ++ fs/btrfs/file.c | 1 + fs/btrfs/ioctl.c | 91

[PATCH v5 6/9] vfs: Copy should use file_out rather than file_in

2015-09-30 Thread Anna Schumaker
The way to think about this is that the destination filesystem reads the data from the source file and processes it accordingly. This is especially important to avoid an infinate loop when doing a "server to server" copy on NFS. Signed-off-by: Anna Schumaker --- fs/read_write.c | 6

[PATCH v5 0/9] VFS: In-kernel copy system call

2015-09-30 Thread Anna Schumaker
don't need to keep writing their own ioctls. This posting fixes a few issues that popped up after I submitted v4 yesterday. Changes in v5: - Bump syscall number (again) - Add sys_copy_file_range() to include/linux/syscalls.h - Change flags parameter on btrfs to an unsigned int Anna Sc

[PATCH v5 2/9] x86: add sys_copy_file_range to syscall tables

2015-09-30 Thread Anna Schumaker
From: Zach Brown Add sys_copy_file_range to the x86 syscall tables. Signed-off-by: Zach Brown [Anna Schumaker: Update syscall number in syscall_32.tbl] Signed-off-by: Anna Schumaker --- arch/x86/entry/syscalls/syscall_32.tbl | 1 + arch/x86/entry/syscalls/syscall_64.tbl | 1 + 2 files

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-13 Thread Anna Schumaker
On 10/07/2015 09:40 PM, Neil Brown wrote: > Anna Schumaker writes: > >> @@ -1338,34 +1362,26 @@ ssize_t vfs_copy_file_range(struct file *file_in, >> loff_t pos_in, >> struct file *file_out, loff_t pos_out, >>

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-13 Thread Anna Schumaker
On 10/09/2015 07:15 AM, Pádraig Brady wrote: > On 08/10/15 02:40, Neil Brown wrote: >> Anna Schumaker writes: >> >>> @@ -1338,34 +1362,26 @@ ssize_t vfs_copy_file_range(struct file *file_in, >>> loff_t pos_in, >>>

Re: [PATCH v5 5/9] vfs: Copy shouldn't forbid ranges inside the same file

2015-10-14 Thread Anna Schumaker
I would have folded this and patch 4 earlier if I had written patch 1, but I didn't feel comfortable modifying Zach's work too much. I can make that change if it's not really a problem. Anna On 10/11/2015 10:22 AM, Christoph Hellwig wrote: > Needs to be folded. > -- To unsubscribe from this

Re: [PATCH v5 7/9] vfs: Remove copy_file_range mountpoint checks

2015-10-14 Thread Anna Schumaker
On 10/11/2015 10:23 AM, Christoph Hellwig wrote: > On Wed, Sep 30, 2015 at 01:26:51PM -0400, Anna Schumaker wrote: >> I still want to do an in-kernel copy even if the files are on different >> mountpoints, and NFS has a "server to server" copy that expects two >>

Re: [PATCH v5 8/9] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-14 Thread Anna Schumaker
On 10/12/2015 07:17 PM, Darrick J. Wong wrote: > On Sun, Oct 11, 2015 at 07:22:03AM -0700, Christoph Hellwig wrote: >> On Wed, Sep 30, 2015 at 01:26:52PM -0400, Anna Schumaker wrote: >>> This allows us to have an in-kernel copy mechanism that avoids frequent >>> switc

Re: [PATCH v5 5/9] vfs: Copy shouldn't forbid ranges inside the same file

2015-10-14 Thread Anna Schumaker
On 10/14/2015 02:25 PM, Christoph Hellwig wrote: > On Wed, Oct 14, 2015 at 01:37:13PM -0400, Anna Schumaker wrote: >> I would have folded this and patch 4 earlier if I had written patch 1, >> but I didn't feel comfortable modifying Zach's work too much. I can >&g

[PATCH v6 4/4] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-16 Thread Anna Schumaker
rw_verify_area() calls into the fallback code since some filesystems can handle reflinking a large range. Signed-off-by: Anna Schumaker Reviewed-by: Darrick J. Wong Reviewed-by: Padraig Brady --- v6: - Don't reflink by default. - Reword commit message. --- fs/read_write.c

[PATCH v6 1/4] vfs: add copy_file_range syscall and vfs helper

2015-10-16 Thread Anna Schumaker
: Zach Brown [Anna Schumaker: Change -EINVAL to -EBADF during file verification, Change flags parameter from int to unsigned int, Add function to include/linux/syscalls.h, Check copy len after file open mode, Don't forbid r

[PATCH v6 0/4] VFS: In-kernel copy system call

2015-10-16 Thread Anna Schumaker
I would like to focus on the base system call first, and then add that later if it's still desired. Changes in v6: - Squash together most patches. - Drop all flags except COPY_FR_REFLINK. - Drop patch removing same mountpoint check. - Change default behavior (flags = 0) to a data copy. Anna

[PATCH v6 3/4] btrfs: add .copy_file_range file operation

2015-10-16 Thread Anna Schumaker
shared. Signed-off-by: Zach Brown [Anna Schumaker: Make flags an unsigned int, Check for COPY_FR_REFLINK] Signed-off-by: Anna Schumaker Reviewed-by: Josef Bacik Reviewed-by: David Sterba --- v6: - Check for COPY_FR_REFLINK --- fs/btrfs/ctree.h | 3 ++ fs/btrfs/file.c | 1

[PATCH v6 5/4] copy_file_range.2: New page documenting copy_file_range()

2015-10-16 Thread Anna Schumaker
copy_file_range() is a new system call for copying ranges of data completely in the kernel. This gives filesystems an opportunity to implement some kind of "copy acceleration", such as reflinks or server-side-copy (in the case of NFS). Signed-off-by: Anna Schumaker Reviewed-by: Darri

[PATCH v6 2/4] x86: add sys_copy_file_range to syscall tables

2015-10-16 Thread Anna Schumaker
From: Zach Brown Add sys_copy_file_range to the x86 syscall tables. Signed-off-by: Zach Brown [Anna Schumaker: Update syscall number in syscall_32.tbl] Signed-off-by: Anna Schumaker --- arch/x86/entry/syscalls/syscall_32.tbl | 1 + arch/x86/entry/syscalls/syscall_64.tbl | 1 + 2 files

[PATCH v7 5/4] copy_file_range.2: New page documenting copy_file_range()

2015-10-23 Thread Anna Schumaker
copy_file_range() is a new system call for copying ranges of data completely in the kernel. This gives filesystems an opportunity to implement some kind of "copy acceleration", such as reflinks or server-side-copy (in the case of NFS). Signed-off-by: Anna Schumaker Reviewed-by: Darri

[PATCH v7 4/4] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-10-23 Thread Anna Schumaker
h the pagecache. 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: Darrick J. Wong Reviewed-by: Padraig Brady --- v7: - Remove checks for COPY_FR_REFLINK --- fs/read_write.c

[PATCH v7 0/4] VFS: In-kernel copy system call

2015-10-23 Thread Anna Schumaker
ing on ARM devices. - Meniton sparse file expansion in the man page. Anna Schumaker (1): vfs: Add vfs_copy_file_range() support for pagecache copies Zach Brown (3): vfs: add copy_file_range syscall and vfs helper x86: add sys_copy_file_range to syscall tables btrfs: add .copy_file_range file

[PATCH v7 3/4] btrfs: add .copy_file_range file operation

2015-10-23 Thread Anna Schumaker
shared. Signed-off-by: Zach Brown [Anna Schumaker: Make flags an unsigned int] Signed-off-by: Anna Schumaker Reviewed-by: Josef Bacik Reviewed-by: David Sterba --- v7: - Remove COPY_FR_REFLINK check --- fs/btrfs/ctree.h | 3 ++ fs/btrfs/file.c | 1 + fs/btrfs/ioctl.c | 91

[PATCH v7 1/4] vfs: add copy_file_range syscall and vfs helper

2015-10-23 Thread Anna Schumaker
: Zach Brown [Anna Schumaker: Change -EINVAL to -EBADF during file verification, Change flags parameter from int to unsigned int, Add function to include/linux/syscalls.h, Check copy len after file open mode, Don't forbid r

[PATCH v7 2/4] x86: add sys_copy_file_range to syscall tables

2015-10-23 Thread Anna Schumaker
From: Zach Brown Add sys_copy_file_range to the x86 syscall tables. Signed-off-by: Zach Brown [Anna Schumaker: Update syscall number in syscall_32.tbl] Signed-off-by: Anna Schumaker --- arch/x86/entry/syscalls/syscall_32.tbl | 1 + arch/x86/entry/syscalls/syscall_64.tbl | 1 + 2 files

[PATCH v8 0/4] VFS: In-kernel copy system call

2015-11-06 Thread Anna Schumaker
t for now since I use this function for pagecache copies. Changes in v8: - Remove redundant checks. - Make the fdget() / fdput() calls more obvious. - Document disallowing files open with O_APPEND. Thanks, Anna Anna Schumaker (1): vfs: Add vfs_copy_file_range() support for pagecache copies

[PATCH v8 2/4] x86: add sys_copy_file_range to syscall tables

2015-11-06 Thread Anna Schumaker
From: Zach Brown Add sys_copy_file_range to the x86 syscall tables. Signed-off-by: Zach Brown [Anna Schumaker: Update syscall number in syscall_32.tbl] Signed-off-by: Anna Schumaker Reviewed-by: Christoph Hellwig --- arch/x86/entry/syscalls/syscall_32.tbl | 1 + arch/x86/entry/syscalls

[PATCH v8 5/4] copy_file_range.2: New page documenting copy_file_range()

2015-11-06 Thread Anna Schumaker
copy_file_range() is a new system call for copying ranges of data completely in the kernel. This gives filesystems an opportunity to implement some kind of "copy acceleration", such as reflinks or server-side-copy (in the case of NFS). Signed-off-by: Anna Schumaker Reviewed-by: Darri

[PATCH v8 4/4] vfs: Add vfs_copy_file_range() support for pagecache copies

2015-11-06 Thread Anna Schumaker
rw_verify_area() calls into the fallback code since some filesystems can handle reflinking a large range. Signed-off-by: Anna Schumaker Reviewed-by: Darrick J. Wong Reviewed-by: Padraig Brady Reviewed-by: Christoph Hellwig --- fs/read_write.c | 37 ++--- 1 file

[PATCH v8 3/4] btrfs: add .copy_file_range file operation

2015-11-06 Thread Anna Schumaker
shared. Signed-off-by: Zach Brown [Anna Schumaker: Make flags an unsigned int, Check for COPY_FR_REFLINK] Signed-off-by: Anna Schumaker Reviewed-by: Josef Bacik Reviewed-by: David Sterba Reviewed-by: Christoph Hellwig --- fs/btrfs/ctree.h | 3 ++ fs/btrfs/file.c | 1 + fs

[PATCH v8 1/4] vfs: add copy_file_range syscall and vfs helper

2015-11-06 Thread Anna Schumaker
: Zach Brown [Anna Schumaker: Change -EINVAL to -EBADF during file verification, Change flags parameter from int to unsigned int, Add function to include/linux/syscalls.h, Check copy len after file open mode, Don't forbid r

[PATCH v9 0/4] VFS: In-kernel copy system call

2015-11-10 Thread Anna Schumaker
don't need to keep writing their own ioctls. Changes in v9: - Update syscall number for sys_mlock2() - Fix calls to rw_verify_area() Thanks, Anna Anna Schumaker (1): vfs: Add vfs_copy_file_range() support for pagecache copies Zach Brown (3): vfs: add copy_file_range syscall and vfs he

  1   2   >