Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp847157rwr; Fri, 5 May 2023 06:02:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5hhQLcyyU2GWbKa7Kz/WU6+W7RCuO+uW+220jvMEnycgoj2r5+24IOhELNJqOD++JNWULU X-Received: by 2002:ac8:5c14:0:b0:3f2:1f63:2b24 with SMTP id i20-20020ac85c14000000b003f21f632b24mr2042446qti.2.1683291718877; Fri, 05 May 2023 06:01:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683291718; cv=none; d=google.com; s=arc-20160816; b=JE3t5mRWoNU4e0Qz6eLmaKKlPb+xWhU4uSjHVJNaiK9L+iWF/9PTCY7c1wybe92Le8 jrax7EPHIW8HzoDCGPd4kqNTyQiviTvQq3gj0U6JqYWHVvkJaecun3ycGGNGqnJIStCX UscgW1+JUuQ+B3mSpX5aoj4diafu9egfHMvlepCBPlSggRQWtWajLAsJlT3Boxh2nx7v 4s3TOrmNqWZWISeW4a1TQjaNo7V6geQBUy1bekCM0kfVszJ5kgnPEO5eCffrBQb22utH MTKx/euk/VU8l2lIH+NVvZBKBe1KU17Hlvu4pimbkA8fPJrZZqypaqrQeTgO1GQtnxpq NXOQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=1r26GTE0oK42FBKlc7l8Heyd+dTDEwPicSliRxRnpfs=; b=YG60bQw7vnhgc22baTZFmBexI6S/wYQ58196OqFLrrFCd/yCoVk4biSp7aUgLwte56 YSuJFV5JGtv7kOpd+rVcbQWo9zvWBSpvNGOF+yZcxDK4FktW+yCuL+fD2C31lHzWohyh eJUrOcIAtRQHQIjXLkOBhRUmnSX6WqxriTAmBWiKkkJMo9VVAq5eO4XSRMBjQYBkzVc+ yXP3SB4yKENOzxoHuFK2ikJ9uaKT+5dxy0SrBmMHeUo8MVB6MZXXniiEwq9QUWUhx/qe 8ZJ6WmrngZx8I68iGbMwdTenCc1SWIFNFWiCX5ivs9b7NHTIxVoyKbEA6s5cqUj/J2Vw S2Nw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p8-20020a05622a00c800b003e38ba5e335si544675qtw.763.2023.05.05.06.01.19; Fri, 05 May 2023 06:01:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232287AbjEEMvi (ORCPT + 99 others); Fri, 5 May 2023 08:51:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232278AbjEEMvh (ORCPT ); Fri, 5 May 2023 08:51:37 -0400 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69E5C1FFE for ; Fri, 5 May 2023 05:51:35 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4QCVSf6ZG1z4f3m7Y for ; Fri, 5 May 2023 20:32:34 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.170]) by APP2 (Coremail) with SMTP id Syh0CgA33epT91RkDvzXIg--.37253S6; Fri, 05 May 2023 20:32:36 +0800 (CST) From: Zhang Yi To: linux-ext4@vger.kernel.org Cc: tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz, yi.zhang@huawei.com, yi.zhang@huaweicloud.com, yukuai3@huawei.com, chengzhihao1@huawei.com Subject: [PATCH v2 3/3] jbd2: remove released parameter in journal_shrink_one_cp_list() Date: Fri, 5 May 2023 20:32:19 +0800 Message-Id: <20230505123219.4135141-3-yi.zhang@huaweicloud.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230505123219.4135141-1-yi.zhang@huaweicloud.com> References: <20230505123219.4135141-1-yi.zhang@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: Syh0CgA33epT91RkDvzXIg--.37253S6 X-Coremail-Antispam: 1UD129KBjvJXoW7Aw15Ww1fJF18KFWDJry5Arb_yoW8trW8pF yfC3yjqrWku34DCr1vvF48ArW0vFWj9ryUKF9FkF93Aa1UKw4fKFy7tw17tFyUAryrWa1a q34UWFn8Gw1Yva7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9m14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_Jryl82xGYIkIc2 x26xkF7I0E14v26r4j6ryUM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJw A2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS 0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2 IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0 Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCF04k20xvY0x0EwIxGrwCFx2 IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v2 6r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67 AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IY s7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr 0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUc6pPUUUUU= X-CM-SenderInfo: d1lo6xhdqjqx5xdzvxpfor3voofrz/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Zhang Yi After t_checkpoint_io_list is gone, the 'released' parameter in journal_shrink_one_cp_list() becomes useless, just remove it. Signed-off-by: Zhang Yi --- fs/jbd2/checkpoint.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c index 2b62154e9f1e..7b6320081f11 100644 --- a/fs/jbd2/checkpoint.c +++ b/fs/jbd2/checkpoint.c @@ -387,15 +387,13 @@ static int journal_clean_one_cp_list(struct journal_head *jh, bool destroy) * journal_shrink_one_cp_list * * Find 'nr_to_scan' written-back checkpoint buffers in the given list - * and try to release them. If the whole transaction is released, set - * the 'released' parameter. Return the number of released checkpointed + * and try to release them. Return the number of released checkpointed * buffers. * * Called with j_list_lock held. */ static unsigned long journal_shrink_one_cp_list(struct journal_head *jh, - unsigned long *nr_to_scan, - bool *released) + unsigned long *nr_to_scan) { struct journal_head *last_jh; struct journal_head *next_jh = jh; @@ -416,10 +414,8 @@ static unsigned long journal_shrink_one_cp_list(struct journal_head *jh, nr_freed++; ret = __jbd2_journal_remove_checkpoint(jh); - if (ret) { - *released = true; + if (ret) break; - } if (need_resched()) break; @@ -441,7 +437,6 @@ unsigned long jbd2_journal_shrink_checkpoint_list(journal_t *journal, unsigned long *nr_to_scan) { transaction_t *transaction, *last_transaction, *next_transaction; - bool released; tid_t first_tid = 0, last_tid = 0, next_tid = 0; tid_t tid = 0; unsigned long nr_freed = 0; @@ -474,10 +469,9 @@ unsigned long jbd2_journal_shrink_checkpoint_list(journal_t *journal, transaction = next_transaction; next_transaction = transaction->t_cpnext; tid = transaction->t_tid; - released = false; nr_freed += journal_shrink_one_cp_list(transaction->t_checkpoint_list, - nr_to_scan, &released); + nr_to_scan); if (*nr_to_scan == 0) break; if (need_resched() || spin_needbreak(&journal->j_list_lock)) -- 2.31.1