From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 096DDC4320A for ; Thu, 29 Jul 2021 15:06:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E7EB160EBC for ; Thu, 29 Jul 2021 15:06:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237661AbhG2PGh (ORCPT ); Thu, 29 Jul 2021 11:06:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237737AbhG2PGg (ORCPT ); Thu, 29 Jul 2021 11:06:36 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7510FC061765 for ; Thu, 29 Jul 2021 08:06:31 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id e25-20020a05600c4b99b0290253418ba0fbso4276761wmp.1 for ; Thu, 29 Jul 2021 08:06:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=b03rB4RIvVnMhyEKQjApfgsNfwcDobxdzZG7kLlB3M8=; b=RN8fV8dlX78JhcdAINJHGwXL9YJmIREE41CPTqpp8j/EASauJCmlrahRZ+t+Ao35gk ZJA8vjUygdKthDq9nok9dJxvFvOkKnkHwu8s3jWeLGBl7S0Pr96oc8zuQ2mV9xRg7uCa 9rBUo8pRQa6wyHeKILZWfR376R/ODS9/iSNmsgy+xtoEp4cm8mwZbYhAxPffd2isTy6K hVzaIyyf8Adg45FhqB+5gMavFj1ZwZLEYijut4QO4qzUM5EAseahIPA18dxNdZg02Vnb zmSFscOh0X0UVtCtoqsgoQrhxcA+MB1QOJWbN3rA2rKvenHHiAvWaF36SVA89n2aFcFk ojLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=b03rB4RIvVnMhyEKQjApfgsNfwcDobxdzZG7kLlB3M8=; b=daRG9gfBHkRdPDI9532i4k7btIZzCAFMKJl90aZmzWZKdyZF4H2atBwJskm9EFlJhL gXRkm4Qb2GcLWvfFodIgnZE22aGeGbhZ3vJFIXJWlh/ifxF1Ai4IN02cPwTtDplGcUqd fE3rr0rXnOAqZoonXIquZzd/YwbM3DuPvE2PTTAPj06WRyEtMJThsrqD6CTBPUGnVUdC xVcOD29lZ/pvOlc58+L4BOj7q9DdbbzFnq/AqJ8gPZMGUU3zYYw+13noQZwy2a+k7Y3Q AqanXcx3yZ7LjJyImFKc+f6yscGOB/yRFgFsQ2eLIcxJCBcbEK7Us4jvNH6jT2ZN2BaT hjng== X-Gm-Message-State: AOAM531LDVq6ZSWIg43UvP8nM6NqlJSVzwoPEPKaP6lALi6JB0gnDJ+h NfCpq1F2MZhb2BoYkg2Bh4o= X-Google-Smtp-Source: ABdhPJyENr3FORwtaSM9lzsbwtIp6lSQNYed5NqiEUddjiBHRfijDgw+BDiEG9BM7sv9oYKroZ4smw== X-Received: by 2002:a05:600c:2908:: with SMTP id i8mr5170814wmd.108.1627571190127; Thu, 29 Jul 2021 08:06:30 -0700 (PDT) Received: from localhost.localdomain ([148.252.128.141]) by smtp.gmail.com with ESMTPSA id e6sm4764577wrg.18.2021.07.29.08.06.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 08:06:29 -0700 (PDT) From: Pavel Begunkov To: Jens Axboe , io-uring@vger.kernel.org Subject: [PATCH 08/23] io_uring: move io_put_task() definition Date: Thu, 29 Jul 2021 16:05:35 +0100 Message-Id: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Move the function in the source file as it is to get rid of forward declarations. Signed-off-by: Pavel Begunkov --- fs/io_uring.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index db43aedcfc42..a5f58d8ea70f 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -1057,7 +1057,6 @@ static bool io_cqring_fill_event(struct io_ring_ctx *ctx, u64 user_data, static void io_put_req(struct io_kiocb *req); static void io_put_req_deferred(struct io_kiocb *req, int nr); static void io_dismantle_req(struct io_kiocb *req); -static void io_put_task(struct task_struct *task, int nr); static struct io_kiocb *io_prep_linked_timeout(struct io_kiocb *req); static void io_queue_linked_timeout(struct io_kiocb *req); static int __io_register_rsrc_update(struct io_ring_ctx *ctx, unsigned type, @@ -1561,6 +1560,17 @@ static inline void req_ref_get(struct io_kiocb *req) atomic_inc(&req->refs); } +/* must to be called somewhat shortly after putting a request */ +static inline void io_put_task(struct task_struct *task, int nr) +{ + struct io_uring_task *tctx = task->io_uring; + + percpu_counter_sub(&tctx->inflight, nr); + if (unlikely(atomic_read(&tctx->in_idle))) + wake_up(&tctx->wait); + put_task_struct_many(task, nr); +} + static bool io_cqring_event_overflow(struct io_ring_ctx *ctx, u64 user_data, long res, unsigned int cflags) { @@ -1797,17 +1807,6 @@ static void io_dismantle_req(struct io_kiocb *req) } } -/* must to be called somewhat shortly after putting a request */ -static inline void io_put_task(struct task_struct *task, int nr) -{ - struct io_uring_task *tctx = task->io_uring; - - percpu_counter_sub(&tctx->inflight, nr); - if (unlikely(atomic_read(&tctx->in_idle))) - wake_up(&tctx->wait); - put_task_struct_many(task, nr); -} - static void __io_free_req(struct io_kiocb *req) { struct io_ring_ctx *ctx = req->ctx; -- 2.32.0