Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp565819pxj; Thu, 27 May 2021 06:51:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuqtXoccKCu2yYxtp7zwwS5ZNBZdUb+uyDrw6lOXEP2dfOOmNCYQ+DCDibIK334NSiTdjL X-Received: by 2002:aa7:cf06:: with SMTP id a6mr4392342edy.138.1622123462106; Thu, 27 May 2021 06:51:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622123462; cv=none; d=google.com; s=arc-20160816; b=YNC1R+FwVmiZ10Ibm7Da/sRDbqfonh6cnlSr8iZq+aX4AY8SBDaa5bdMwyvkzyKOYa voa4hve9he3rhCB5vsPEgXPX0ghC/P/sE5SDMYXilTxtYH5A0LcNJ81ZCtmke4Dkn3ta jn5AyOs2dl9PoOpAv5sizgsAdRsewghAW4jUml7x2XBTuU0KbPqbpinzzQBbGQcqmMHP BMz8Y3HvvvELbDEuzBcfAhPEV+OuocZQDyaIE6kA0oI3Hf97LKOw+HIALCjXLPbXDI0P kphS6si3Ky76QGKh4HBeuSKXOIpzCtbPj8Y7EooyJD3GMnD1ioLwYP0hWWm752xEtDrp CrYw== 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=UAx7dEWZT8hBJaw6DXAmUYjWRlaDDjZHgc0ATYKk3rI=; b=tl8U3WKodDp/ix6DVDnu6a53QSv7JtcBZC2ak7uu8MytgTejFCwL/AD6L+jnJyQi+p pFNlrs6YbDwX4PMOr3U+Q1WLcj+LtYZUBC97rBJ/ru1ZyGyE43iMACEJqANbgwUKobkG vXrwmfrlT3lYHoCZRGw/ot9AXNcta90pI+xZSq3ATj15VK4WXHahSNIvHSGNbI4s9A06 Fz89x7vHcaKQrDDb52aRu3mf3MkdPdf4FQCk+nP+01/+XvzmQjlYCuc0RMLw6Z/5Y2M4 QqsC8DKbzs2L7kRhQk7rm0QJWmmUKoX9Fz7jz33s9WvzVggbguU/sQAdnWQKoAiFGwYP yMbw== 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 b1si2641102ejb.714.2021.05.27.06.50.38; Thu, 27 May 2021 06:51:02 -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 S236595AbhE0Ns4 (ORCPT + 99 others); Thu, 27 May 2021 09:48:56 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:2064 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236593AbhE0Nsx (ORCPT ); Thu, 27 May 2021 09:48:53 -0400 Received: from dggeme752-chm.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4FrTXL1gg0zWp4T; Thu, 27 May 2021 21:42:42 +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, 27 May 2021 21:47:17 +0800 From: Zhang Yi To: CC: , , , , Subject: [RFC PATCH v3 1/8] jbd2: remove the out label in __jbd2_journal_remove_checkpoint() Date: Thu, 27 May 2021 21:56:34 +0800 Message-ID: <20210527135641.420514-2-yi.zhang@huawei.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20210527135641.420514-1-yi.zhang@huawei.com> References: <20210527135641.420514-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: dggems702-chm.china.huawei.com (10.3.19.179) 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.25.4