]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iov_iter: add copy_page_to_iter_nofault()
authorLorenzo Stoakes <lstoakes@gmail.com>
Wed, 22 Mar 2023 18:57:03 +0000 (18:57 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 28 Mar 2023 23:25:14 +0000 (16:25 -0700)
commit636e054a04760854a6971e5ee9b21e5b4052ba42
tree0c40217446a6021e43cd87dcc90cbc4de69b723d
parentf4f44b2dd7b4547f4715fe82b9b0e479bb9da160
iov_iter: add copy_page_to_iter_nofault()

Provide a means to copy a page to user space from an iterator, aborting if
a page fault would occur.  This supports compound pages, but may be passed
a tail page with an offset extending further into the compound page, so we
cannot pass a folio.

This allows for this function to be called from atomic context and _try_
to user pages if they are faulted in, aborting if not.

The function does not use _copy_to_iter() in order to not specify
might_fault(), this is similar to copy_page_from_iter_atomic().

This is being added in order that an iteratable form of vread() can be
implemented while holding spinlocks.

Link: https://lkml.kernel.org/r/19734729defb0f498a76bdec1bef3ac48a3af3e8.1679511146.git.lstoakes@gmail.com
Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Baoquan He <bhe@redhat.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Liu Shixin <liushixin2@huawei.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/uio.h
lib/iov_iter.c