From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59EDBECAAA1 for ; Sat, 3 Sep 2022 02:50:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231443AbiICCu5 (ORCPT ); Fri, 2 Sep 2022 22:50:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231298AbiICCu4 (ORCPT ); Fri, 2 Sep 2022 22:50:56 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA9E986B70 for ; Fri, 2 Sep 2022 19:50:55 -0700 (PDT) Received: from canpemm500004.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MKK0z3MMWzWf63; Sat, 3 Sep 2022 10:46:27 +0800 (CST) Received: from huawei.com (10.175.127.227) by canpemm500004.china.huawei.com (7.192.104.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 3 Sep 2022 10:50:53 +0800 From: Jason Yan To: , , , , , CC: Jason Yan Subject: [PATCH v2 00/13] some refactor of __ext4_fill_super() Date: Sat, 3 Sep 2022 11:01:43 +0800 Message-ID: <20220903030156.770313-1-yanaijie@huawei.com> X-Mailer: git-send-email 2.31.1 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 canpemm500004.china.huawei.com (7.192.104.92) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org This function is maybe the longest function I have seen in the kernel. It has more than one thousand lines. This makes us not easy to read and understand the code. So I made some refactors. The first two patches did some preparation to the goto labels so that we can factor out some functions easily. After this refactor this function is about 500 lines shorter. I did not go further because I'm not sure if people like this kind of change. If there is any bad side effects, please let me know. If you strongly dislike it, I am ok to stop this refactor. v1->v2: some code improvements suggested by Jan Kara and add review tags. Jason Yan (13): ext4: goto right label 'failed_mount3a' ext4: remove cantfind_ext4 error handler ext4: factor out ext4_set_def_opts() ext4: factor out ext4_handle_clustersize() ext4: factor out ext4_fast_commit_init() ext4: factor out ext4_inode_info_init() ext4: factor out ext4_encoding_init() ext4: factor out ext4_init_metadata_csum() ext4: factor out ext4_check_feature_compatibility() ext4: factor out ext4_geometry_check() ext4: factor out ext4_group_desc_init() and ext4_group_desc_free() ext4: factor out ext4_load_and_init_journal() ext4: factor out ext4_journal_data_mode_check() fs/ext4/super.c | 1070 ++++++++++++++++++++++++++--------------------- 1 file changed, 599 insertions(+), 471 deletions(-) -- 2.31.1