Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp141825pxb; Mon, 13 Sep 2021 15:19:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwf6qMaLvjMbVoz20VEbEp+UKRvvqTOT1KvnUIExZz2DgOuvOn5+dg9YjgbdSeUJ7P6KCIg X-Received: by 2002:aa7:cf15:: with SMTP id a21mr15550084edy.152.1631571564223; Mon, 13 Sep 2021 15:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631571564; cv=none; d=google.com; s=arc-20160816; b=uLMyXOF34EdQRIy9Zg1t1wdnngvnNUcLe4dLs+LxkJWf7d41sis3y/UmEHW5P5KbiG AfxPIRlbdUz7K5U9wZW/iRn28EXvRjmTUrBRLEXS4xnkqQwulUsdTadNDmedOAjUN5Ul gCacZvDzU7ibT3pXf9LKzsxs5f0JeO2tqp8Zfu7ZHDLimrnb1nwyFQojsVCbl1l2pUzw Nl4QUskNb6NwsH9TkJtDYLEZN/3ETsqAUZswKrtAgYcC50rhDPuJFJ2919jBCYg3PTbi VEMIIAVDd0DvaH9XQUTeDVRpid6JooGOqIfM42gx06tetf+6kr3IMrUFdz/o1vpAimaJ sHQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ix4cxEV7F1kzbNGlEYvVGxqhjYZvjLp+lLGzE6VHPJ4=; b=0r3KZ4+GGL2QiEEjDPRLU2naLftk69O60TCjViT61b3BIenw8ayJTUx8f9jymO9Vfb 3rn+5kjoh6g59fzt0oRa1Mf9cx6OtQq6Mr3yBwMuVClixx9Ewiuceu/FFdIVbJH5BY70 Gm/XtYv3pACioHZe4mIpqvaNNVwhOEJJCCii5Iu9ZJTmEczJhqbIzmiw1Ya1pXIdWhpV iVnK5r8YaFjYr/6vj/kSSCfiK7dLxxtAHYdd7alRAoNKaLknoiNxRDj8FLcGzNGVsKnr 3x8cdYiKQ9+ncWJ7VuNGBFV/ZztQdekIDwiUPlxNnPOUqBd93PF6h9/gXDHBQWTeBXxn AdAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t2TN7Qz2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e10si11734478edj.362.2021.09.13.15.18.42; Mon, 13 Sep 2021 15:19:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t2TN7Qz2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244945AbhIMN6q (ORCPT + 99 others); Mon, 13 Sep 2021 09:58:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:44092 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343576AbhIMNzl (ORCPT ); Mon, 13 Sep 2021 09:55:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EF011619EB; Mon, 13 Sep 2021 13:35:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631540146; bh=x3XOocFDJPhRSKyMfbyzMZzhWlVTXE03mZE2SOQXT6I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t2TN7Qz2mdRaZUzGd3o5PaSBmFJ7Plx0STs6tAOK0MAmacaqHH4YmKjm3PCIOHckT Al2CrsSmybdQ6bkB0kmDekamdnuyHm9swFXVcNi88G1aCF96MEi23kTumEchi97I7f DuKrE41XGc9zzfwdyvpH4qUt8wC/uwEPPALK4Ho8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Begunkov , Jens Axboe , Sasha Levin Subject: [PATCH 5.13 071/300] io_uring: refactor io_submit_flush_completions() Date: Mon, 13 Sep 2021 15:12:12 +0200 Message-Id: <20210913131111.752783774@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131109.253835823@linuxfoundation.org> References: <20210913131109.253835823@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Begunkov [ Upstream commit 2a2758f26df519fab011f49d53440382dda8e1a5 ] struct io_comp_state is always contained in struct io_ring_ctx, don't pass them into io_submit_flush_completions() separately, it makes the interface cleaner and simplifies it for the compiler. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/44d6ca57003a82484338e95197024dbd65a1b376.1623949695.git.asml.silence@gmail.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- fs/io_uring.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index f6ddc7182943..788ba4f3730f 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -1060,8 +1060,7 @@ static void __io_queue_sqe(struct io_kiocb *req); static void io_rsrc_put_work(struct work_struct *work); static void io_req_task_queue(struct io_kiocb *req); -static void io_submit_flush_completions(struct io_comp_state *cs, - struct io_ring_ctx *ctx); +static void io_submit_flush_completions(struct io_ring_ctx *ctx); static bool io_poll_remove_waitqs(struct io_kiocb *req); static int io_req_prep_async(struct io_kiocb *req); @@ -1901,7 +1900,7 @@ static void ctx_flush_and_put(struct io_ring_ctx *ctx) return; if (ctx->submit_state.comp.nr) { mutex_lock(&ctx->uring_lock); - io_submit_flush_completions(&ctx->submit_state.comp, ctx); + io_submit_flush_completions(ctx); mutex_unlock(&ctx->uring_lock); } percpu_ref_put(&ctx->refs); @@ -2147,9 +2146,9 @@ static void io_req_free_batch(struct req_batch *rb, struct io_kiocb *req, list_add(&req->compl.list, &state->comp.free_list); } -static void io_submit_flush_completions(struct io_comp_state *cs, - struct io_ring_ctx *ctx) +static void io_submit_flush_completions(struct io_ring_ctx *ctx) { + struct io_comp_state *cs = &ctx->submit_state.comp; int i, nr = cs->nr; struct io_kiocb *req; struct req_batch rb; @@ -6462,7 +6461,7 @@ static void __io_queue_sqe(struct io_kiocb *req) cs->reqs[cs->nr++] = req; if (cs->nr == ARRAY_SIZE(cs->reqs)) - io_submit_flush_completions(cs, ctx); + io_submit_flush_completions(ctx); } else { io_put_req(req); } @@ -6676,7 +6675,7 @@ static void io_submit_state_end(struct io_submit_state *state, if (state->link.head) io_queue_sqe(state->link.head); if (state->comp.nr) - io_submit_flush_completions(&state->comp, ctx); + io_submit_flush_completions(ctx); if (state->plug_started) blk_finish_plug(&state->plug); io_state_file_put(state); -- 2.30.2