Commit 27c4d3a3 authored by John Hubbard's avatar John Hubbard Committed by Jens Axboe

fs/io_uring.c: 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 commit fc1d8e7c
("mm: introduce put_user_page*(), placeholder versions").

Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-block@vger.kernel.org
Signed-off-by: default avatarJohn Hubbard <jhubbard@nvidia.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent a55aa89a
...@@ -2845,7 +2845,7 @@ static int io_sqe_buffer_unregister(struct io_ring_ctx *ctx) ...@@ -2845,7 +2845,7 @@ static int io_sqe_buffer_unregister(struct io_ring_ctx *ctx)
struct io_mapped_ubuf *imu = &ctx->user_bufs[i]; struct io_mapped_ubuf *imu = &ctx->user_bufs[i];
for (j = 0; j < imu->nr_bvecs; j++) for (j = 0; j < imu->nr_bvecs; j++)
put_page(imu->bvec[j].bv_page); put_user_page(imu->bvec[j].bv_page);
if (ctx->account_mem) if (ctx->account_mem)
io_unaccount_mem(ctx->user, imu->nr_bvecs); io_unaccount_mem(ctx->user, imu->nr_bvecs);
...@@ -2989,10 +2989,8 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, void __user *arg, ...@@ -2989,10 +2989,8 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, void __user *arg,
* if we did partial map, or found file backed vmas, * if we did partial map, or found file backed vmas,
* release any pages we did get * release any pages we did get
*/ */
if (pret > 0) { if (pret > 0)
for (j = 0; j < pret; j++) put_user_pages(pages, pret);
put_page(pages[j]);
}
if (ctx->account_mem) if (ctx->account_mem)
io_unaccount_mem(ctx->user, nr_pages); io_unaccount_mem(ctx->user, nr_pages);
kvfree(imu->bvec); kvfree(imu->bvec);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment