linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: David Howells <dhowells@redhat.com>
Cc: jlayton@redhat.com, smfrench@gmail.com, linux-fsdevel@vger.kernel.org
Subject: Re: [RFC][PATCH] iov_iter: Add extraction functions
Date: Sat, 24 Sep 2022 03:22:04 +0100	[thread overview]
Message-ID: <Yy5pzHiQ4GRCOoXV@ZenIV> (raw)
In-Reply-To: <3750754.1662765490@warthog.procyon.org.uk>

On Sat, Sep 10, 2022 at 12:18:10AM +0100, David Howells wrote:
> Hi Al, Jeff,
> 
> Here's a replacement for the extract_iter_to_iter() patch I had previously.
> It's a WIP, some bits aren't fully implemented, though some bits I have tested
> and got to work, but if you could take a look and see if you're okay with the
> interface.
> 
> I think I've addressed most of Al's comments.  The page-pinning is conditional
> on certain types of iterator, and a number of the iterator types just extract
> to the same thing.  It should now handle kvec-class iterators that refer to
> vmalloc'd data.
> 
> I've also added extraction to scatterlist (which I'll need for doing various
> crypto things) and extraction to ib_sge which could be used in cifs/smb RDMA,
> bypassing the conversion-to-scatterlist step.
> 
> As mentioned, there are bits that aren't fully implemented, let alone tested.

IDGI.  Essentially, you are passing a callback disguised as enum, only to lose
any type safety.  How is it better than "iov_iter_get_pages2() into a fixed-sized
array and handle the result" done in a loop?  No need to advance it (iov_iter_get_page2()
auto-advances), *way* fewer conditional branches and no need to share anything
between the 3 functions you are after...

> +ssize_t extract_iter_to_sg(struct iov_iter *iter, size_t len,
> +			   struct sg_table *sgtable, bool *pages_pinned)

Your *pages_pinned is user_backed_iter(iter), isn't it?

  reply	other threads:[~2022-09-24  2:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-09 23:18 [RFC][PATCH] iov_iter: Add extraction functions David Howells
2022-09-24  2:22 ` Al Viro [this message]
2022-10-14 12:22 ` David Howells
2022-10-18 14:29 ` David Howells
2022-10-18 14:48   ` Christoph Hellwig

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=Yy5pzHiQ4GRCOoXV@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=dhowells@redhat.com \
    --cc=jlayton@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=smfrench@gmail.com \
    /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).