[LTP] [PATCH v4] lib: LTP_SINGLE_FS_TYPE and LTP_FORCE_SINGLE_FS_TYPE
Cyril Hrubis
chrubis@suse.cz
Tue May 27 13:16:55 CEST 2025
Hi!
> > That's right, just confirmed with Cyril, so far we need to do nothing
> > unless tst_get_supported_fs_types() is abused somewhere.
>
> Abusing the function should be prevented if Cyril adds before merge 'static'
> keyword to the function (as I suggested earlier).
That's a different function and that is going to be static in the final
patch.
This is the function that is called from tst_test.c and I guess that we
can remove it from the tst_fs.h in order to make sure nobody tries to
misuse it. That would look like:
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/lib/tst_internal.h b/lib/tst_internal.h
new file mode 100644
index 000000000..a0ae733f6
--- /dev/null
+++ b/lib/tst_internal.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (c) 2015-2025 Cyril Hrubis <chrubis@suse.cz>
+ * Copyright (c) Linux Test Project, 2017-2025
+ */
+
+#ifndef TST_INTERNAL_H__
+#define TST_INTERNAL_H__
+
+/*
+ * 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 /* TST_INTERNAL_H__ */
diff --git a/lib/tst_supported_fs_types.c b/lib/tst_supported_fs_types.c
index 46165ebc6..cc5522a08 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_internal.h"
/*
* NOTE: new filesystem should be also added to
diff --git a/lib/tst_test.c b/lib/tst_test.c
index 45fc28498..f62cc195a 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -38,6 +38,7 @@
#include "old_device.h"
#include "old_tmpdir.h"
#include "ltp-version.h"
+#include "tst_internal.h"
/*
* Hack to get TCID defined in newlib tests
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list