diff options
author | John Hubbard <jhubbard@nvidia.com> | 2019-09-23 18:35:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-24 18:54:08 -0400 |
commit | 1edc97694d0fa95d143e3457be892544e41f794a (patch) | |
tree | be4c382d4280ad8289d704030ac8b8878e531d41 | |
parent | 6f553ce498a72d91c1c9361fd49bcf07e17c9703 (diff) |
net/xdp: convert put_page() to put_user_page*()
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 fc1d8e7cca2d ("mm:
introduce put_user_page*(), placeholder versions").
Link: http://lkml.kernel.org/r/20190724044537.10458-4-jhubbard@nvidia.com
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Acked-by: Björn Töpel <bjorn.topel@intel.com>
Cc: Björn Töpel <bjorn.topel@intel.com>
Cc: Magnus Karlsson <magnus.karlsson@intel.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | net/xdp/xdp_umem.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c index 947b8ff0227e..bba3104f128f 100644 --- a/net/xdp/xdp_umem.c +++ b/net/xdp/xdp_umem.c | |||
@@ -206,14 +206,7 @@ static int xdp_umem_map_pages(struct xdp_umem *umem) | |||
206 | 206 | ||
207 | static void xdp_umem_unpin_pages(struct xdp_umem *umem) | 207 | static void xdp_umem_unpin_pages(struct xdp_umem *umem) |
208 | { | 208 | { |
209 | unsigned int i; | 209 | put_user_pages_dirty_lock(umem->pgs, umem->npgs, true); |
210 | |||
211 | for (i = 0; i < umem->npgs; i++) { | ||
212 | struct page *page = umem->pgs[i]; | ||
213 | |||
214 | set_page_dirty_lock(page); | ||
215 | put_page(page); | ||
216 | } | ||
217 | 210 | ||
218 | kfree(umem->pgs); | 211 | kfree(umem->pgs); |
219 | umem->pgs = NULL; | 212 | umem->pgs = NULL; |