From patchwork Mon Nov 21 10:03:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Yudaken X-Patchwork-Id: 13050559 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C1ACC4332F for ; Mon, 21 Nov 2022 10:04:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230089AbiKUKEX (ORCPT ); Mon, 21 Nov 2022 05:04:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231254AbiKUKEF (ORCPT ); Mon, 21 Nov 2022 05:04:05 -0500 Received: from mx0b-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 194D49B7C7 for ; Mon, 21 Nov 2022 02:04:02 -0800 (PST) Received: from pps.filterd (m0148460.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AL1UWDk030968 for ; Mon, 21 Nov 2022 02:04:02 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meta.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=s2048-2021-q4; bh=zqE7wnuHH2jfEJzRt8kiWCSTGyh0h4w3yFgaDz5TXDE=; b=eQxRUmRo/LQhOxcfhHNmd2ng9Db8+srbsywNDIFJAH8Ul/ETxj4GvAE6Pz+d1mkLPhHC mX1kx9JLfc3RFQUbPE9lGItbrF2ibT2rtTFNCBHRLKjFQe+KCHYIld1uHDzIJ6v/pYNf X2ma2mfw4VKfW8J3MPMx8D/TVLaY8faAMIknuO4m4vPYy4lA6xuSTKzyYYv1e0tTETbM bGp/AG2iOIAvYv0LFpdqg1/XUBWzcOZ7qYZQVZSEnwEAQqOerJ5S1O3D5YFYVjb2L9VC 1T6e4ctz4IJFczRK3rBdgORytpPC5TkH06uZrCRXhQyQWSJCwQyTzXNT06y+PzvlFuCr Uw== Received: from maileast.thefacebook.com ([163.114.130.3]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3kxwj43g33-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 21 Nov 2022 02:04:02 -0800 Received: from twshared41876.03.ash8.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 21 Nov 2022 02:04:01 -0800 Received: by devbig038.lla2.facebook.com (Postfix, from userid 572232) id DFE649E66F69; Mon, 21 Nov 2022 02:03:54 -0800 (PST) From: Dylan Yudaken To: Jens Axboe , Pavel Begunkov CC: , , Dylan Yudaken Subject: [PATCH for-next 01/10] io_uring: merge io_req_tw_post and io_req_task_complete Date: Mon, 21 Nov 2022 02:03:44 -0800 Message-ID: <20221121100353.371865-2-dylany@meta.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221121100353.371865-1-dylany@meta.com> References: <20221121100353.371865-1-dylany@meta.com> MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-GUID: F-BlaF81HpGVW4iKLJyPOj7wIC_oy5_V X-Proofpoint-ORIG-GUID: F-BlaF81HpGVW4iKLJyPOj7wIC_oy5_V X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-21_06,2022-11-18_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Merge these functions that have the same logic Signed-off-by: Dylan Yudaken --- io_uring/io_uring.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 9e868a83e472..f15aca039db6 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -1227,15 +1227,18 @@ int io_run_local_work(struct io_ring_ctx *ctx) return ret; } -static void io_req_tw_post(struct io_kiocb *req, bool *locked) +void io_req_task_complete(struct io_kiocb *req, bool *locked) { - io_req_complete_post(req); + if (*locked) + io_req_complete_defer(req); + else + io_req_complete_post(req); } void io_req_tw_post_queue(struct io_kiocb *req, s32 res, u32 cflags) { io_req_set_res(req, res, cflags); - req->io_task_work.func = io_req_tw_post; + req->io_task_work.func = io_req_task_complete; io_req_task_work_add(req); } @@ -1464,14 +1467,6 @@ static int io_iopoll_check(struct io_ring_ctx *ctx, long min) return ret; } -void io_req_task_complete(struct io_kiocb *req, bool *locked) -{ - if (*locked) - io_req_complete_defer(req); - else - io_req_complete_post(req); -} - /* * After the iocb has been issued, it's safe to be found on the poll list. * Adding the kiocb to the list AFTER submission ensures that we don't