Skip to content

Commit 3b7a612

Browse files
isilenceaxboe
authored andcommitted
io_uring: inline io_dismantle_req()
io_dismantle_req() is only used in __io_req_complete_post(), open code it there. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/ba8f20cb2c914eefa2e7d120a104a198552050db.1687518903.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 6ec9afc commit 3b7a612

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

io_uring/io_uring.c

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ static bool io_uring_try_cancel_requests(struct io_ring_ctx *ctx,
146146
struct task_struct *task,
147147
bool cancel_all);
148148

149-
static void io_dismantle_req(struct io_kiocb *req);
150149
static void io_clean_op(struct io_kiocb *req);
151150
static void io_queue_sqe(struct io_kiocb *req);
152151
static void io_move_task_work_from_local(struct io_ring_ctx *ctx);
@@ -991,7 +990,11 @@ static void __io_req_complete_post(struct io_kiocb *req, unsigned issue_flags)
991990
}
992991
}
993992
io_put_kbuf_comp(req);
994-
io_dismantle_req(req);
993+
if (unlikely(req->flags & IO_REQ_CLEAN_FLAGS))
994+
io_clean_op(req);
995+
if (!(req->flags & REQ_F_FIXED_FILE))
996+
io_put_file(req->file);
997+
995998
rsrc_node = req->rsrc_node;
996999
/*
9971000
* Selected buffer deallocation in io_clean_op() assumes that
@@ -1111,16 +1114,6 @@ __cold bool __io_alloc_req_refill(struct io_ring_ctx *ctx)
11111114
return true;
11121115
}
11131116

1114-
static inline void io_dismantle_req(struct io_kiocb *req)
1115-
{
1116-
unsigned int flags = req->flags;
1117-
1118-
if (unlikely(flags & IO_REQ_CLEAN_FLAGS))
1119-
io_clean_op(req);
1120-
if (!(flags & REQ_F_FIXED_FILE))
1121-
io_put_file(req->file);
1122-
}
1123-
11241117
__cold void io_free_req(struct io_kiocb *req)
11251118
{
11261119
/* refs were already put, restore them for io_req_task_complete() */

0 commit comments

Comments
 (0)