linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Olga Kornievskaia <kolga@netapp.com>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH 1/1] [RFC] 64bit copy_file_range system call
Date: Wed, 14 Jun 2017 22:32:37 +0300	[thread overview]
Message-ID: <CAOQ4uxhSS1s2ZYZbhzmRdw1N+DS6bc_RFHZSmeeM96uidesmuQ@mail.gmail.com> (raw)
In-Reply-To: <20170614185335.58193-1-kolga@netapp.com>

On Wed, Jun 14, 2017 at 9:53 PM, Olga Kornievskaia <kolga@netapp.com> wrote:
>
> This is a proposal to allow 64bit count to copy and return as
> a result of a copy_file_range. No attempt was made to share code
> with the 32bit function because 32bit interface should probably
> get depreciated.
>
> Why use 64bit? Current uses of 32bit are by clone_file_range()
> which could use 64bit count and NFS copy_file_range also supports
> 64bit count value.
>
> Also with this proposal off-the-bet allow the userland to copy
> between different mount points.
>
> Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
> ---
...
> +
> +       /*
> +        * Try cloning first, this is supported by more file systems, and
> +        * more efficient if both clone and copy are supported (e.g. NFS).
> +        */
> +       if (file_in->f_op->clone_file_range) {
> +               ret = file_in->f_op->clone_file_range(file_in, pos_in,
> +                               file_out, pos_out, len);
> +               if (ret == 0) {
> +                       ret = len;
> +                       goto done;
> +               }
> +       }
> +
> +       if (file_out->f_op->copy_file_range64) {
> +               ret = file_out->f_op->copy_file_range64(file_in, pos_in,
> +                                       file_out, pos_out, len, flags);
> +               if (ret != -EOPNOTSUPP)
> +                       goto done;
> +       }
> +
> +       ret = do_splice_direct(file_in, &pos_in, file_out, &pos_out,
> +                       len > MAX_RW_COUNT ? MAX_RW_COUNT : len, 0);
> +

Olga,

I know this is copied from vfs_copy_file_range() as is, so my comment
applies to the origin function as well, but it is easier to change the new
function without changing userspace behavior, so..

A while back, either Dave Chinner or Christoph suggested that I use
vfs_copy_file_range() from ovl_copy_up_data() instead of calling
vfs_clone_file_range() and falling back to do_splice_direct() loop.
Then Christoph added the clone_file_range attempt into
vfs_copy_file_range(), which was one part of the work.

However, ovl_copy_up_data() uses a killable loop of do_splice_direct()
calls with smaller chunks, so it is not the same as vfs_copy_file_range().

I wonder if it makes sense to use a similar killable loop in the new
function?
I wonder, for reference, if NFS implementation of copy_file_range64()
is killable?

Amir.

  reply	other threads:[~2017-06-14 19:32 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-14 17:06 [PATCH 1/1] [RFC] 64bit copy_file_range system call Olga Kornievskaia
2017-06-14 17:24 ` Anna Schumaker
2017-06-14 18:53   ` Olga Kornievskaia
2017-06-14 19:32     ` Amir Goldstein [this message]
2017-06-14 20:08       ` Olga Kornievskaia
2017-06-14 21:50     ` Randy Dunlap
2017-06-15 13:07       ` Olga Kornievskaia
2017-06-15  3:59     ` Darrick J. Wong
2017-06-15 14:39       ` Olga Kornievskaia
2017-06-15 20:53         ` Darrick J. Wong
2017-06-19 18:34           ` Olga Kornievskaia
2017-06-19 19:39             ` Christoph Hellwig
2017-06-19 19:48               ` Olga Kornievskaia
2017-06-20 12:38               ` Steve Dickson
2017-06-20 19:33               ` Chuck Lever
2017-06-20 19:37                 ` Olga Kornievskaia
2017-06-24 11:29               ` Mkrtchyan, Tigran
2017-06-20 12:44           ` Steve Dickson
2017-06-15  8:15 ` Christoph Hellwig
2017-06-15 13:07   ` Olga Kornievskaia
2017-06-15 18:35     ` Andreas Dilger
2017-06-15 19:11       ` Olga Kornievskaia
2017-06-16 17:36       ` J. Bruce Fields
2017-06-17 10:03         ` Christoph Hellwig
2017-06-17 12:42           ` Olga Kornievskaia
2017-06-17 15:09             ` Christoph Hellwig
2017-06-17 18:24               ` J. Bruce Fields
2017-06-24 13:23 ` Jeff Layton
2017-06-26 13:21   ` Anna Schumaker
2017-06-26 13:46     ` Jeff Layton
2017-06-26 14:46       ` Olga Kornievskaia
2017-06-26 14:49         ` [PATCH 1/1] VFS permit cross device vfs_copy_file_range Olga Kornievskaia
2017-06-27 11:47           ` Jeff Layton
2017-06-27 16:12             ` Olga Kornievskaia
     [not found]       ` <5E53733A-8136-4FB5-A7E9-F4846BF98507@netapp.com>
2017-06-26 14:51         ` [PATCH 1/1] [RFC] 64bit copy_file_range system call Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOQ4uxhSS1s2ZYZbhzmRdw1N+DS6bc_RFHZSmeeM96uidesmuQ@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=hch@lst.de \
    --cc=kolga@netapp.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).