Skip to content

Commit cd94903

Browse files
isilenceaxboe
authored andcommitted
io_uring: remove __io_fill_cqe() helper
In preparation for the following patch, inline __io_fill_cqe(), there is only one user. Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/71dab9afc3cde3f8b64d26f20d3b60bdc40726ff.1655287457.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent 2caf982 commit cd94903

File tree

1 file changed

+16
-21
lines changed

1 file changed

+16
-21
lines changed

fs/io_uring.c

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2447,26 +2447,6 @@ static bool io_cqring_event_overflow(struct io_ring_ctx *ctx, u64 user_data,
24472447
return true;
24482448
}
24492449

2450-
static inline bool __io_fill_cqe(struct io_ring_ctx *ctx, u64 user_data,
2451-
s32 res, u32 cflags)
2452-
{
2453-
struct io_uring_cqe *cqe;
2454-
2455-
/*
2456-
* If we can't get a cq entry, userspace overflowed the
2457-
* submission (by quite a lot). Increment the overflow count in
2458-
* the ring.
2459-
*/
2460-
cqe = io_get_cqe(ctx);
2461-
if (likely(cqe)) {
2462-
WRITE_ONCE(cqe->user_data, user_data);
2463-
WRITE_ONCE(cqe->res, res);
2464-
WRITE_ONCE(cqe->flags, cflags);
2465-
return true;
2466-
}
2467-
return io_cqring_event_overflow(ctx, user_data, res, cflags, 0, 0);
2468-
}
2469-
24702450
static inline bool __io_fill_cqe_req(struct io_ring_ctx *ctx,
24712451
struct io_kiocb *req)
24722452
{
@@ -2523,9 +2503,24 @@ static inline bool __io_fill_cqe_req(struct io_ring_ctx *ctx,
25232503
static noinline bool io_fill_cqe_aux(struct io_ring_ctx *ctx, u64 user_data,
25242504
s32 res, u32 cflags)
25252505
{
2506+
struct io_uring_cqe *cqe;
2507+
25262508
ctx->cq_extra++;
25272509
trace_io_uring_complete(ctx, NULL, user_data, res, cflags, 0, 0);
2528-
return __io_fill_cqe(ctx, user_data, res, cflags);
2510+
2511+
/*
2512+
* If we can't get a cq entry, userspace overflowed the
2513+
* submission (by quite a lot). Increment the overflow count in
2514+
* the ring.
2515+
*/
2516+
cqe = io_get_cqe(ctx);
2517+
if (likely(cqe)) {
2518+
WRITE_ONCE(cqe->user_data, user_data);
2519+
WRITE_ONCE(cqe->res, res);
2520+
WRITE_ONCE(cqe->flags, cflags);
2521+
return true;
2522+
}
2523+
return io_cqring_event_overflow(ctx, user_data, res, cflags, 0, 0);
25292524
}
25302525

25312526
static void __io_req_complete_put(struct io_kiocb *req)

0 commit comments

Comments
 (0)