Skip to content

Commit

Permalink
io_uring: don't duplicate io_req_task_queue()
Browse files Browse the repository at this point in the history
Don't hand code io_req_task_queue() inside of io_async_buf_func(), just
call it.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Pavel Begunkov authored and Jens Axboe committed Feb 12, 2021
1 parent 4e32635 commit 921b905
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -3494,7 +3494,6 @@ static int io_async_buf_func(struct wait_queue_entry *wait, unsigned mode,
struct wait_page_queue *wpq;
struct io_kiocb *req = wait->private;
struct wait_page_key *key = arg;
int ret;

wpq = container_of(wait, struct wait_page_queue, wait);

Expand All @@ -3504,14 +3503,9 @@ static int io_async_buf_func(struct wait_queue_entry *wait, unsigned mode,
req->rw.kiocb.ki_flags &= ~IOCB_WAITQ;
list_del_init(&wait->entry);

req->task_work.func = io_req_task_submit;
percpu_ref_get(&req->ctx->refs);

/* submit ref gets dropped, acquire a new one */
refcount_inc(&req->refs);
ret = io_req_task_work_add(req);
if (unlikely(ret))
io_req_task_work_add_fallback(req, io_req_task_cancel);
io_req_task_queue(req);
return 1;
}

Expand Down

0 comments on commit 921b905

Please sign in to comment.