mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
io_uring: export io_[un]account_mem
commit11fbada718upstream. Export pinned memory accounting helpers, they'll be used by zcrx shortly. Cc: stable@vger.kernel.org Fixes:cf96310c5f("io_uring/zcrx: add io_zcrx_area") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/9a61e54bd89289b39570ae02fe620e12487439e4.1752699568.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9c0b451627
commit
6ced80a09b
@@ -55,7 +55,7 @@ int __io_account_mem(struct user_struct *user, unsigned long nr_pages)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void io_unaccount_mem(struct io_ring_ctx *ctx, unsigned long nr_pages)
|
||||
void io_unaccount_mem(struct io_ring_ctx *ctx, unsigned long nr_pages)
|
||||
{
|
||||
if (ctx->user)
|
||||
__io_unaccount_mem(ctx->user, nr_pages);
|
||||
@@ -64,7 +64,7 @@ static void io_unaccount_mem(struct io_ring_ctx *ctx, unsigned long nr_pages)
|
||||
atomic64_sub(nr_pages, &ctx->mm_account->pinned_vm);
|
||||
}
|
||||
|
||||
static int io_account_mem(struct io_ring_ctx *ctx, unsigned long nr_pages)
|
||||
int io_account_mem(struct io_ring_ctx *ctx, unsigned long nr_pages)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
||||
@@ -120,6 +120,8 @@ int io_files_update(struct io_kiocb *req, unsigned int issue_flags);
|
||||
int io_files_update_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
|
||||
|
||||
int __io_account_mem(struct user_struct *user, unsigned long nr_pages);
|
||||
int io_account_mem(struct io_ring_ctx *ctx, unsigned long nr_pages);
|
||||
void io_unaccount_mem(struct io_ring_ctx *ctx, unsigned long nr_pages);
|
||||
|
||||
static inline void __io_unaccount_mem(struct user_struct *user,
|
||||
unsigned long nr_pages)
|
||||
|
||||
Reference in New Issue
Block a user