iov_iter: Introduce fault_in_iov_iter_writeable
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 5 Jul 2021 15:26:28 +0000 (17:26 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 20 Oct 2021 17:33:07 +0000 (19:33 +0200)
commitcdd591fc86e38ad3899196066219fbbd845f3162
tree6fa9b67d1df07be3b57ba43a66120c0c4fd63450
parenta6294593e8a1290091d0b078d5d33da5e0cd3dfe
iov_iter: Introduce fault_in_iov_iter_writeable

Introduce a new fault_in_iov_iter_writeable helper for safely faulting
in an iterator for writing.  Uses get_user_pages() to fault in the pages
without actually writing to them, which would be destructive.

We'll use fault_in_iov_iter_writeable in gfs2 once we've determined that
the iterator passed to .read_iter isn't in memory.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
include/linux/pagemap.h
include/linux/uio.h
lib/iov_iter.c
mm/gup.c