Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp423068pxj; Thu, 10 Jun 2021 04:17:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxL0DM/Yg3Lz/urT1mHLgQ+3Aol0sLsYKD7r8M6VpCZtWaAIXw2pYhZSvdyZhm8tJ+JDSel X-Received: by 2002:a17:906:3a09:: with SMTP id z9mr3975306eje.450.1623323826787; Thu, 10 Jun 2021 04:17:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623323826; cv=none; d=google.com; s=arc-20160816; b=ysHFQNWcFIVDN1ptulMJuvL1mNbM8kFWWVKLa7lAutd/JavN5qxCXDXJJteFxh6ziM kE9iaN1Rs6wO8AMUM6PIx7eAsuYo2DtY6ExZPMejg0Me/6blRzLj4+ZMA0BT5ddcQRfI k1xGbfsCAmdMnwXWI4cuOQruwgV4Ke0xwDtWIrvqy/ZSNt/vGV9dJH/8S36S1UknjRHK JhRTk9ghxED9M6pziOO/zB0QX9i4+h8nO2M4kCZ5bwGhuoGPiZXM+i42XRl56nCoEQCF YrX//Q1/1XWDfSA5F9Nz+dHEAGbwAkp+IEUxigqI2L9JsgAN0ALjqgWFD6ib98sY3BvU NyMg== 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=Nxi5CfigH0uYq3A7EKV2iIWwWuVoMdQ51XyoQokHppc=; b=vayXjgtPc2oUoXl9LqOMxJJkhcVwg5tSQ/q7DTH03hCKUDu+CW6N15C/j8VbTSjmY4 bsKcSNdWUzhRFYjxGt4qOrW9ylR4UhNfSpIQFWrLUxP48Hz5k2cfpoh5BSKD8aOjXXnz EZ1qUvtxbELBI4AiZDi5+HA2s5mRu5Zn5HQxP83guqiyMe+4O8WeiSKSNQ8G3o7IJbiX IICsgBOQ9Sh6JVXc7mo4hZzYYLjmHkroYmVJ/Z/6Py9jiUbRDYpiOxKCo+Q1K0FvWarw NoJBDfm9Sp6+Dn0/bXxi46sbSP3fVHPdHUre2uKhcpLO+6RSB2t1VEIfHT2UUKlnSghb l//g== 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 f10si2056853ejt.614.2021.06.10.04.16.43; Thu, 10 Jun 2021 04:17:06 -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 S230199AbhFJLRt (ORCPT + 99 others); Thu, 10 Jun 2021 07:17:49 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:3829 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230051AbhFJLRs (ORCPT ); Thu, 10 Jun 2021 07:17:48 -0400 Received: from dggeme752-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4G11Vn2qSQzWscJ; Thu, 10 Jun 2021 19:10:57 +0800 (CST) Received: from huawei.com (10.175.127.227) by dggeme752-chm.china.huawei.com (10.3.19.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 10 Jun 2021 19:15:50 +0800 From: Zhang Yi To: , , , CC: , , , Subject: [RFC PATCH v4 1/8] jbd2: remove the out label in __jbd2_journal_remove_checkpoint() Date: Thu, 10 Jun 2021 19:24:33 +0800 Message-ID: <20210610112440.3438139-2-yi.zhang@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210610112440.3438139-1-yi.zhang@huawei.com> References: <20210610112440.3438139-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-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggeme752-chm.china.huawei.com (10.3.19.98) 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 Reviewed-by: Jan Kara --- 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.31.1