mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 07:51:16 -04:00
io_uring: inline io_cqring_mark_overflow()
There is only one user of it and the name is misleading, get rid of it by inlining. By the way make overflow_flush's return value deduction simpler. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
committed by
Jens Axboe
parent
e23de15fdb
commit
09e88404f4
@@ -1708,15 +1708,6 @@ static void io_cqring_ev_posted(struct io_ring_ctx *ctx)
|
||||
eventfd_signal(ctx->cq_ev_fd, 1);
|
||||
}
|
||||
|
||||
static void io_cqring_mark_overflow(struct io_ring_ctx *ctx)
|
||||
{
|
||||
if (list_empty(&ctx->cq_overflow_list)) {
|
||||
clear_bit(0, &ctx->sq_check_overflow);
|
||||
clear_bit(0, &ctx->cq_check_overflow);
|
||||
ctx->rings->sq_flags &= ~IORING_SQ_CQ_OVERFLOW;
|
||||
}
|
||||
}
|
||||
|
||||
/* Returns true if there are no backlogged entries after the flush */
|
||||
static bool io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool force,
|
||||
struct task_struct *tsk,
|
||||
@@ -1726,13 +1717,13 @@ static bool io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool force,
|
||||
struct io_kiocb *req, *tmp;
|
||||
struct io_uring_cqe *cqe;
|
||||
unsigned long flags;
|
||||
bool all_flushed;
|
||||
LIST_HEAD(list);
|
||||
|
||||
if (!force && __io_cqring_events(ctx) == rings->cq_ring_entries)
|
||||
return false;
|
||||
|
||||
spin_lock_irqsave(&ctx->completion_lock, flags);
|
||||
cqe = NULL;
|
||||
list_for_each_entry_safe(req, tmp, &ctx->cq_overflow_list, compl.list) {
|
||||
if (!io_match_task(req, tsk, files))
|
||||
continue;
|
||||
@@ -1753,9 +1744,14 @@ static bool io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool force,
|
||||
}
|
||||
}
|
||||
|
||||
io_commit_cqring(ctx);
|
||||
io_cqring_mark_overflow(ctx);
|
||||
all_flushed = list_empty(&ctx->cq_overflow_list);
|
||||
if (all_flushed) {
|
||||
clear_bit(0, &ctx->sq_check_overflow);
|
||||
clear_bit(0, &ctx->cq_check_overflow);
|
||||
ctx->rings->sq_flags &= ~IORING_SQ_CQ_OVERFLOW;
|
||||
}
|
||||
|
||||
io_commit_cqring(ctx);
|
||||
spin_unlock_irqrestore(&ctx->completion_lock, flags);
|
||||
io_cqring_ev_posted(ctx);
|
||||
|
||||
@@ -1765,7 +1761,7 @@ static bool io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool force,
|
||||
io_put_req(req);
|
||||
}
|
||||
|
||||
return cqe != NULL;
|
||||
return all_flushed;
|
||||
}
|
||||
|
||||
static void __io_cqring_fill_event(struct io_kiocb *req, long res, long cflags)
|
||||
|
||||
Reference in New Issue
Block a user