]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
iov_iter: Add ITER_XARRAY
authorDavid Howells <dhowells@redhat.com>
Mon, 10 Feb 2020 10:00:21 +0000 (10:00 +0000)
committerDavid Howells <dhowells@redhat.com>
Thu, 21 Jan 2021 17:30:36 +0000 (17:30 +0000)
commit11432a3cc061c39475295be533c3674c4f8a6d0b
tree48c42cae6902db1b1ddc4cf775ffa5914effd6b1
parent9791581c049c10929e97098374dd1716a81fefcc
iov_iter: Add ITER_XARRAY

Add an iterator, ITER_XARRAY, that walks through a set of pages attached to
an xarray, starting at a given page and offset and walking for the
specified amount of bytes.  The iterator supports transparent huge pages.

The caller must guarantee that the pages are all present and they must be
locked using PG_locked, PG_writeback or PG_fscache to prevent them from
going away or being migrated whilst they're being accessed.

This is useful for copying data from socket buffers to inodes in network
filesystems and for transferring data between those inodes and the cache
using direct I/O.

Whilst it is true that ITER_BVEC could be used instead, that would require
a bio_vec array to be allocated to refer to all the pages - which should be
redundant if inode->i_pages also points to all these pages.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Matthew Wilcox <willy@infradead.org>
include/linux/uio.h
lib/iov_iter.c