Skip to content

Commit

Permalink
net/xdp: convert put_page() to put_user_page*()
Browse files Browse the repository at this point in the history
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 fc1d8e7 ("mm:
introduce put_user_page*(), placeholder versions").

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: John Hubbard <[email protected]>
Acked-by: Björn Töpel <[email protected]>
Cc: Björn Töpel <[email protected]>
Cc: Magnus Karlsson <[email protected]>
Cc: David S. Miller <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
johnhubbard authored and torvalds committed Sep 24, 2019
1 parent 6f553ce commit 1edc976
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions net/xdp/xdp_umem.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,7 @@ static int xdp_umem_map_pages(struct xdp_umem *umem)

static void xdp_umem_unpin_pages(struct xdp_umem *umem)
{
unsigned int i;

for (i = 0; i < umem->npgs; i++) {
struct page *page = umem->pgs[i];

set_page_dirty_lock(page);
put_page(page);
}
put_user_pages_dirty_lock(umem->pgs, umem->npgs, true);

kfree(umem->pgs);
umem->pgs = NULL;
Expand Down

0 comments on commit 1edc976

Please sign in to comment.