[LTP] [PATCH 2/2] tst_fs_setup.c: Add tst_ prefix to new API functions

Petr Vorel pvorel@suse.cz
Tue Jan 2 23:39:35 CET 2024


To fix our warning due not following our policy:
tst_fs_setup.c:14:6: warning: LTP-003: Symbol 'create_overlay_dirs' is a public library function, but is missing the 'tst_' prefix
tst_fs_setup.c:27:5: warning: LTP-003: Symbol 'mount_overlay' is a public library function, but is missing the 'tst_' prefix

+ Fix missing blank line.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 include/tst_safe_file_ops.h | 8 ++++----
 lib/tst_fs_setup.c          | 7 ++++---
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/include/tst_safe_file_ops.h b/include/tst_safe_file_ops.h
index 401f6ee25..0d8819594 100644
--- a/include/tst_safe_file_ops.h
+++ b/include/tst_safe_file_ops.h
@@ -59,13 +59,13 @@
 /* New API only functions */
 
 /* helper functions to setup overlayfs mountpoint */
-void create_overlay_dirs(void);
-int mount_overlay(const char *file, const int lineno, int strict);
+void tst_create_overlay_dirs(void);
+int tst_mount_overlay(const char *file, const int lineno, int strict);
 
 #define SAFE_MOUNT_OVERLAY() \
-	((void) mount_overlay(__FILE__, __LINE__, 1))
+	((void) tst_mount_overlay(__FILE__, __LINE__, 1))
 
 #define TST_MOUNT_OVERLAY() \
-	(mount_overlay(__FILE__, __LINE__, 0) == 0)
+	(tst_mount_overlay(__FILE__, __LINE__, 0) == 0)
 
 #endif /* TST_SAFE_FILE_OPS */
diff --git a/lib/tst_fs_setup.c b/lib/tst_fs_setup.c
index aaa8f3bc9..d3284a145 100644
--- a/lib/tst_fs_setup.c
+++ b/lib/tst_fs_setup.c
@@ -11,9 +11,10 @@
 #define TST_FS_SETUP_OVERLAYFS_MSG "overlayfs is not configured in this kernel"
 #define TST_FS_SETUP_OVERLAYFS_CONFIG "lowerdir="OVL_LOWER",upperdir="OVL_UPPER",workdir="OVL_WORK
 
-void create_overlay_dirs(void)
+void tst_create_overlay_dirs(void)
 {
 	DIR *dir = opendir(OVL_LOWER);
+
 	if (dir == NULL) {
 		SAFE_MKDIR(OVL_LOWER, 0755);
 		SAFE_MKDIR(OVL_UPPER, 0755);
@@ -24,11 +25,11 @@ void create_overlay_dirs(void)
 	closedir(dir);
 }
 
-int mount_overlay(const char *file, const int lineno, int strict)
+int tst_mount_overlay(const char *file, const int lineno, int strict)
 {
 	int ret;
 
-	create_overlay_dirs();
+	tst_create_overlay_dirs();
 	ret = mount("overlay", OVL_MNT, "overlay", 0,
 				TST_FS_SETUP_OVERLAYFS_CONFIG);
 	if (ret == 0)
-- 
2.43.0



More information about the ltp mailing list