Re: [PATCH v3 2/4] iov_iter: Add a function to extract a page list from an iterator

From: Logan Gunthorpe
Date: Tue Dec 06 2022 - 11:44:11 EST




On 2022-12-02 02:43, David Howells wrote:
> Add a function, iov_iter_extract_pages(), to extract a list of pages from
> an iterator. The pages may be returned with a reference added or a pin
> added or neither, depending on the type of iterator and the direction of
> transfer.
> +static ssize_t iov_iter_extract_user_pages(struct iov_iter *i,
> + struct page ***pages, size_t maxsize,
> + unsigned int maxpages,
> + size_t *offset0,
> + unsigned int *cleanup_mode)

If this is going to be a general replacement for iov_iter_get_pages()
it's going to need to pass through gup_flags. My recent patchset added
versions with these and I think it should be in during the next merge
cycle. [1]

Thanks,

Logan


[1] https://lore.kernel.org/all/20221021174116.7200-4-logang@xxxxxxxxxxxx/