mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
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: 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>
This commit is contained in:
parent
0ebc9a7ecf
commit
11fbada718
@ -55,7 +55,7 @@ int __io_account_mem(struct user_struct *user, unsigned long nr_pages)
|
|||||||
return 0;
|
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)
|
if (ctx->user)
|
||||||
__io_unaccount_mem(ctx->user, nr_pages);
|
__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);
|
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;
|
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_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 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,
|
static inline void __io_unaccount_mem(struct user_struct *user,
|
||||||
unsigned long nr_pages)
|
unsigned long nr_pages)
|
||||||
|
Loading…
Reference in New Issue
Block a user