From 7c697abfc76a4dc24400499df7876257129fb1ed Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Tue, 16 Apr 2024 00:40:35 +0300 Subject: [PATCH] erofs: Adapt to <5.6 fsparam_enum >=5.6 kernels have commit 2710c957a8ef4fb00f21acb306e3bd6bcf80c81f Change-Id: Ia361cf5df8e2bdec99f2bd364cccfedfaa58d68a Signed-off-by: Michael Bestas --- fs/erofs/super.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/fs/erofs/super.c b/fs/erofs/super.c index d565a9dc8a3c..82f3ac6b5e40 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -218,21 +218,26 @@ enum { Opt_err }; -static const struct constant_table erofs_param_cache_strategy[] = { - {"disabled", EROFS_ZIP_CACHE_DISABLED}, - {"readahead", EROFS_ZIP_CACHE_READAHEAD}, - {"readaround", EROFS_ZIP_CACHE_READAROUND}, +static const struct fs_parameter_spec erofs_fs_param_specs[] = { + fsparam_flag_no("user_xattr", Opt_user_xattr), + fsparam_flag_no("acl", Opt_acl), + fsparam_enum("cache_strategy", Opt_cache_strategy), {} }; -static const struct fs_parameter_spec erofs_fs_parameters[] = { - fsparam_flag_no("user_xattr", Opt_user_xattr), - fsparam_flag_no("acl", Opt_acl), - fsparam_enum("cache_strategy", Opt_cache_strategy, - erofs_param_cache_strategy), +static const struct fs_parameter_enum erofs_fs_param_enums[] = { + {Opt_cache_strategy, "disabled", EROFS_ZIP_CACHE_DISABLED}, + {Opt_cache_strategy, "readahead", EROFS_ZIP_CACHE_READAHEAD}, + {Opt_cache_strategy, "readaround", EROFS_ZIP_CACHE_READAROUND}, {} }; +const struct fs_parameter_description erofs_fs_parameters = { + .name = "erofs", + .specs = erofs_fs_param_specs, + .enums = erofs_fs_param_enums, +}; + static int erofs_fc_parse_param(struct fs_context *fc, struct fs_parameter *param) { @@ -240,7 +245,7 @@ static int erofs_fc_parse_param(struct fs_context *fc, struct fs_parse_result result; int opt; - opt = fs_parse(fc, erofs_fs_parameters, param, &result); + opt = fs_parse(fc, &erofs_fs_parameters, param, &result); if (opt < 0) return opt;