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
4949 u8 opt; /* Option number (returned by fs_parse()) */
5050 enum fs_parameter_type type:8; /* The desired parameter type */
5151 unsigned short flags;
52−#define fs_param_v_optional 0x0001 /* The value is optional */
5352 #define fs_param_neg_with_no 0x0002 /* "noxxx" is negative param */
5453 #define fs_param_neg_with_empty 0x0004 /* "xxx=" is negative param */
5554 #define fs_param_deprecated 0x0008 /* The param is deprecated */