lkml.org 
[lkml]   [2023]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 4/9] iov_iter: Add a function to extract a page list from an iterator
On Wed, Jan 11, 2023 at 02:28:05PM +0000, David Howells wrote:

> +ssize_t iov_iter_extract_pages(struct iov_iter *i,
> + struct page ***pages,
> + size_t maxsize,
> + unsigned int maxpages,
> + unsigned int gup_flags,
> + size_t *offset0,
> + unsigned int *cleanup_mode)

This cleanup_mode thing is wrong. It's literally a trivial
function of ->user_backed and ->data_source - we don't
even need to look at the ->type.

Separate it into an inline helper and be done with that;
don't carry it all over the place.

It's really "if not user-backed => 0, otherwise it's FOLL_PIN or FOLL_GET,
depending upon the direction".

\
 
 \ /
  Last update: 2023-03-26 23:38    [W:0.226 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site