From patchwork Mon Aug 12 09:12:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Li X-Patchwork-Id: 13760341 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 lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6772C3DA7F for ; Mon, 12 Aug 2024 09:22:50 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1sdRGK-0004zu-Qe; Mon, 12 Aug 2024 09:22:48 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sdRGH-0004zV-PK for linux-f2fs-devel@lists.sourceforge.net; Mon, 12 Aug 2024 09:22:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Date:Subject:CC:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=3Z+y/rI8tXTKGdU03PCZ8hIjnHbGiIjXqNSm0y4liQY=; b=Eske4y1rgNlkI5cwY7QHfkW+KI 6euMwiJzgovGI8/hpUo8NtHx3305MlELQ0FZoyFo9nwCZ3DizKlqFV4NVGmVI/lPAqh4R/8SQevau nHPtKpDp3Cl7Y76G556aQnLbw7weU7DnlemDwlIOAkkrJ1JHWjHw6wMwSPatALKTCDg4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Date: Subject:CC:To:From:Sender:Reply-To:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=3Z+y/rI8tXTKGdU03PCZ8hIjnHbGiIjXqNSm0y4liQY=; b=a 9UpKTTsq0vSlF+4ZGZI4yJNh2wRj3Z2edXIIsVr2RuexPTWL+Llwv79oour69nbmmx1xsNzwyMM11 Shh4sMfWMbUx+7u1tlhM3Km3R2PHQNPDJbHNs/ps+E1TOAxZbNnLSh7ngvs6FmwZkJYvP/BfHzzBk 1T+ryRLKSuouwrFw=; Received: from szxga03-in.huawei.com ([45.249.212.189]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1sdRGG-0002CZ-7I for linux-f2fs-devel@lists.sourceforge.net; Mon, 12 Aug 2024 09:22:45 +0000 Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Wj7lz4mngzQpfM; Mon, 12 Aug 2024 17:01:03 +0800 (CST) Received: from dggpeml500022.china.huawei.com (unknown [7.185.36.66]) by mail.maildlp.com (Postfix) with ESMTPS id C560B140414; Mon, 12 Aug 2024 17:05:35 +0800 (CST) Received: from huawei.com (10.90.53.73) by dggpeml500022.china.huawei.com (7.185.36.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Mon, 12 Aug 2024 17:05:35 +0800 To: , Date: Mon, 12 Aug 2024 17:12:09 +0800 Message-ID: <20240812091218.2922787-1-lihongbo22@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.90.53.73] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml500022.china.huawei.com (7.185.36.66) X-Headers-End: 1sdRGG-0002CZ-7I Subject: [f2fs-dev] [PATCH 0/9] f2fs: new mount API conversion X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Hongbo Li via Linux-f2fs-devel From: Hongbo Li Reply-To: Hongbo Li Cc: lihongbo22@huawei.com, linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Since many filesystems have done the new mount API conversion, we introduce the new mount API conversion in f2fs. The series can be applied on top of the current mainline tree and the work is based on the patches from Lukas Czerner (has done this in ext4[1]). His patch give me a lot of ideas. Here is a high level description of the patchset: 1. Prepare the f2fs mount parameters required by the new mount API and use it for parsing, while still using the old API to get mount options string. Split the parameter parsing and validation of the parse_options helper into two separate helpers. f2fs: Add fs parameter specifications for mount options f2fs: move the option parser into handle_mount_opt f2fs: move option validation into a separate helper 2. Remove the use of sb/sbi structure of f2fs from all the parsing code, because with the new mount API the parsing is going to be done before we even get the super block. In this part, we introduce f2fs_fs_context to hold the temporary options when parsing. For the simple options check, it has to be done during parsing by using f2fs_fs_context structure. For the check which needs sb/sbi, we do this during super block filling. f2fs: Allow sbi to be NULL in f2fs_printk f2fs: Add f2fs_fs_context to record the mount options f2fs: separate the options parsing and options checking 3. Switch the f2fs to use the new mount API for mount and remount. f2fs: introduce fs_context_operation structure f2fs: switch to the new mount api 4. Cleanup the old unused structures and helpers. f2fs: remove unused structure and functions There is still a potential to do some cleanups and perhaps refactoring. However that can be done later after the conversion to the new mount API which is the main purpose of the patchset. [1] https://lore.kernel.org/all/20211021114508.21407-1-lczerner@redhat.com/ Hongbo Li (9): f2fs: Add fs parameter specifications for mount options f2fs: move the option parser into handle_mount_opt f2fs: move option validation into a separate helper f2fs: Allow sbi to be NULL in f2fs_printk f2fs: Add f2fs_fs_context to record the mount options f2fs: separate the options parsing and options checking f2fs: introduce fs_context_operation structure f2fs: switch to the new mount api f2fs: remove unused structure and functions fs/f2fs/super.c | 2213 ++++++++++++++++++++++++++++------------------- 1 file changed, 1343 insertions(+), 870 deletions(-)