Skip to content

Commit 7b30851

Browse files
Luis Henriques (SUSE)brauner
authored andcommitted
fs_parser: move fsparam_string_empty() helper into header
Since both ext4 and overlayfs define the same macro to specify string parameters that may allow empty values, define it in an header file so that this helper can be shared. Signed-off-by: Luis Henriques (SUSE) <luis.henriques@linux.dev> Link: https://lore.kernel.org/r/20240312104757.27333-1-luis.henriques@linux.dev Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 2a82bb0 commit 7b30851

3 files changed

Lines changed: 4 additions & 8 deletions

File tree

fs/ext4/super.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1723,10 +1723,6 @@ static const struct constant_table ext4_param_dax[] = {
17231723
{}
17241724
};
17251725

1726-
/* String parameter that allows empty argument */
1727-
#define fsparam_string_empty(NAME, OPT) \
1728-
__fsparam(fs_param_is_string, NAME, OPT, fs_param_can_be_empty, NULL)
1729-
17301726
/*
17311727
* Mount option specification
17321728
* We don't use fsparam_flag_no because of the way we set the

fs/overlayfs/params.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@ static int ovl_verity_mode_def(void)
139139
return OVL_VERITY_OFF;
140140
}
141141

142-
#define fsparam_string_empty(NAME, OPT) \
143-
__fsparam(fs_param_is_string, NAME, OPT, fs_param_can_be_empty, NULL)
144-
145-
146142
const struct fs_parameter_spec ovl_parameter_spec[] = {
147143
fsparam_string_empty("lowerdir", Opt_lowerdir),
148144
fsparam_string("lowerdir+", Opt_lowerdir_add),

include/linux/fs_parser.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,8 @@ static inline bool fs_validate_description(const char *name,
132132
#define fsparam_path(NAME, OPT) __fsparam(fs_param_is_path, NAME, OPT, 0, NULL)
133133
#define fsparam_fd(NAME, OPT) __fsparam(fs_param_is_fd, NAME, OPT, 0, NULL)
134134

135+
/* String parameter that allows empty argument */
136+
#define fsparam_string_empty(NAME, OPT) \
137+
__fsparam(fs_param_is_string, NAME, OPT, fs_param_can_be_empty, NULL)
138+
135139
#endif /* _LINUX_FS_PARSER_H */

0 commit comments

Comments
 (0)