Merge these functions that have the same logic Signed-off-by: Dylan Yudaken <dylany@xxxxxxxx> --- io_uring/io_uring.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 2260fb7aa7f2..e40d7b3404eb 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -1223,15 +1223,18 @@ int io_run_local_work(struct io_ring_ctx *ctx) return ret; } -static void io_req_tw_post(struct io_kiocb *req, bool *locked) +void io_req_task_complete(struct io_kiocb *req, bool *locked) { - io_req_complete_post(req); + if (*locked) + io_req_complete_defer(req); + else + io_req_complete_post(req); } void io_req_tw_post_queue(struct io_kiocb *req, s32 res, u32 cflags) { io_req_set_res(req, res, cflags); - req->io_task_work.func = io_req_tw_post; + req->io_task_work.func = io_req_task_complete; io_req_task_work_add(req); } @@ -1460,14 +1463,6 @@ static int io_iopoll_check(struct io_ring_ctx *ctx, long min) return ret; } -void io_req_task_complete(struct io_kiocb *req, bool *locked) -{ - if (*locked) - io_req_complete_defer(req); - else - io_req_complete_post(req); -} - /* * After the iocb has been issued, it's safe to be found on the poll list. * Adding the kiocb to the list AFTER submission ensures that we don't -- 2.30.2