Thread (12 messages) 12 messages, 3 authors, 2020-08-30

Re: [PATCH v2 2/3] iov_iter: introduce iov_iter_pin_user_pages*() routines

From: John Hubbard <jhubbard@nvidia.com>
Date: 2020-08-29 21:58:52
Also in: linux-fsdevel, linux-mm, linux-xfs, lkml

On 8/29/20 7:58 AM, Christoph Hellwig wrote:
On Sat, Aug 29, 2020 at 01:08:52AM -0700, John Hubbard wrote:
...
quoted
@@ -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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help