summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2019-12-18 00:02:31 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2020-02-07 14:48:38 -0500
commit328de5287b10abc967c517461cf2948bd8a5b4e9 (patch)
treea6f015793241358f6d0b7a258c0d7f5114e029bc /include
parent48ce73b1bef20331007b35de7ade8fe26cd55e84 (diff)
turn fs_param_is_... into functions
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include')
-rw-r--r--include/linux/fs_parser.h38
1 files changed, 14 insertions, 24 deletions
diff --git a/include/linux/fs_parser.h b/include/linux/fs_parser.h
index 2e1e15f0cf4a..2eab6d5f6736 100644
--- a/include/linux/fs_parser.h
+++ b/include/linux/fs_parser.h
@@ -17,26 +17,18 @@ struct constant_table {
int value;
};
+struct fs_parameter_spec;
+struct fs_parse_result;
+typedef int fs_param_type(struct p_log *,
+ const struct fs_parameter_spec *,
+ struct fs_parameter *,
+ struct fs_parse_result *);
/*
* The type of parameter expected.
*/
-enum fs_parameter_type {
- __fs_param_wasnt_defined,
- fs_param_is_flag,
- fs_param_is_bool,
- fs_param_is_u32,
- fs_param_is_u32_octal,
- fs_param_is_u32_hex,
- fs_param_is_s32,
- fs_param_is_u64,
- fs_param_is_enum,
- fs_param_is_string,
- fs_param_is_blob,
- fs_param_is_blockdev,
- fs_param_is_path,
- fs_param_is_fd,
- nr__fs_parameter_type,
-};
+fs_param_type fs_param_is_bool, fs_param_is_u32, fs_param_is_s32, fs_param_is_u64,
+ fs_param_is_enum, fs_param_is_string, fs_param_is_blob, fs_param_is_blockdev,
+ fs_param_is_path, fs_param_is_fd;
/*
* Specification of the type of value a parameter wants.
@@ -46,8 +38,8 @@ enum fs_parameter_type {
*/
struct fs_parameter_spec {
const char *name;
+ fs_param_type *type; /* The desired parameter type */
u8 opt; /* Option number (returned by fs_parse()) */
- enum fs_parameter_type type:8; /* The desired parameter type */
unsigned short flags;
#define fs_param_neg_with_no 0x0002 /* "noxxx" is negative param */
#define fs_param_neg_with_empty 0x0004 /* "xxx=" is negative param */
@@ -120,16 +112,15 @@ static inline bool fs_validate_description(const char *name,
.data = DATA \
}
-#define fsparam_flag(NAME, OPT) __fsparam(fs_param_is_flag, NAME, OPT, 0, NULL)
+#define fsparam_flag(NAME, OPT) __fsparam(NULL, NAME, OPT, 0, NULL)
#define fsparam_flag_no(NAME, OPT) \
- __fsparam(fs_param_is_flag, NAME, OPT, \
- fs_param_neg_with_no, NULL)
+ __fsparam(NULL, NAME, OPT, fs_param_neg_with_no, NULL)
#define fsparam_bool(NAME, OPT) __fsparam(fs_param_is_bool, NAME, OPT, 0, NULL)
#define fsparam_u32(NAME, OPT) __fsparam(fs_param_is_u32, NAME, OPT, 0, NULL)
#define fsparam_u32oct(NAME, OPT) \
- __fsparam(fs_param_is_u32_octal, NAME, OPT, 0, NULL)
+ __fsparam(fs_param_is_u32, NAME, OPT, 0, (void *)8)
#define fsparam_u32hex(NAME, OPT) \
- __fsparam(fs_param_is_u32_hex, NAME, OPT, 0, NULL)
+ __fsparam(fs_param_is_u32_hex, NAME, OPT, 0, (void *16))
#define fsparam_s32(NAME, OPT) __fsparam(fs_param_is_s32, NAME, OPT, 0, NULL)
#define fsparam_u64(NAME, OPT) __fsparam(fs_param_is_u64, NAME, OPT, 0, NULL)
#define fsparam_enum(NAME, OPT, array) __fsparam(fs_param_is_enum, NAME, OPT, 0, array)
@@ -140,5 +131,4 @@ static inline bool fs_validate_description(const char *name,
#define fsparam_path(NAME, OPT) __fsparam(fs_param_is_path, NAME, OPT, 0, NULL)
#define fsparam_fd(NAME, OPT) __fsparam(fs_param_is_fd, NAME, OPT, 0, NULL)
-
#endif /* _LINUX_FS_PARSER_H */