fs_parser: move fsparam_string_empty() helper into header
authorLuis Henriques (SUSE) <luis.henriques@linux.dev>
Tue, 12 Mar 2024 10:47:57 +0000 (10:47 +0000)
committerChristian Brauner <brauner@kernel.org>
Tue, 26 Mar 2024 08:01:18 +0000 (09:01 +0100)
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>
fs/ext4/super.c
fs/overlayfs/params.c
include/linux/fs_parser.h

index cfb8449c731f9ac53fb3add808e13493175508c4..2e906dbbe015de380b60cff297e4b087e16db284 100644 (file)
@@ -1723,10 +1723,6 @@ static const struct constant_table ext4_param_dax[] = {
        {}
 };
 
-/* String parameter that allows empty argument */
-#define fsparam_string_empty(NAME, OPT) \
-       __fsparam(fs_param_is_string, NAME, OPT, fs_param_can_be_empty, NULL)
-
 /*
  * Mount option specification
  * We don't use fsparam_flag_no because of the way we set the
index 36dcc530ac286b0102e228acebdf03a5951fa57b..4860fcc4611bb766547218d1baa9fd802f24f547 100644 (file)
@@ -139,10 +139,6 @@ static int ovl_verity_mode_def(void)
        return OVL_VERITY_OFF;
 }
 
-#define fsparam_string_empty(NAME, OPT) \
-       __fsparam(fs_param_is_string, NAME, OPT, fs_param_can_be_empty, NULL)
-
-
 const struct fs_parameter_spec ovl_parameter_spec[] = {
        fsparam_string_empty("lowerdir",    Opt_lowerdir),
        fsparam_string("lowerdir+",         Opt_lowerdir_add),
index 01542c4b87a2be065431f60c9f5d1302608a39a7..d3350979115f0a050efe9ee0ad7619c32b5c2f91 100644 (file)
@@ -132,4 +132,8 @@ 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)
 
+/* String parameter that allows empty argument */
+#define fsparam_string_empty(NAME, OPT) \
+       __fsparam(fs_param_is_string, NAME, OPT, fs_param_can_be_empty, NULL)
+
 #endif /* _LINUX_FS_PARSER_H */