Skip to content

Commit eef51da

Browse files
isilenceaxboe
authored andcommitted
io_uring: rename function *task_file
What at some moment was references to struct file used to control lifetimes of task/ctx is now just internal tctx structures/nodes, so rename outdated *task_file() routines into something more sensible. Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/e2fbce42932154c2631ce58ffbffaa232afe18d5.1623634181.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent cb3d897 commit eef51da

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

fs/io_uring.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ static const struct io_op_def io_op_defs[] = {
10291029
};
10301030

10311031
static bool io_disarm_next(struct io_kiocb *req);
1032-
static void io_uring_del_task_file(unsigned long index);
1032+
static void io_uring_del_tctx_node(unsigned long index);
10331033
static void io_uring_try_cancel_requests(struct io_ring_ctx *ctx,
10341034
struct task_struct *task,
10351035
bool cancel_all);
@@ -8714,7 +8714,7 @@ static void io_tctx_exit_cb(struct callback_head *cb)
87148714
* node. It'll be removed by the end of cancellation, just ignore it.
87158715
*/
87168716
if (!atomic_read(&tctx->in_idle))
8717-
io_uring_del_task_file((unsigned long)work->ctx);
8717+
io_uring_del_tctx_node((unsigned long)work->ctx);
87188718
complete(&work->completion);
87198719
}
87208720

@@ -8967,7 +8967,7 @@ static void io_uring_try_cancel_requests(struct io_ring_ctx *ctx,
89678967
}
89688968
}
89698969

8970-
static int __io_uring_add_task_file(struct io_ring_ctx *ctx)
8970+
static int __io_uring_add_tctx_node(struct io_ring_ctx *ctx)
89718971
{
89728972
struct io_uring_task *tctx = current->io_uring;
89738973
struct io_tctx_node *node;
@@ -9004,19 +9004,19 @@ static int __io_uring_add_task_file(struct io_ring_ctx *ctx)
90049004
/*
90059005
* Note that this task has used io_uring. We use it for cancelation purposes.
90069006
*/
9007-
static inline int io_uring_add_task_file(struct io_ring_ctx *ctx)
9007+
static inline int io_uring_add_tctx_node(struct io_ring_ctx *ctx)
90089008
{
90099009
struct io_uring_task *tctx = current->io_uring;
90109010

90119011
if (likely(tctx && tctx->last == ctx))
90129012
return 0;
9013-
return __io_uring_add_task_file(ctx);
9013+
return __io_uring_add_tctx_node(ctx);
90149014
}
90159015

90169016
/*
90179017
* Remove this io_uring_file -> task mapping.
90189018
*/
9019-
static void io_uring_del_task_file(unsigned long index)
9019+
static void io_uring_del_tctx_node(unsigned long index)
90209020
{
90219021
struct io_uring_task *tctx = current->io_uring;
90229022
struct io_tctx_node *node;
@@ -9046,7 +9046,7 @@ static void io_uring_clean_tctx(struct io_uring_task *tctx)
90469046
unsigned long index;
90479047

90489048
xa_for_each(&tctx->xa, index, node)
9049-
io_uring_del_task_file(index);
9049+
io_uring_del_tctx_node(index);
90509050
if (wq) {
90519051
/*
90529052
* Must be after io_uring_del_task_file() (removes nodes under
@@ -9330,7 +9330,7 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit,
93309330
}
93319331
submitted = to_submit;
93329332
} else if (to_submit) {
9333-
ret = io_uring_add_task_file(ctx);
9333+
ret = io_uring_add_tctx_node(ctx);
93349334
if (unlikely(ret))
93359335
goto out;
93369336
mutex_lock(&ctx->uring_lock);
@@ -9540,7 +9540,7 @@ static int io_uring_install_fd(struct io_ring_ctx *ctx, struct file *file)
95409540
if (fd < 0)
95419541
return fd;
95429542

9543-
ret = io_uring_add_task_file(ctx);
9543+
ret = io_uring_add_tctx_node(ctx);
95449544
if (ret) {
95459545
put_unused_fd(fd);
95469546
return ret;

0 commit comments

Comments
 (0)