From 9eca18f0e902d5fa009dec2867548af6ee5b1da8 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 22 Jun 2020 09:29:15 -0600 Subject: [PATCH 2/5] io_uring: add 'comp_list' to io_submit_state No functional changes in this patch, just in preparation for passing back pending completions to the caller. Signed-off-by: Jens Axboe --- fs/io_uring.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 0cdf088c56cd..bea72642a576 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -681,6 +681,9 @@ struct io_kiocb { struct io_submit_state { struct blk_plug plug; + struct list_head comp_list; + struct io_ring_ctx *ctx; + /* * io_kiocb alloc cache */ @@ -5999,12 +6002,14 @@ static void io_submit_state_end(struct io_submit_state *state) * Start submission side cache. */ static void io_submit_state_start(struct io_submit_state *state, - unsigned int max_ios) + struct io_ring_ctx *ctx, unsigned int max_ios) { blk_start_plug(&state->plug); #ifdef CONFIG_BLOCK state->plug.nowait = true; #endif + INIT_LIST_HEAD(&state->comp_list); + state->ctx = ctx; state->free_reqs = 0; state->file = NULL; state->ios_left = max_ios; @@ -6139,7 +6144,7 @@ static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr, if (!percpu_ref_tryget_many(&ctx->refs, nr)) return -EAGAIN; - io_submit_state_start(&state, nr); + io_submit_state_start(&state, ctx, nr); ctx->ring_fd = ring_fd; ctx->ring_file = ring_file; -- 2.27.0