All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: viro@zeniv.linux.org.uk
Cc: linux-mm@vger.kernel.org, John Hubbard <jhubbard@nvidia.com>,
	linux-fsdevel@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Matthew Wilcox <willy@infradead.org>,
	dhowells@redhat.com, smfrench@gmail.com,
	torvalds@linux-foundation.org, linux-cifs@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [RFC PATCH 0/2] iov_iter: Provide a function to extract/pin/get pages from an iteraor
Date: Mon, 31 Oct 2022 14:49:32 +0000	[thread overview]
Message-ID: <166722777223.2555743.162508599131141451.stgit@warthog.procyon.org.uk> (raw)


Hi Al,

Here's a patch to provide a function to extract a list of pages from an
iterator, getting pins of refs on them as appropriate.

I added a macro by which you can query an iterator to find out how the
extraction function will treat the pages (it returns 0, FOLL_GET or FOLL_PIN
as appropriate).  Note that it's a macro to avoid #inclusion of linux/mm.h in
linux/uio.h.

I've added another crude, incomplete patch to make cifs use it a bit as an
example.  Note that cifs won't work properly with this under all
circumstances, particularly if it decides to split the rdata or wdata record -
but it seems to work for small I/Os.

David
---
David Howells (2):
      iov_iter: Add a function to extract a page list from an iterator
      cifs: Test use of iov_iter_extract_pages() and iov_iter_extract_mode()


 fs/cifs/cifsglob.h  |   2 +
 fs/cifs/file.c      |  93 +++++++++----
 include/linux/uio.h |  26 ++++
 lib/iov_iter.c      | 333 ++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 427 insertions(+), 27 deletions(-)



             reply	other threads:[~2022-10-31 14:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-31 14:49 David Howells [this message]
2022-10-31 14:49 ` [RFC PATCH 1/2] iov_iter: Add a function to extract a page list from an iterator David Howells
2022-10-31 14:49 ` [RFC PATCH 2/2] cifs: Test use of iov_iter_extract_pages() and iov_iter_extract_mode() David Howells
2022-10-31 14:52 ` [RFC PATCH 0/2] iov_iter: Provide a function to extract/pin/get pages from an iteraor Matthew Wilcox
2022-10-31 20:46   ` John Hubbard

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=166722777223.2555743.162508599131141451.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=hch@lst.de \
    --cc=jhubbard@nvidia.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@vger.kernel.org \
    --cc=smfrench@gmail.com \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.