erofs: Adapt to <5.6 fsparam_enum

>=5.6 kernels have commit 2710c957a8ef4fb00f21acb306e3bd6bcf80c81f

Change-Id: Ia361cf5df8e2bdec99f2bd364cccfedfaa58d68a
Signed-off-by: Michael Bestas <mkbestas@lineageos.org>
This commit is contained in:
Michael Bestas 2024-04-16 00:40:35 +03:00
commit 7c697abfc7
No known key found for this signature in database
GPG key ID: CC95044519BE6669

View file

@ -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;