lkml.org 
[lkml]   [2020]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 2/3] iov_iter: introduce iov_iter_pin_user_pages*() routines
From
Date
On 8/29/20 7:58 AM, Christoph Hellwig wrote:
> On Sat, Aug 29, 2020 at 01:08:52AM -0700, John Hubbard wrote:
...
>> @@ -1280,7 +1281,11 @@ static inline ssize_t __pipe_get_pages(struct iov_iter *i,
>> maxsize = n;
>> n += *start;
>> while (n > 0) {
>> - get_page(*pages++ = pipe->bufs[iter_head & p_mask].page);
>> + if (use_pup)
>> + pin_user_page(*pages++ = pipe->bufs[iter_head & p_mask].page);
>> + else
>> + get_page(*pages++ = pipe->bufs[iter_head & p_mask].page);
>
> Maybe this would become a little more readable with a local variable
> and a little more verbosity:
>
> struct page *page = pipe->bufs[iter_head & p_mask].page;
>
> if (use_pup)
> pin_user_page(page);
> else
> get_page(page);
>
> *pages++ = page;
>

Yes, that is cleaner, I'll change to that, thanks.

thanks,
--
John Hubbard
NVIDIA

\
 
 \ /
  Last update: 2020-08-29 23:59    [W:0.063 / U:0.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site