Skip to content

Commit

Permalink
io_uring: remove 'ev_flags' argument
Browse files Browse the repository at this point in the history
We always pass in 0 for the cqe flags argument, since the support for
"this read hit page cache" hint was dropped.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Jens Axboe committed May 15, 2019
1 parent 44a9bd1 commit c71ffb6
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ static struct io_uring_cqe *io_get_cqring(struct io_ring_ctx *ctx)
}

static void io_cqring_fill_event(struct io_ring_ctx *ctx, u64 ki_user_data,
long res, unsigned ev_flags)
long res)
{
struct io_uring_cqe *cqe;

Expand All @@ -502,7 +502,7 @@ static void io_cqring_fill_event(struct io_ring_ctx *ctx, u64 ki_user_data,
if (cqe) {
WRITE_ONCE(cqe->user_data, ki_user_data);
WRITE_ONCE(cqe->res, res);
WRITE_ONCE(cqe->flags, ev_flags);
WRITE_ONCE(cqe->flags, 0);
} else {
unsigned overflow = READ_ONCE(ctx->cq_ring->overflow);

Expand All @@ -521,12 +521,12 @@ static void io_cqring_ev_posted(struct io_ring_ctx *ctx)
}

static void io_cqring_add_event(struct io_ring_ctx *ctx, u64 user_data,
long res, unsigned ev_flags)
long res)
{
unsigned long flags;

spin_lock_irqsave(&ctx->completion_lock, flags);
io_cqring_fill_event(ctx, user_data, res, ev_flags);
io_cqring_fill_event(ctx, user_data, res);
io_commit_cqring(ctx);
spin_unlock_irqrestore(&ctx->completion_lock, flags);

Expand Down Expand Up @@ -628,7 +628,7 @@ static void io_iopoll_complete(struct io_ring_ctx *ctx, unsigned int *nr_events,
req = list_first_entry(done, struct io_kiocb, list);
list_del(&req->list);

io_cqring_fill_event(ctx, req->user_data, req->error, 0);
io_cqring_fill_event(ctx, req->user_data, req->error);
(*nr_events)++;

if (refcount_dec_and_test(&req->refs)) {
Expand Down Expand Up @@ -776,7 +776,7 @@ static void io_complete_rw(struct kiocb *kiocb, long res, long res2)

kiocb_end_write(kiocb);

io_cqring_add_event(req->ctx, req->user_data, res, 0);
io_cqring_add_event(req->ctx, req->user_data, res);
io_put_req(req);
}

Expand Down Expand Up @@ -1211,7 +1211,7 @@ static int io_nop(struct io_kiocb *req, u64 user_data)
if (unlikely(ctx->flags & IORING_SETUP_IOPOLL))
return -EINVAL;

io_cqring_add_event(ctx, user_data, err, 0);
io_cqring_add_event(ctx, user_data, err);
io_put_req(req);
return 0;
}
Expand Down Expand Up @@ -1256,7 +1256,7 @@ static int io_fsync(struct io_kiocb *req, const struct io_uring_sqe *sqe,
end > 0 ? end : LLONG_MAX,
fsync_flags & IORING_FSYNC_DATASYNC);

io_cqring_add_event(req->ctx, sqe->user_data, ret, 0);
io_cqring_add_event(req->ctx, sqe->user_data, ret);
io_put_req(req);
return 0;
}
Expand Down Expand Up @@ -1300,7 +1300,7 @@ static int io_sync_file_range(struct io_kiocb *req,

ret = sync_file_range(req->rw.ki_filp, sqe_off, sqe_len, flags);

io_cqring_add_event(req->ctx, sqe->user_data, ret, 0);
io_cqring_add_event(req->ctx, sqe->user_data, ret);
io_put_req(req);
return 0;
}
Expand Down Expand Up @@ -1358,7 +1358,7 @@ static int io_poll_remove(struct io_kiocb *req, const struct io_uring_sqe *sqe)
}
spin_unlock_irq(&ctx->completion_lock);

io_cqring_add_event(req->ctx, sqe->user_data, ret, 0);
io_cqring_add_event(req->ctx, sqe->user_data, ret);
io_put_req(req);
return 0;
}
Expand All @@ -1367,7 +1367,7 @@ static void io_poll_complete(struct io_ring_ctx *ctx, struct io_kiocb *req,
__poll_t mask)
{
req->poll.done = true;
io_cqring_fill_event(ctx, req->user_data, mangle_poll(mask), 0);
io_cqring_fill_event(ctx, req->user_data, mangle_poll(mask));
io_commit_cqring(ctx);
}

Expand Down Expand Up @@ -1687,7 +1687,7 @@ static void io_sq_wq_submit_work(struct work_struct *work)
io_put_req(req);

if (ret) {
io_cqring_add_event(ctx, sqe->user_data, ret, 0);
io_cqring_add_event(ctx, sqe->user_data, ret);
io_put_req(req);
}

Expand Down Expand Up @@ -1992,7 +1992,7 @@ static int io_submit_sqes(struct io_ring_ctx *ctx, struct sqe_submit *sqes,
continue;
}

io_cqring_add_event(ctx, sqes[i].sqe->user_data, ret, 0);
io_cqring_add_event(ctx, sqes[i].sqe->user_data, ret);
}

if (statep)
Expand Down Expand Up @@ -2157,7 +2157,7 @@ static int io_ring_submit(struct io_ring_ctx *ctx, unsigned int to_submit)

ret = io_submit_sqe(ctx, &s, statep);
if (ret)
io_cqring_add_event(ctx, s.sqe->user_data, ret, 0);
io_cqring_add_event(ctx, s.sqe->user_data, ret);
}
io_commit_sqring(ctx);

Expand Down

0 comments on commit c71ffb6

Please sign in to comment.