diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2019-09-07 04:12:08 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2020-02-07 06:12:50 +0100 |
commit | 2710c957a8ef4fb00f21acb306e3bd6bcf80c81f (patch) | |
tree | da60d8ec6779b64cbc29ca2b161ed9b9c0b2834e /fs/afs/super.c | |
parent | Pass consistent param->type to fs_parse() (diff) | |
download | linux-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/afs/super.c')
-rw-r--r-- | fs/afs/super.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/fs/afs/super.c b/fs/afs/super.c index 7f8a9b3137bf..42bf63b82007 100644 --- a/fs/afs/super.c +++ b/fs/afs/super.c @@ -73,26 +73,25 @@ enum afs_param { Opt_source, }; +static const struct fs_parameter_enum afs_param_flock[] = { + {"local", afs_flock_mode_local }, + {"openafs", afs_flock_mode_openafs }, + {"strict", afs_flock_mode_strict }, + {"write", afs_flock_mode_write }, + {} +}; + static const struct fs_parameter_spec afs_param_specs[] = { fsparam_flag ("autocell", Opt_autocell), fsparam_flag ("dyn", Opt_dyn), - fsparam_enum ("flock", Opt_flock), + fsparam_enum ("flock", Opt_flock, afs_param_flock), fsparam_string("source", Opt_source), {} }; -static const struct fs_parameter_enum afs_param_enums[] = { - { Opt_flock, "local", afs_flock_mode_local }, - { Opt_flock, "openafs", afs_flock_mode_openafs }, - { Opt_flock, "strict", afs_flock_mode_strict }, - { Opt_flock, "write", afs_flock_mode_write }, - {} -}; - static const struct fs_parameter_description afs_fs_parameters = { .name = "kAFS", .specs = afs_param_specs, - .enums = afs_param_enums, }; /* |