Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30559rwd; Mon, 15 May 2023 19:27:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4WpC58kIxARqzTMqOdZqqJCCqmQLRADw2tM14GdE9LdBvLbGqUxnfWI1R0uKT9r6gEWX7U X-Received: by 2002:a05:6a20:5488:b0:100:fc8d:feaf with SMTP id i8-20020a056a20548800b00100fc8dfeafmr38453748pzk.21.1684204035434; Mon, 15 May 2023 19:27:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684204035; cv=none; d=google.com; s=arc-20160816; b=xaDI/7FPAPCYDrqazq3Uc9lkWzj4PWOSouFY2J30bf8iuZmeFU0ZERG81WLm+EJpB9 +0A4XLaOajcpkpxCx+oisDXWhL+xDxZaiZiAmtGjItxBzpQvRz/fzVSlDlfzfUodTiV1 pcdIFixwedkDJi6C9WKxkq2LQYRY0ipHnLfoRzvVO4nd3Jq+0cXCuuvQ6TmbRZRcuQey Qjjsk26VM+iLa7PuUmeLgDV0SMxZKcCibbnKaFM7Mgsz1jId33n7JDhqyBJzDBnobYN2 Vt7Jp69q85MlpLnfnl2FMgKKqyyPkpvBzPpbWSrpG1X+yj3GyPWWvSov0eIM056Mpb1t /xvA== 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=80xevXNa7Yi3XP2RpETakgFDdNk6paGPUM9dlE5pH7w=; b=bUFOsdLBcmpxSht9AL9xVP3KN5XNR6FkqcN8XLn+qxsrE8Ff7oEyE0ms01x1RztAwo fG0wDO0mrXY9ZFEeo2U8k3LSFJFqq8+01cnl+/61fN7o8ujaoGviM0bstltNpVPv3ZCe jk481NR51TWJWinFutMiHIaFV78VqrdhYyysD6W+VcFxNiWcbTtL8NSiRazCghWYFBZ+ Ah0yFFcuRQUDJUPuG/OpO2O4UUVGzlKlvI1MzHViLkt1mqX917MOgsNAKKB+MeEEXaWy 0oUTFW64ohPB3pqWQJI+QNRj3AbC1m3ybjyHjTDzJ/b/BCQW1Uk0cRDCBhrm6hBaATZG XUtA== 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 67-20020a630246000000b0052cbd7cff1esi16831895pgc.806.2023.05.15.19.26.57; Mon, 15 May 2023 19:27:15 -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 S229778AbjEPCCx (ORCPT + 99 others); Mon, 15 May 2023 22:02:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229773AbjEPCCw (ORCPT ); Mon, 15 May 2023 22:02:52 -0400 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AEA63586 for ; Mon, 15 May 2023 19:02:48 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4QKzyr2yyYz4f3tNT for ; Tue, 16 May 2023 10:02:44 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.170]) by APP2 (Coremail) with SMTP id Syh0CgAHrusy5GJkLBS5JQ--.48186S6; Tue, 16 May 2023 10:02:45 +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 v3 3/3] jbd2: remove released parameter in journal_shrink_one_cp_list() Date: Tue, 16 May 2023 10:02:26 +0800 Message-Id: <20230516020226.2813588-3-yi.zhang@huaweicloud.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230516020226.2813588-1-yi.zhang@huaweicloud.com> References: <20230516020226.2813588-1-yi.zhang@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: Syh0CgAHrusy5GJkLBS5JQ--.48186S6 X-Coremail-Antispam: 1UD129KBjvJXoW7Aw15Ww1fJFyfXFW7Gw18Grg_yoW8tFy7pF yfu34jqrZYv34DCrn2qF48CrW0vFWj9ry7KF9FkF9aya1UKw4fKFy2yr17tFyUJryrWa1a q34UKFn8Ww1Yya7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9v14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_Jryl82xGYIkIc2 x26xkF7I0E14v26r4j6ryUM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Cr1j6rxdM2 8EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AI xVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20x vE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xv r2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxAIw28IcxkI7VAKI48JMxC20s 026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_ JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14 v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xva j40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JV W8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUjYiiDUUUUU== X-CM-SenderInfo: d1lo6xhdqjqx5xdzvxpfor3voofrz/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, MAY_BE_FORGED,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 Reviewed-by: Jan Kara --- 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 55d6efdbea64..3f52560912a9 100644 --- a/fs/jbd2/checkpoint.c +++ b/fs/jbd2/checkpoint.c @@ -391,15 +391,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; @@ -420,10 +418,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; @@ -445,7 +441,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; @@ -478,10 +473,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