[16/17] ext4: change token2str() to use ext4_param_specs
diff mbox series

Message ID 20191106101457.11237-17-lczerner@redhat.com
State New
Headers show
Series
  • [01/17] vfs: Handle fs_param_neg_with_empty
Related show

Commit Message

Lukas Czerner Nov. 6, 2019, 10:14 a.m. UTC
Chage token2str() to use ext4_param_specs instead of tokens so that we
can get rid of tokens entirely.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 fs/ext4/super.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Patch
diff mbox series

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index f2f17c11b616..2f3296e81837 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2613,12 +2613,14 @@  static inline void ext4_show_quota_options(struct seq_file *seq,
 
 static const char *token2str(int token)
 {
-	const struct match_token *t;
+	const struct fs_parameter_spec *spec;
 
-	for (t = tokens; t->token != Opt_err; t++)
-		if (t->token == token && !strchr(t->pattern, '='))
+	for (spec = ext4_param_specs; spec->name != NULL; spec++)
+		if (spec->opt == token &&
+		    (spec->type == fs_param_is_flag ||
+		     spec->type == fs_param_is_bool))
 			break;
-	return t->pattern;
+	return spec->name;
 }
 
 /*