iov_iter: Add mapping and discard iterator types
Add two new iterator types to iov_iter:
(1) ITER_MAPPING
This walks through a set of pages attached to an address_space that
are pinned or locked, starting at a given page and offset and walking
for the specified amount of space. The facility to get a callback each
time a page is filled is provided.
This is useful for copying data from socket buffers to inodes in
network filesystems.
(2) ITER_DISCARD
This is a sink iterator that can only be used in READ mode and just
discards any data copied to it.
This can be used to discard any unwanted data a network filesystem is
sent by a server.
Signed-off-by: David Howells <dhowells@redhat.com>
2 files changed