iov_iter: saner helper for page array allocation
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 17 Jun 2022 18:45:41 +0000 (14:45 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 19 Jul 2022 17:08:46 +0000 (13:08 -0400)
commit6ba6f762df116f9a68c279bb79e5aaccd1308606
treeac5cc945d2aa0764c3f0f38509ff123949134506
parentd005d51cf1e75a6d52d6659b1c2c077fe68eb8c3
iov_iter: saner helper for page array allocation

All call sites of get_pages_array() are essenitally identical now.
Replace with common helper...

Returns number of slots available in resulting array or 0 on OOM;
it's up to the caller to make sure it doesn't ask to zero-entry
array (i.e. neither maxpages nor size are allowed to be zero).

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