summaryrefslogtreecommitdiffstats
path: root/fs/jffs2
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2019-09-07 04:12:08 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2020-02-07 06:12:50 +0100
commit2710c957a8ef4fb00f21acb306e3bd6bcf80c81f (patch)
treeda60d8ec6779b64cbc29ca2b161ed9b9c0b2834e /fs/jffs2
parentPass consistent param->type to fs_parse() (diff)
downloadlinux-2710c957a8ef4fb00f21acb306e3bd6bcf80c81f.tar.xz
linux-2710c957a8ef4fb00f21acb306e3bd6bcf80c81f.zip
fs_parse: get rid of ->enums
Don't do a single array; attach them to fsparam_enum() entry instead. And don't bother trying to embed the names into those - it actually loses memory, with no real speedup worth mentioning. Simplifies validation as well. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/jffs2')
-rw-r--r--fs/jffs2/super.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index 0e6406c4f362..ecd1a13a35d8 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -167,27 +167,26 @@ enum {
Opt_rp_size,
};
-static const struct fs_parameter_spec jffs2_param_specs[] = {
- fsparam_enum ("compr", Opt_override_compr),
- fsparam_u32 ("rp_size", Opt_rp_size),
- {}
-};
-
-static const struct fs_parameter_enum jffs2_param_enums[] = {
- { Opt_override_compr, "none", JFFS2_COMPR_MODE_NONE },
+static const struct fs_parameter_enum jffs2_param_compr[] = {
+ {"none", JFFS2_COMPR_MODE_NONE },
#ifdef CONFIG_JFFS2_LZO
- { Opt_override_compr, "lzo", JFFS2_COMPR_MODE_FORCELZO },
+ {"lzo", JFFS2_COMPR_MODE_FORCELZO },
#endif
#ifdef CONFIG_JFFS2_ZLIB
- { Opt_override_compr, "zlib", JFFS2_COMPR_MODE_FORCEZLIB },
+ {"zlib", JFFS2_COMPR_MODE_FORCEZLIB },
#endif
{}
};
+static const struct fs_parameter_spec jffs2_param_specs[] = {
+ fsparam_enum ("compr", Opt_override_compr, jffs2_param_compr),
+ fsparam_u32 ("rp_size", Opt_rp_size),
+ {}
+};
+
const struct fs_parameter_description jffs2_fs_parameters = {
.name = "jffs2",
.specs = jffs2_param_specs,
- .enums = jffs2_param_enums,
};
static int jffs2_parse_param(struct fs_context *fc, struct fs_parameter *param)