[LTP] [PATCH] lib: Move tst_get_supported_fs_types() to private header

Cyril Hrubis chrubis@suse.cz
Tue May 27 13:47:57 CEST 2025


The function is not supposed to be used by tests hence it shouldn't be
part of the tst_fs.h include by them.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 include/tst_fs.h                 | 7 -------
 include/tst_private.h            | 7 +++++++
 lib/tst_supported_fs_types.c     | 1 +
 testcases/lib/tst_supported_fs.c | 1 +
 4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/include/tst_fs.h b/include/tst_fs.h
index 19c240e07..ceae78e7e 100644
--- a/include/tst_fs.h
+++ b/include/tst_fs.h
@@ -203,13 +203,6 @@ enum tst_fs_impl {
  */
 enum tst_fs_impl tst_fs_is_supported(const char *fs_type);
 
-/*
- * Returns NULL-terminated array of kernel-supported filesystems.
- *
- * @skiplist A NULL terminated array of filesystems to skip.
- */
-const char **tst_get_supported_fs_types(const char *const *skiplist);
-
 /*
  * Returns 1 if filesystem is in skiplist 0 otherwise.
  *
diff --git a/include/tst_private.h b/include/tst_private.h
index 4c6479f4b..292f7e936 100644
--- a/include/tst_private.h
+++ b/include/tst_private.h
@@ -47,4 +47,11 @@ char tst_kconfig_get(const char *confname);
  */
 int tst_check_cmd(const char *cmd, const int brk_nosupp);
 
+/*
+ * Returns NULL-terminated array of kernel-supported filesystems.
+ *
+ * @skiplist A NULL terminated array of filesystems to skip.
+ */
+const char **tst_get_supported_fs_types(const char *const *skiplist);
+
 #endif
diff --git a/lib/tst_supported_fs_types.c b/lib/tst_supported_fs_types.c
index 46165ebc6..bbd5a5fb4 100644
--- a/lib/tst_supported_fs_types.c
+++ b/lib/tst_supported_fs_types.c
@@ -14,6 +14,7 @@
 #define TST_NO_DEFAULT_MAIN
 #include "tst_test.h"
 #include "tst_fs.h"
+#include "tst_private.h"
 
 /*
  * NOTE: new filesystem should be also added to
diff --git a/testcases/lib/tst_supported_fs.c b/testcases/lib/tst_supported_fs.c
index 1832154f0..af02a9ccb 100644
--- a/testcases/lib/tst_supported_fs.c
+++ b/testcases/lib/tst_supported_fs.c
@@ -14,6 +14,7 @@
 #define TST_NO_DEFAULT_MAIN
 #include "tst_test.h"
 #include "tst_fs.h"
+#include "tst_private.h"
 
 #define err_exit(...) ({ \
 	fprintf(stderr, __VA_ARGS__); \
-- 
2.49.0



More information about the ltp mailing list