History

fs_parse: handle optional arguments sanely

Don't bother with "mixed" options that would allow both the form with and without argument (i.e. both -o foo and -o foo=bar). Rather than trying to shove both into a single fs_parameter_spec, allow having with-argument and no-argument specs with the same name and teach fs_parse to handle that. There are very few options of that sort, and they are actually easier to handle that way - callers end up with less postprocessing.

Al Viro committed 6 years ago

Commit 48ce73b1 parent d7167b15 files · +82 −121Browse files

Showing the changes to include/linux (1 of 5 files). Show all

Unified · Split

include/linux/fs_parser.h+0−1
@@ -49,7 +49,6 @@ struct fs_parameter_spec { · 48 unmodified lines
49 u8 opt; /* Option number (returned by fs_parse()) */49 u8 opt; /* Option number (returned by fs_parse()) */
50 enum fs_parameter_type type:8; /* The desired parameter type */50 enum fs_parameter_type type:8; /* The desired parameter type */
51 unsigned short flags;51 unsigned short flags;
52#define fs_param_v_optional 0x0001 /* The value is optional */
53#define fs_param_neg_with_no 0x0002 /* "noxxx" is negative param */52#define fs_param_neg_with_no 0x0002 /* "noxxx" is negative param */
54#define fs_param_neg_with_empty 0x0004 /* "xxx=" is negative param */53#define fs_param_neg_with_empty 0x0004 /* "xxx=" is negative param */
55#define fs_param_deprecated 0x0008 /* The param is deprecated */54#define fs_param_deprecated 0x0008 /* The param is deprecated */