Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp47447pxb; Wed, 14 Apr 2021 09:07:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9cPUhAU2Lk6j05EDvsw/kg67UdDK16oAMS15jfFg9uAJNrOw94MQR7Og8JNaJSJJO+vPb X-Received: by 2002:a05:6402:2807:: with SMTP id h7mr41069346ede.217.1618416445177; Wed, 14 Apr 2021 09:07:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618416445; cv=none; d=google.com; s=arc-20160816; b=augT32RN9AMiIWu8umhFtxUjRvrXPCLs9itEgErxuq7SEIydZN5z94qOFW4D6zpjNM Qeg35K8vPG5RFUrct1fjtYpgv3SlFyqjXX8IKLi+k6EUvIbmgKZOKJDUcPyw057XCcTe 4vMQVMmr7UV9HXoR8S4KfKI4h0VqBQsUr9QiKndiHwzgiZLnVd23YZ/bQOZnHikyDRzA oM5ot6CMt6eu89yAGj9YWQmRPjzZV5XUgLFIflJlOOpkzkqCYHviI0tvdDHJ3cF+BBjp m1uMn6ZGztCd8o3rHl27p3O7ot7lVdtxACV7oAldzEpla6E8s3SV/VSCL0bIntyAe632 y/lA== 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=/AufLlYgxwsNOY/qhgymMh+IHNgruM4O3nWqH2mJGYI=; b=CgUMU1j362DxJfsXVT7JBnqaEkefanRXdTIczeD2rttxr7Dt6aO+YvRXCyJ3RtSgzR yx/VXqeH7h5RyW21Aq2P1Z2GHlE7+crW3+cZpCozdALUtnE+nc7wknU/ys7rJZHf8tPz bY6D0TrsCb2ZQS4qhnSEiW1Ki5Dw9MNup3GzmRiCBFsWWLJKL8d7YgoQgdc6Sv1Jq08e JosmialRV9wUFHLIrJ5jqnx35vC0AoaE0Hh+h7zneIPBP2EK04dE78nIYxELVycWVM2h ulq91qmew+cI4CvDDbrhZrj8YDKuw4ibZuqdV7FDg4+oBD7MdLVBooEzpWfKg1kYJpCo xhag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b24si1944964edy.600.2021.04.14.09.07.00; Wed, 14 Apr 2021 09:07:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346607AbhDNNj7 (ORCPT + 99 others); Wed, 14 Apr 2021 09:39:59 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:15679 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346798AbhDNNj5 (ORCPT ); Wed, 14 Apr 2021 09:39:57 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FL3RC4z3BzpXtL; Wed, 14 Apr 2021 21:36:39 +0800 (CST) Received: from huawei.com (10.175.127.227) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Wed, 14 Apr 2021 21:39:27 +0800 From: Zhang Yi To: CC: , , , , , Subject: [RFC PATCH v2 1/7] jbd2: remove the out label in __jbd2_journal_remove_checkpoint() Date: Wed, 14 Apr 2021 21:47:31 +0800 Message-ID: <20210414134737.2366971-2-yi.zhang@huawei.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20210414134737.2366971-1-yi.zhang@huawei.com> References: <20210414134737.2366971-1-yi.zhang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org The 'out' lable just return the 'ret' value and seems not required, so remove this label and switch to return appropriate value immediately. This patch also do some minor cleanup, no logical change. Signed-off-by: Zhang Yi --- fs/jbd2/checkpoint.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c index 63b526d44886..bf5511d19ac5 100644 --- a/fs/jbd2/checkpoint.c +++ b/fs/jbd2/checkpoint.c @@ -564,13 +564,13 @@ int __jbd2_journal_remove_checkpoint(struct journal_head *jh) struct transaction_chp_stats_s *stats; transaction_t *transaction; journal_t *journal; - int ret = 0; JBUFFER_TRACE(jh, "entry"); - if ((transaction = jh->b_cp_transaction) == NULL) { + transaction = jh->b_cp_transaction; + if (!transaction) { JBUFFER_TRACE(jh, "not on transaction"); - goto out; + return 0; } journal = transaction->t_journal; @@ -579,9 +579,9 @@ int __jbd2_journal_remove_checkpoint(struct journal_head *jh) jh->b_cp_transaction = NULL; jbd2_journal_put_journal_head(jh); - if (transaction->t_checkpoint_list != NULL || - transaction->t_checkpoint_io_list != NULL) - goto out; + /* Is this transaction empty? */ + if (transaction->t_checkpoint_list || transaction->t_checkpoint_io_list) + return 0; /* * There is one special case to worry about: if we have just pulled the @@ -593,10 +593,12 @@ int __jbd2_journal_remove_checkpoint(struct journal_head *jh) * See the comment at the end of jbd2_journal_commit_transaction(). */ if (transaction->t_state != T_FINISHED) - goto out; + return 0; - /* OK, that was the last buffer for the transaction: we can now - safely remove this transaction from the log */ + /* + * OK, that was the last buffer for the transaction, we can now + * safely remove this transaction from the log. + */ stats = &transaction->t_chp_stats; if (stats->cs_chp_time) stats->cs_chp_time = jbd2_time_diff(stats->cs_chp_time, @@ -606,9 +608,7 @@ int __jbd2_journal_remove_checkpoint(struct journal_head *jh) __jbd2_journal_drop_transaction(journal, transaction); jbd2_journal_free_transaction(transaction); - ret = 1; -out: - return ret; + return 1; } /* -- 2.25.4