Skip to content

Commit 00b0db5

Browse files
isilenceaxboe
authored andcommitted
io_uring: open code io_fill_cqe_req()
io_fill_cqe_req() is only called from one place, open code it, and rename __io_fill_cqe_req(). Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/f432ce75bb1c94cadf0bd2add4d6aa510bd1fb36.1691757663.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent b2e74db commit 00b0db5

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

io_uring/io_uring.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -978,8 +978,10 @@ static void __io_req_complete_post(struct io_kiocb *req, unsigned issue_flags)
978978
struct io_rsrc_node *rsrc_node = NULL;
979979

980980
io_cq_lock(ctx);
981-
if (!(req->flags & REQ_F_CQE_SKIP))
982-
io_fill_cqe_req(ctx, req);
981+
if (!(req->flags & REQ_F_CQE_SKIP)) {
982+
if (!io_fill_cqe_req(ctx, req))
983+
io_req_cqe_overflow(req);
984+
}
983985

984986
/*
985987
* If we're the last reference to this request, add to our locked
@@ -1556,7 +1558,7 @@ static void __io_submit_flush_completions(struct io_ring_ctx *ctx)
15561558
comp_list);
15571559

15581560
if (!(req->flags & REQ_F_CQE_SKIP) &&
1559-
unlikely(!__io_fill_cqe_req(ctx, req))) {
1561+
unlikely(!io_fill_cqe_req(ctx, req))) {
15601562
if (ctx->task_complete) {
15611563
spin_lock(&ctx->completion_lock);
15621564
io_req_cqe_overflow(req);

io_uring/io_uring.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ static inline struct io_uring_cqe *io_get_cqe(struct io_ring_ctx *ctx)
133133
return io_get_cqe_overflow(ctx, false);
134134
}
135135

136-
static inline bool __io_fill_cqe_req(struct io_ring_ctx *ctx,
137-
struct io_kiocb *req)
136+
static inline bool io_fill_cqe_req(struct io_ring_ctx *ctx, struct io_kiocb *req)
138137
{
139138
struct io_uring_cqe *cqe;
140139

@@ -168,14 +167,6 @@ static inline bool __io_fill_cqe_req(struct io_ring_ctx *ctx,
168167
return true;
169168
}
170169

171-
static inline bool io_fill_cqe_req(struct io_ring_ctx *ctx,
172-
struct io_kiocb *req)
173-
{
174-
if (likely(__io_fill_cqe_req(ctx, req)))
175-
return true;
176-
return io_req_cqe_overflow(req);
177-
}
178-
179170
static inline void req_set_fail(struct io_kiocb *req)
180171
{
181172
req->flags |= REQ_F_FAIL;

io_uring/rw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ int io_do_iopoll(struct io_ring_ctx *ctx, bool force_nonspin)
10641064
continue;
10651065

10661066
req->cqe.flags = io_put_kbuf(req, 0);
1067-
if (unlikely(!__io_fill_cqe_req(ctx, req))) {
1067+
if (unlikely(!io_fill_cqe_req(ctx, req))) {
10681068
spin_lock(&ctx->completion_lock);
10691069
io_req_cqe_overflow(req);
10701070
spin_unlock(&ctx->completion_lock);

0 commit comments

Comments
 (0)