Skip to content

Commit

Permalink
ext4: change token2str() to use ext4_param_specs
Browse files Browse the repository at this point in the history
Change 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>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Link: https://lore.kernel.org/r/20211027141857.33657-12-lczerner@redhat.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
Lukas Czerner authored and Theodore Ts'o committed Dec 9, 2021
1 parent 02f960f commit 97d8a67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fs/ext4/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -3046,12 +3046,12 @@ 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)
break;
return t->pattern;
return spec->name;
}

/*
Expand Down

0 comments on commit 97d8a67

Please sign in to comment.