Skip to content

Commit 9acd0d5

Browse files
valdiskAl Viro
authored andcommitted
exfat: update file system parameter handling
Al Viro recently reworked the way file system parameters are handled Update super.c to work with it in linux-next 20200203. Signed-off-by: Valdis Kletnieks <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Acked-by: Namjae Jeon <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent 1a3c050 commit 9acd0d5

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

fs/exfat/super.c

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -214,41 +214,35 @@ enum {
214214
Opt_time_offset,
215215
};
216216

217-
static const struct fs_parameter_spec exfat_param_specs[] = {
217+
static const struct constant_table exfat_param_enums[] = {
218+
{ "continue", EXFAT_ERRORS_CONT },
219+
{ "panic", EXFAT_ERRORS_PANIC },
220+
{ "remount-ro", EXFAT_ERRORS_RO },
221+
{}
222+
};
223+
224+
static const struct fs_parameter_spec exfat_parameters[] = {
218225
fsparam_u32("uid", Opt_uid),
219226
fsparam_u32("gid", Opt_gid),
220227
fsparam_u32oct("umask", Opt_umask),
221228
fsparam_u32oct("dmask", Opt_dmask),
222229
fsparam_u32oct("fmask", Opt_fmask),
223230
fsparam_u32oct("allow_utime", Opt_allow_utime),
224231
fsparam_string("iocharset", Opt_charset),
225-
fsparam_enum("errors", Opt_errors),
232+
fsparam_enum("errors", Opt_errors, exfat_param_enums),
226233
fsparam_flag("discard", Opt_discard),
227234
fsparam_s32("time_offset", Opt_time_offset),
228235
{}
229236
};
230237

231-
static const struct fs_parameter_enum exfat_param_enums[] = {
232-
{ Opt_errors, "continue", EXFAT_ERRORS_CONT },
233-
{ Opt_errors, "panic", EXFAT_ERRORS_PANIC },
234-
{ Opt_errors, "remount-ro", EXFAT_ERRORS_RO },
235-
{}
236-
};
237-
238-
static const struct fs_parameter_description exfat_parameters = {
239-
.name = "exfat",
240-
.specs = exfat_param_specs,
241-
.enums = exfat_param_enums,
242-
};
243-
244238
static int exfat_parse_param(struct fs_context *fc, struct fs_parameter *param)
245239
{
246240
struct exfat_sb_info *sbi = fc->s_fs_info;
247241
struct exfat_mount_options *opts = &sbi->options;
248242
struct fs_parse_result result;
249243
int opt;
250244

251-
opt = fs_parse(fc, &exfat_parameters, param, &result);
245+
opt = fs_parse(fc, exfat_parameters, param, &result);
252246
if (opt < 0)
253247
return opt;
254248

@@ -665,7 +659,7 @@ static struct file_system_type exfat_fs_type = {
665659
.owner = THIS_MODULE,
666660
.name = "exfat",
667661
.init_fs_context = exfat_init_fs_context,
668-
.parameters = &exfat_parameters,
662+
.parameters = exfat_parameters,
669663
.kill_sb = kill_block_super,
670664
.fs_flags = FS_REQUIRES_DEV,
671665
};

0 commit comments

Comments
 (0)