From patchwork Wed Aug 14 02:39:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Li X-Patchwork-Id: 13762748 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0EA511A286 for ; Wed, 14 Aug 2024 02:32:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.189 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723602764; cv=none; b=kXCOSrJbUsTjSsPQM0ptBOmyHqaV5kNEcjyYJU4m0MROHGI0jePGfqoAyW0WVLOVKvtLC0OQL9H7sgMk4tOdpG8CzSX5dPM9U/nVB8b2eKRbZcZVCacQr6pjDpOkqRv6BDsj+REd7rEhdEtVW+aklwIGt7fwYLOJ0QhyqNowd1E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723602764; c=relaxed/simple; bh=QrCKOGYcQxWwsBmld8eJl4ckMKedWwG3eU15BAWNQ60=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qkDl59PbSa1QZhOYBupv51c4+UrfFzzKM4GTieRKw6W27PFgHatHLAi/vxO8HS74t8IYHCywzloU0Ad9nU6r/I+dPov3ARLNDWLVUbiCrqw+6YGVmyR2UtctGsH8fs6cny7HjxpuM3LrQM1BGzN/CS0e64vJTZ9HBEXZnwndb2M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4WkBxd5NRrzQpmg; Wed, 14 Aug 2024 10:28:05 +0800 (CST) Received: from dggpeml500022.china.huawei.com (unknown [7.185.36.66]) by mail.maildlp.com (Postfix) with ESMTPS id C16E61400C9; Wed, 14 Aug 2024 10:32:39 +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; Wed, 14 Aug 2024 10:32:39 +0800 From: Hongbo Li To: , CC: , , , , Subject: [PATCH 7/9] f2fs: introduce fs_context_operation structure Date: Wed, 14 Aug 2024 10:39:10 +0800 Message-ID: <20240814023912.3959299-8-lihongbo22@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240814023912.3959299-1-lihongbo22@huawei.com> References: <20240814023912.3959299-1-lihongbo22@huawei.com> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml500022.china.huawei.com (7.185.36.66) The handle_mount_opt() helper is used to parse mount parameters, and so we can rename this function to f2fs_parse_param() and set it as .param_param in fs_context_operations. Signed-off-by: Hongbo Li --- fs/f2fs/super.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index f658d75f4bb7..8c43fbe092ff 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -896,7 +896,7 @@ static int f2fs_set_zstd_level(struct f2fs_fs_context *ctx, const char *str) #endif #endif -static int handle_mount_opt(struct fs_context *fc, struct fs_parameter *param) +static int f2fs_parse_param(struct fs_context *fc, struct fs_parameter *param) { struct f2fs_fs_context *ctx = fc->fs_private; #ifdef CONFIG_F2FS_FS_COMPRESSION @@ -1544,7 +1544,7 @@ static int parse_options(struct fs_context *fc, char *options) param.key = key; param.size = v_len; - ret = handle_mount_opt(fc, ¶m); + ret = f2fs_parse_param(fc, ¶m); kfree(param.string); if (ret < 0) return ret; @@ -5577,6 +5577,10 @@ static struct dentry *f2fs_mount(struct file_system_type *fs_type, int flags, return mount_bdev(fs_type, flags, dev_name, data, f2fs_fill_super); } +static const struct fs_context_operations f2fs_context_ops = { + .parse_param = f2fs_parse_param, +}; + static void kill_f2fs_super(struct super_block *sb) { struct f2fs_sb_info *sbi = F2FS_SB(sb);