Skip to content

Commit

Permalink
io_uring: remove extra argument for overflow flush
Browse files Browse the repository at this point in the history
Unlike __io_cqring_overflow_flush(), nobody does forced flushing with
io_cqring_overflow_flush(), so removed the argument from it.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/7594f869ca41b7cfb5a35a3c7c2d402242834e9e.1628536684.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Pavel Begunkov authored and Jens Axboe committed Aug 23, 2021
1 parent cd0ca2e commit 90f6736
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -1523,15 +1523,15 @@ static bool __io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool force)
return all_flushed;
}

static bool io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool force)
static bool io_cqring_overflow_flush(struct io_ring_ctx *ctx)
{
bool ret = true;

if (test_bit(0, &ctx->check_cq_overflow)) {
/* iopoll syncs against uring_lock, not completion_lock */
if (ctx->flags & IORING_SETUP_IOPOLL)
mutex_lock(&ctx->uring_lock);
ret = __io_cqring_overflow_flush(ctx, force);
ret = __io_cqring_overflow_flush(ctx, false);
if (ctx->flags & IORING_SETUP_IOPOLL)
mutex_unlock(&ctx->uring_lock);
}
Expand Down Expand Up @@ -7058,7 +7058,7 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events,
int ret;

do {
io_cqring_overflow_flush(ctx, false);
io_cqring_overflow_flush(ctx);
if (io_cqring_events(ctx) >= min_events)
return 0;
if (!io_run_task_work())
Expand Down Expand Up @@ -7096,7 +7096,7 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events,
trace_io_uring_cqring_wait(ctx, min_events);
do {
/* if we can't even flush overflow, don't wait for more */
if (!io_cqring_overflow_flush(ctx, false)) {
if (!io_cqring_overflow_flush(ctx)) {
ret = -EBUSY;
break;
}
Expand Down Expand Up @@ -9365,7 +9365,7 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit,
*/
ret = 0;
if (ctx->flags & IORING_SETUP_SQPOLL) {
io_cqring_overflow_flush(ctx, false);
io_cqring_overflow_flush(ctx);

if (unlikely(ctx->sq_data->thread == NULL)) {
ret = -EOWNERDEAD;
Expand Down

0 comments on commit 90f6736

Please sign in to comment.