mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 13:41:51 +00:00
e70cb60893
Make io_put_task() available to non-core parts of io_uring, we'll need it for notification infrastructure. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/3686807d4c03b72e389947b0e8692d4d44334ef0.1657643355.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
32 lines
934 B
C
32 lines
934 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
struct io_tctx_node {
|
|
struct list_head ctx_node;
|
|
struct task_struct *task;
|
|
struct io_ring_ctx *ctx;
|
|
};
|
|
|
|
int io_uring_alloc_task_context(struct task_struct *task,
|
|
struct io_ring_ctx *ctx);
|
|
void io_uring_del_tctx_node(unsigned long index);
|
|
int __io_uring_add_tctx_node(struct io_ring_ctx *ctx, bool submitter);
|
|
void io_uring_clean_tctx(struct io_uring_task *tctx);
|
|
|
|
void io_uring_unreg_ringfd(void);
|
|
int io_ringfd_register(struct io_ring_ctx *ctx, void __user *__arg,
|
|
unsigned nr_args);
|
|
int io_ringfd_unregister(struct io_ring_ctx *ctx, void __user *__arg,
|
|
unsigned nr_args);
|
|
|
|
/*
|
|
* Note that this task has used io_uring. We use it for cancelation purposes.
|
|
*/
|
|
static inline int io_uring_add_tctx_node(struct io_ring_ctx *ctx)
|
|
{
|
|
struct io_uring_task *tctx = current->io_uring;
|
|
|
|
if (likely(tctx && tctx->last == ctx))
|
|
return 0;
|
|
return __io_uring_add_tctx_node(ctx, true);
|
|
}
|