[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH 31/34] nfs: convert put_page() to put_user_page*()
- To: john.hubbard@xxxxxxxxx, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
- From: Calum Mackay <calum.mackay@xxxxxxxxxx>
- Date: Sat, 3 Aug 2019 02:27:55 +0100
- Cc: linux-fbdev@xxxxxxxxxxxxxxx, Jan Kara <jack@xxxxxxx>, kvm@xxxxxxxxxxxxxxx, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, Dave Chinner <david@xxxxxxxxxxxxx>, dri-devel@xxxxxxxxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, Ira Weiny <ira.weiny@xxxxxxxxx>, calum.mackay@xxxxxxxxxx, devel@xxxxxxxxxxxxxxxxxxxx, rds-devel@xxxxxxxxxxxxxx, linux-rdma@xxxxxxxxxxxxxxx, x86@xxxxxxxxxx, amd-gfx@xxxxxxxxxxxxxxxxxxxxx, Christoph Hellwig <hch@xxxxxxxxxxxxx>, Jason Gunthorpe <jgg@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, devel@xxxxxxxxxxxxxxxxxx, linux-media@xxxxxxxxxxxxxxx, John Hubbard <jhubbard@xxxxxxxxxx>, intel-gfx@xxxxxxxxxxxxxxxxxxxxx, Dan Williams <dan.j.williams@xxxxxxxxx>, linux-block@xxxxxxxxxxxxxxx, Jérôme Glisse <jglisse@xxxxxxxxxx>, linux-rpi-kernel@xxxxxxxxxxxxxxxxxxx, ceph-devel@xxxxxxxxxxxxxxx, Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx>, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-nfs@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, LKML <linux-kernel@xxxxxxxxxxxxxxx>, linux-xfs@xxxxxxxxxxxxxxx, linux-crypto@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, Anna Schumaker <anna.schumaker@xxxxxxxxxx>
- Delivery-date: Sat, 03 Aug 2019 04:51:14 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 02/08/2019 3:20 am, john.hubbard@xxxxxxxxx wrote:
From: John Hubbard <jhubbard@xxxxxxxxxx>
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 <trond.myklebust@xxxxxxxxxxxxxxx>
Cc: Anna Schumaker <anna.schumaker@xxxxxxxxxx>
Cc: linux-nfs@xxxxxxxxxxxxxxx
Signed-off-by: John Hubbard <jhubbard@xxxxxxxxxx>
---
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,
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|