Thread (66 messages) 66 messages, 13 authors, 2019-08-09

Re: [PATCH 31/34] nfs: convert put_page() to put_user_page*()

From: Calum Mackay <hidden>
Date: 2019-08-03 01:33:47
Also in: amd-gfx, ceph-devel, dri-devel, intel-gfx, kvm, linux-block, linux-crypto, linux-fbdev, linux-fsdevel, linux-media, linux-mm, linux-nfs, linux-rdma, linux-xfs, lkml, netdev, sparclinux, xen-devel

On 02/08/2019 3:20 am, john.hubbard@gmail.com wrote:
quoted hunk ↗ jump to hunk
From: John Hubbard <jhubbard@nvidia.com>

For pages that were retained via get_user_pages*(), release those pages
via the new put_user_page*() routines, instead of via put_page() or
release_pages().

This is part a tree-wide conversion, as described in commit fc1d8e7cca2d
("mm: introduce put_user_page*(), placeholder versions").

Cc: Trond Myklebust <redacted>
Cc: Anna Schumaker <redacted>
Cc: linux-nfs@vger.kernel.org
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
  fs/nfs/direct.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 0cb442406168..b00b89dda3c5 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -278,9 +278,7 @@ ssize_t nfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
  
  static void nfs_direct_release_pages(struct page **pages, unsigned int npages)
  {
-	unsigned int i;
-	for (i = 0; i < npages; i++)
-		put_page(pages[i]);
+	put_user_pages(pages, npages);
  }
Since it's static, and only called twice, might it be better to change 
its two callers [nfs_direct_{read,write}_schedule_iovec()] to call 
put_user_pages() directly, and remove nfs_direct_release_pages() entirely?

thanks,
calum.

  
  void nfs_init_cinfo_from_dreq(struct nfs_commit_info *cinfo,
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help