netfs: Add a function to extract an iterator into a scatterlist
authorDavid Howells <dhowells@redhat.com>
Thu, 27 Oct 2022 15:19:44 +0000 (16:19 +0100)
committerSteve French <stfrench@microsoft.com>
Mon, 20 Feb 2023 23:25:43 +0000 (17:25 -0600)
commit0185846975339a5c348373aa450a977f5242366b
tree1999ae8a5becdd01523a96e641dea1f12e6b3f82
parent85dd2c8ff368b1446be9febde84afe1d7aec4261
netfs: Add a function to extract an iterator into a scatterlist

Provide a function for filling in a scatterlist from the list of pages
contained in an iterator.

If the iterator is UBUF- or IOBUF-type, the pages have a pin taken on them
(as FOLL_PIN).

If the iterator is BVEC-, KVEC- or XARRAY-type, no pin is taken on the
pages and it is left to the caller to manage their lifetime.  It cannot be
assumed that a ref can be validly taken, particularly in the case of a KVEC
iterator.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Jeff Layton <jlayton@kernel.org>
cc: Steve French <sfrench@samba.org>
cc: Shyam Prasad N <nspmangalore@gmail.com>
cc: Rohith Surabattula <rohiths.msft@gmail.com>
cc: linux-cachefs@redhat.com
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/netfs/iterator.c
include/linux/netfs.h
mm/vmalloc.c