iov_iter: make iterator callbacks use base and len instead of iovec
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 2 May 2021 15:35:03 +0000 (11:35 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 10 Jun 2021 15:45:20 +0000 (11:45 -0400)
commit7baa5099002f2f2ea6c026890598ed1708e7cfd4
tree08e564057e2015629de372c3fdf2c30aca62aa8c
parent622838f3fde2c3671a718dc6196c19087ebe9b11
iov_iter: make iterator callbacks use base and len instead of iovec

Iterator macros used to provide the arguments for step callbacks in
a structure matching the flavour - iovec for ITER_IOVEC, kvec for
ITER_KVEC and bio_vec for ITER_BVEC.  That already broke down for
ITER_XARRAY (bio_vec there); now that we are using kvec callback
for bvec and xarray cases, we are always passing a pointer + length
(void __user * + size_t for ITER_IOVEC callback, void * + size_t
for everything else).

Note that the original reason for bio_vec (page + offset + len) in
case of ITER_BVEC used to be that we did *not* want to kmap a
page when all we wanted was e.g. to find the alignment of its
subrange.  Now all such users are gone and the ones that are left
want the page mapped anyway for actually copying the data.

So in all cases we have pointer + length, and there's no good
reason for keeping those in struct iovec or struct kvec - we
can just pass them to callback separately.

Again, less boilerplate in callbacks...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
lib/iov_iter.c