summaryrefslogtreecommitdiff
path: root/io_uring/io_uring.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2024-03-13 15:01:03 -0600
committerJens Axboe <axboe@kernel.dk>2024-04-15 08:10:26 -0600
commit18595c0a58ae29ac6a996c5b664610119b73182d (patch)
tree6add63bea7134e2584d1843b3fefbc49440e040e /io_uring/io_uring.c
parent87585b05757dc70545efb434669708d276125559 (diff)
downloadlwn-18595c0a58ae29ac6a996c5b664610119b73182d.tar.gz
lwn-18595c0a58ae29ac6a996c5b664610119b73182d.zip
io_uring: use unpin_user_pages() where appropriate
There are a few cases of open-rolled loops around unpin_user_page(), use the generic helper instead. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/io_uring.c')
-rw-r--r--io_uring/io_uring.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 50e859da59e1..37066ea98f0b 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -2630,13 +2630,11 @@ void io_pages_unmap(void *ptr, struct page ***pages, unsigned short *npages,
static void io_pages_free(struct page ***pages, int npages)
{
struct page **page_array = *pages;
- int i;
if (!page_array)
return;
- for (i = 0; i < npages; i++)
- unpin_user_page(page_array[i]);
+ unpin_user_pages(page_array, npages);
kvfree(page_array);
*pages = NULL;
}