mirror of
https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10.git
synced 2026-09-09 00:07:04 +08:00
io_uring: export io_[un]account_mem
JIRA: https://issues.redhat.com/browse/RHEL-140845 commit 11fbada7184f9e19bcdfa2f6b15828a78b8897a6 Author: Pavel Begunkov <asml.silence@gmail.com> Date: Wed Jul 16 22:04:08 2025 +0100 io_uring: export io_[un]account_mem Export pinned memory accounting helpers, they'll be used by zcrx shortly. Cc: stable@vger.kernel.org Fixes: cf96310c5f9a0 ("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: Jeff Moyer <jmoyer@redhat.com>
This commit is contained in:
+2
-2
@@ -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;
|
||||
|
||||
|
||||
@@ -144,6 +144,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