mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-12 08:09:56 +00:00
staging: gasket: Convert get_user_pages*() --> pin_user_pages*()
In 2019, we introduced pin_user_pages*() and now we are converting get_user_pages*() to the new API as appropriate. [1] & [2] could be referred for more information. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/ Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com> Acked-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: John Hubbard <jhubbard@nvidia.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/1592361930-3813-1-git-send-email-jrdr.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
98fe05e21a
commit
5631feed39
@ -449,7 +449,7 @@ static bool gasket_release_page(struct page *page)
|
|||||||
|
|
||||||
if (!PageReserved(page))
|
if (!PageReserved(page))
|
||||||
SetPageDirty(page);
|
SetPageDirty(page);
|
||||||
put_page(page);
|
unpin_user_page(page);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -486,12 +486,12 @@ static int gasket_perform_mapping(struct gasket_page_table *pg_tbl,
|
|||||||
ptes[i].dma_addr = pg_tbl->coherent_pages[0].paddr +
|
ptes[i].dma_addr = pg_tbl->coherent_pages[0].paddr +
|
||||||
off + i * PAGE_SIZE;
|
off + i * PAGE_SIZE;
|
||||||
} else {
|
} else {
|
||||||
ret = get_user_pages_fast(page_addr - offset, 1,
|
ret = pin_user_pages_fast(page_addr - offset, 1,
|
||||||
FOLL_WRITE, &page);
|
FOLL_WRITE, &page);
|
||||||
|
|
||||||
if (ret <= 0) {
|
if (ret <= 0) {
|
||||||
dev_err(pg_tbl->device,
|
dev_err(pg_tbl->device,
|
||||||
"get user pages failed for addr=0x%lx, offset=0x%lx [ret=%d]\n",
|
"pin user pages failed for addr=0x%lx, offset=0x%lx [ret=%d]\n",
|
||||||
page_addr, offset, ret);
|
page_addr, offset, ret);
|
||||||
return ret ? ret : -ENOMEM;
|
return ret ? ret : -ENOMEM;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user