Re: [PATCH RFC 1/3] vfs: add copy_file_range syscall and vfs helper

2015-04-14 Thread Anna Schumaker
On 04/14/2015 12:53 PM, Christoph Hellwig wrote: On Sat, Apr 11, 2015 at 09:04:02AM -0400, Jeff Layton wrote: Yuck! How the heck do you clean up the mess if that happens? I guess you're just stuck redoing the copy with normal READ/WRITE? Maybe we need to have the interface return a hard error

[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 <anna.schuma.

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

2015-10-23 Thread Anna Schumaker
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 <anna.schuma...@netapp.com> Reviewed-by: Darrick J. Wong <darrick.w...@oracle.com> Reviewed-by: Padraig Brady <p...@draigbr

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

2015-10-23 Thread Anna Schumaker
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 operation

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

2015-10-23 Thread Anna Schumaker
error checks that should be shared. Signed-off-by: Zach Brown <z...@redhat.com> [Anna Schumaker: Make flags an unsigned int] Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> Reviewed-by: Josef Bacik <jba...@fb.com> Reviewed-by: David Sterba <dste...@suse.com> --- v7:

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

2015-10-23 Thread Anna Schumaker
safely. Signed-off-by: Zach Brown <z...@redhat.com> [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 fi

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

2015-10-23 Thread Anna Schumaker
From: Zach Brown <z...@redhat.com> Add sys_copy_file_range to the x86 syscall tables. Signed-off-by: Zach Brown <z...@redhat.com> [Anna Schumaker: Update syscall number in syscall_32.tbl] Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> --- arch/x86/entry/syscalls/

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

2015-11-10 Thread Anna Schumaker
From: Zach Brown <z...@redhat.com> Add sys_copy_file_range to the x86 syscall tables. Signed-off-by: Zach Brown <z...@redhat.com> [Anna Schumaker: Update syscall number in syscall_32.tbl] Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> Reviewed-by: Christoph He

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

2015-11-10 Thread Anna Schumaker
error checks that should be shared. Signed-off-by: Zach Brown <z...@redhat.com> [Anna Schumaker: Make flags an unsigned int, Check for COPY_FR_REFLINK] Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> Reviewed-by: Josef Bacik <jba...@fb.com> Reviewe

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

2015-11-10 Thread Anna Schumaker
safely. Signed-off-by: Zach Brown <z...@redhat.com> [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 fi

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

2015-11-10 Thread Anna Schumaker
-by: Anna Schumaker <anna.schuma...@netapp.com> Reviewed-by: Darrick J. Wong <darrick.w...@oracle.com> Reviewed-by: Padraig Brady <p...@draigbrady.com> Reviewed-by: Christoph Hellwig <h...@lst.de> --- v9: - Don't remove call to rw_verify_area() --- fs/read_write.c | 13

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

2015-11-10 Thread Anna Schumaker
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 helper x86

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

2015-11-11 Thread Anna Schumaker
On 11/10/2015 10:38 PM, Al Viro wrote: > On Tue, Nov 10, 2015 at 04:53:29PM -0500, Anna Schumaker wrote: >> Copy system calls came up during Plumbers a while ago, mostly because several >> filesystems (including NFS and XFS) are currently working on copy >> acceleration &g

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

2015-11-06 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 <anna.schuma...@netapp.com> Reviewed-by: Darrick J. Wong <darrick.w...@oracle.com> Reviewed-by: Padraig Brady <p...@draigbrady.com> Reviewed-by: Ch

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

2015-11-06 Thread Anna Schumaker
error checks that should be shared. Signed-off-by: Zach Brown <z...@redhat.com> [Anna Schumaker: Make flags an unsigned int, Check for COPY_FR_REFLINK] Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> Reviewed-by: Josef Bacik <jba...@fb.com> Reviewe

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

2015-11-06 Thread Anna Schumaker
safely. Signed-off-by: Zach Brown <z...@redhat.com> [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 fi

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

2015-11-06 Thread Anna Schumaker
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 Zach Brown (3

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

2015-11-06 Thread Anna Schumaker
From: Zach Brown <z...@redhat.com> Add sys_copy_file_range to the x86 syscall tables. Signed-off-by: Zach Brown <z...@redhat.com> [Anna Schumaker: Update syscall number in syscall_32.tbl] Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> Reviewed-by: Christoph He

[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 <anna.schuma.

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

2015-10-16 Thread Anna Schumaker
ase 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 Schumaker (1): vfs: Add vfs_copy_

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

2015-10-16 Thread Anna Schumaker
error checks that should be shared. Signed-off-by: Zach Brown <z...@redhat.com> [Anna Schumaker: Make flags an unsigned int, Check for COPY_FR_REFLINK] Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> Reviewed-by: Josef Bacik <jba...@fb.com> Reviewe

[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 <anna.schuma.

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

2015-10-16 Thread Anna Schumaker
safely. Signed-off-by: Zach Brown <z...@redhat.com> [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 fi

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

2015-10-16 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 <anna.schuma...@netapp.com> Reviewed-by: Darrick J. Wong <darrick.w...@oracle.com> Reviewed-by: Padraig Brady <p...@draigbrady.com> --- v6: - Don't

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

2015-10-16 Thread Anna Schumaker
From: Zach Brown <z...@redhat.com> Add sys_copy_file_range to the x86 syscall tables. Signed-off-by: Zach Brown <z...@redhat.com> [Anna Schumaker: Update syscall number in syscall_32.tbl] Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> --- arch/x86/entry/syscalls/

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 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 >> mak

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 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 <anna.schuma...@netapp.com> writes: >> >>> @@ -1338,34 +1362,26 @@ ssize_t vfs_copy_file_range(struct file *file_in, >>> loff_t pos_in, >>>

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 <anna.schuma...@netapp.com> 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, >

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

2015-09-04 Thread Anna Schumaker
safely. Signed-off-by: Zach Brown <z...@redhat.com> [Anna Schumaker: Change -EINVAL to -EBADF during file verification] Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> --- fs/read_write.c | 129 ++ include/linux/fs.h

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

2015-09-04 Thread Anna Schumaker
error checks that should be shared. Signed-off-by: Zach Brown <z...@redhat.com> Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> --- fs/btrfs/ctree.h | 3 ++ fs/btrfs/file.c | 1 + fs/btrfs/ioctl.c | 91 3 files chan

[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 <anna.schuma...@netapp.com> --- fs/btrfs/ioctl.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/ioctl.

[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 <anna.schuma...@netapp.com> --- 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 9

[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 <anna.schuma.

[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 <anna.schuma.

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

2015-09-04 Thread Anna Schumaker
| 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_file_range mountpoint

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

2015-09-04 Thread Anna Schumaker
the fallback. Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> --- 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(-) creat

[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 <anna.schuma...@netapp

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

2015-09-04 Thread Anna Schumaker
From: Zach Brown <z...@redhat.com> Add sys_copy_file_range to the x86 syscall tables. Signed-off-by: Zach Brown <z...@redhat.com> Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> --- arch/x86/entry/syscalls/syscall_32.tbl | 1 + arch/x86/entry/syscalls/syscall_64.

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

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 <darrick.w...@oracle.com> 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 dat

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 <anna.schuma...@netapp.com> wrote: >> >> Copy system calls came up during Plumbers a couple of weeks ago, >> because several filesystems (including NFS and XFS) are currently >

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

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. >> >> Si

[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 <anna.schuma.

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

2015-09-11 Thread Anna Schumaker
From: Zach Brown <z...@redhat.com> Add sys_copy_file_range to the x86 syscall tables. Signed-off-by: Zach Brown <z...@redhat.com> [Anna Schumaker: Update syscall number in syscall_32.tbl] Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> --- arch/x86/entry/syscalls/

[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 <anna.schuma...@netapp.com> --- 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 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 <anna.schuma...@netapp.com> --- 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 --

[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 <anna.schuma...@netapp

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

2015-09-11 Thread Anna Schumaker
range. Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> --- 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 functi

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

2015-09-11 Thread Anna Schumaker
safely. Signed-off-by: Zach Brown <z...@redhat.com> [Anna Schumaker: Change -EINVAL to -EBADF during file verification] Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> --- fs/read_write.c | 129 ++ include/linux/fs.h

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

2015-09-11 Thread Anna Schumaker
error checks that should be shared. Signed-off-by: Zach Brown <z...@redhat.com> Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> Reviewed-by: Josef Bacik <jba...@fb.com> Reviewed-by: David Sterba <dste...@suse.com> --- fs/btrfs/ctree.h | 3 ++ fs/btrfs/file.c

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

2015-09-11 Thread Anna Schumaker
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? Anna A

[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 <anna.schuma.

[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 <anna.schuma...@netapp.com> --- 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 8

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 >> h

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 any kind o

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 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 <anna.schuma...@netapp

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

2015-09-30 Thread Anna Schumaker
error checks that should be shared. Signed-off-by: Zach Brown <z...@redhat.com> [Anna Schumaker: Make flags an unsigned int] Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> Reviewed-by: Josef Bacik <jba...@fb.com> Reviewed-by: David Sterba <dste...@suse.com>

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

2015-09-30 Thread Anna Schumaker
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 Schumaker (6

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

2015-09-30 Thread Anna Schumaker
From: Zach Brown <z...@redhat.com> Add sys_copy_file_range to the x86 syscall tables. Signed-off-by: Zach Brown <z...@redhat.com> [Anna Schumaker: Update syscall number in syscall_32.tbl] Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> --- arch/x86/entry/syscalls/

[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 <anna.schuma...@netapp.com> Reviewed-by: David Sterba <dste...@suse.com> Reviewed-by: Darrick J. Wong <darrick.w...@oracle.com> --- fs/read_write.c | 4

[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 <anna.schuma...@netapp.com> Reviewed-by: David Sterba <dste...@suse.com> --- fs/btrfs/ioctl.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c i

[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 <anna.schuma...@netapp.com> Reviewed-by: David Sterba <dste...@suse.com> --- fs/read_write.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) dif

[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 <anna.schuma.

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

2015-09-30 Thread Anna Schumaker
safely. Signed-off-by: Zach Brown <z...@redhat.com> [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 <anna.schum

[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 <anna.schuma...@netapp.com> Reviewed-by: Darrick J. Wong <darrick.w...@oracle.com> Reviewed-by: Padraig Brady <p...@draigbrady.com> --

[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 <anna.schuma.

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 > <anna.schuma...@netapp.com> wrote: >> The NFS server will need some kind offallback for filesystems that don't >> have any kind of copy acceleration, and it should be gen

[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 <anna.schuma...@netapp.com> Reviewed-by: David Sterba <dste...@suse.com> Reviewed-by: Darrick J. Wong <darrick.w...@oracle.com> --- fs/read_write.c | 4

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

2015-09-29 Thread Anna Schumaker
error checks that should be shared. Signed-off-by: Zach Brown <z...@redhat.com> Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> Reviewed-by: Josef Bacik <jba...@fb.com> Reviewed-by: David Sterba <dste...@suse.com> --- fs/btrfs/ctree.h | 3 ++ fs/btrfs/file.c

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

2015-09-29 Thread Anna Schumaker
safely. Signed-off-by: Zach Brown <z...@redhat.com> [Anna Schumaker: Change -EINVAL to -EBADF during file verification] [Anna Schumaker: Change flags parameter from int to unsigned int] Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> --- fs/read_write.c

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

2015-09-29 Thread Anna Schumaker
? 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() support for pagecache copies

[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 <anna.schuma...@netapp.com> Reviewed-by: David Sterba <dste...@suse.com> --- fs/read_write.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) dif

[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 <anna.schuma.

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

2015-09-29 Thread Anna Schumaker
From: Zach Brown <z...@redhat.com> Add sys_copy_file_range to the x86 syscall tables. Signed-off-by: Zach Brown <z...@redhat.com> [Anna Schumaker: Update syscall number in syscall_32.tbl] Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> --- arch/x86/entry/syscalls/

[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 <anna.schuma...@netapp

[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 <anna.schuma...@netapp.com> Reviewed-by: Darrick J. Wong <darrick.w...@oracle.com> --- v4: - Reword commit message - Rename COPY_FR_DEDUPE ->

[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 <anna.schuma.

[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 <anna.schuma...@netapp.com> Reviewed-by: David Sterba <dste...@suse.com> --- fs/btrfs/ioctl.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c i

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

2015-09-09 Thread Anna Schumaker
: >>>> On 08/09/15 20:10, Andy Lutomirski wrote: >>>>> On Tue, Sep 8, 2015 at 11:23 AM, Anna Schumaker >>>>> <anna.schuma...@netapp.com> wrote: >>>>>> On 09/08/2015 11:21 AM, Pádraig Brady wrote: >>>>>>> I see cop

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.

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 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 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 <z...@redhat.com> >> +/* >> + * copy_file_range() differs from regular file read and write in that it >> + * specifically allows retu

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 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 <anna.schuma...@netapp.com> Reviewed-by: David Sterba <dste...@suse.com> --- fs/btrfs/ioctl.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c i

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

2015-09-25 Thread Anna Schumaker
error checks that should be shared. Signed-off-by: Zach Brown <z...@redhat.com> Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> Reviewed-by: Josef Bacik <jba...@fb.com> Reviewed-by: David Sterba <dste...@suse.com> --- fs/btrfs/ctree.h | 3 ++ fs/btrfs/file.c

[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 <anna.schuma...@netapp

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

2015-09-25 Thread Anna Schumaker
safely. Signed-off-by: Zach Brown <z...@redhat.com> [Anna Schumaker: Change -EINVAL to -EBADF during file verification] [Anna Schumaker: Change flags parameter from int to unsigned int] Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> --- v3: - Change flags parameter to ta

[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 <anna.schuma.

[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 <anna.schuma.

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

2015-09-25 Thread Anna Schumaker
From: Zach Brown <z...@redhat.com> Add sys_copy_file_range to the x86 syscall tables. Signed-off-by: Zach Brown <z...@redhat.com> [Anna Schumaker: Update syscall number in syscall_32.tbl] Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> --- arch/x86/entry/syscalls/

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

2015-09-25 Thread Anna Schumaker
range. Signed-off-by: Anna Schumaker <anna.schuma...@netapp.com> --- 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

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

2015-09-25 Thread Anna Schumaker
s | 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? Thoughts? Anna Anna Sc