Skip to content

Commit 4f793dc

Browse files
isilenceaxboe
authored andcommitted
io_uring: inline io_uring_attempt_task_drop()
A simple preparation change inlining io_uring_attempt_task_drop() into io_uring_flush(). Signed-off-by: Pavel Begunkov <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 55e6ac1 commit 4f793dc

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

fs/io_uring.c

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8964,23 +8964,6 @@ static void io_uring_del_task_file(struct file *file)
89648964
fput(file);
89658965
}
89668966

8967-
/*
8968-
* Drop task note for this file if we're the only ones that hold it after
8969-
* pending fput()
8970-
*/
8971-
static void io_uring_attempt_task_drop(struct file *file)
8972-
{
8973-
if (!current->io_uring)
8974-
return;
8975-
/*
8976-
* fput() is pending, will be 2 if the only other ref is our potential
8977-
* task file note. If the task is exiting, drop regardless of count.
8978-
*/
8979-
if (fatal_signal_pending(current) || (current->flags & PF_EXITING) ||
8980-
atomic_long_read(&file->f_count) == 2)
8981-
io_uring_del_task_file(file);
8982-
}
8983-
89848967
static void io_uring_remove_task_files(struct io_uring_task *tctx)
89858968
{
89868969
struct file *file;
@@ -9072,7 +9055,17 @@ void __io_uring_task_cancel(void)
90729055

90739056
static int io_uring_flush(struct file *file, void *data)
90749057
{
9075-
io_uring_attempt_task_drop(file);
9058+
if (!current->io_uring)
9059+
return 0;
9060+
9061+
/*
9062+
* fput() is pending, will be 2 if the only other ref is our potential
9063+
* task file note. If the task is exiting, drop regardless of count.
9064+
*/
9065+
if (fatal_signal_pending(current) || (current->flags & PF_EXITING) ||
9066+
atomic_long_read(&file->f_count) == 2)
9067+
io_uring_del_task_file(file);
9068+
90769069
return 0;
90779070
}
90789071

0 commit comments

Comments
 (0)