public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] include: Move new API only functions to new API header
@ 2024-01-02 22:39 Petr Vorel
  2024-01-02 22:39 ` [LTP] [PATCH 2/2] tst_fs_setup.c: Add tst_ prefix to new API functions Petr Vorel
  0 siblings, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2024-01-02 22:39 UTC (permalink / raw)
  To: ltp

create_overlay_dirs() and mount_overlay() were implemented only in new
API (and we are not planning to use them in legacy API), thus remove
them from legacy API header.

Fixes: a88bbb43d ("lib: add helpers to setup overlayfs mountpoint")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 include/safe_file_ops_fn.h  | 4 ----
 include/tst_safe_file_ops.h | 6 ++++++
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/include/safe_file_ops_fn.h b/include/safe_file_ops_fn.h
index aa6420d90..223fb0d68 100644
--- a/include/safe_file_ops_fn.h
+++ b/include/safe_file_ops_fn.h
@@ -90,8 +90,4 @@ int safe_touch(const char *file, const int lineno,
 		const char *pathname,
 		mode_t mode, const struct timespec times[2]);
 
-/* helper functions to setup overlayfs mountpoint */
-void create_overlay_dirs(void);
-int mount_overlay(const char *file, const int lineno, int strict);
-
 #endif /* SAFE_FILE_OPS_FN */
diff --git a/include/tst_safe_file_ops.h b/include/tst_safe_file_ops.h
index 62f6600ec..401f6ee25 100644
--- a/include/tst_safe_file_ops.h
+++ b/include/tst_safe_file_ops.h
@@ -56,6 +56,12 @@
 	safe_touch(__FILE__, __LINE__, NULL, \
 			(pathname), (mode), (times))
 
+/* 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);
+
 #define SAFE_MOUNT_OVERLAY() \
 	((void) mount_overlay(__FILE__, __LINE__, 1))
 
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [LTP] [PATCH 2/2] tst_fs_setup.c: Add tst_ prefix to new API functions
  2024-01-02 22:39 [LTP] [PATCH 1/2] include: Move new API only functions to new API header Petr Vorel
@ 2024-01-02 22:39 ` Petr Vorel
  2024-02-26 14:20   ` Cyril Hrubis
  2024-03-13 14:12   ` Martin Doucha
  0 siblings, 2 replies; 5+ messages in thread
From: Petr Vorel @ 2024-01-02 22:39 UTC (permalink / raw)
  To: ltp

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


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [LTP] [PATCH 2/2] tst_fs_setup.c: Add tst_ prefix to new API functions
  2024-01-02 22:39 ` [LTP] [PATCH 2/2] tst_fs_setup.c: Add tst_ prefix to new API functions Petr Vorel
@ 2024-02-26 14:20   ` Cyril Hrubis
  2024-03-13 14:12   ` Martin Doucha
  1 sibling, 0 replies; 5+ messages in thread
From: Cyril Hrubis @ 2024-02-26 14:20 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Hi!
> 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.

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [LTP] [PATCH 2/2] tst_fs_setup.c: Add tst_ prefix to new API functions
  2024-01-02 22:39 ` [LTP] [PATCH 2/2] tst_fs_setup.c: Add tst_ prefix to new API functions Petr Vorel
  2024-02-26 14:20   ` Cyril Hrubis
@ 2024-03-13 14:12   ` Martin Doucha
  2024-03-13 21:15     ` Petr Vorel
  1 sibling, 1 reply; 5+ messages in thread
From: Martin Doucha @ 2024-03-13 14:12 UTC (permalink / raw)
  To: Petr Vorel, ltp

Hi,
for both patches:
Reviewed-by: Martin Doucha <mdoucha@suse.cz>

On 02. 01. 24 23:39, Petr Vorel wrote:
> 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)

-- 
Martin Doucha   mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [LTP] [PATCH 2/2] tst_fs_setup.c: Add tst_ prefix to new API functions
  2024-03-13 14:12   ` Martin Doucha
@ 2024-03-13 21:15     ` Petr Vorel
  0 siblings, 0 replies; 5+ messages in thread
From: Petr Vorel @ 2024-03-13 21:15 UTC (permalink / raw)
  To: Martin Doucha; +Cc: ltp

Hi Martin,

> Hi,
> for both patches:
> Reviewed-by: Martin Doucha <mdoucha@suse.cz>

Thanks, merged!

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-13 21:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-02 22:39 [LTP] [PATCH 1/2] include: Move new API only functions to new API header Petr Vorel
2024-01-02 22:39 ` [LTP] [PATCH 2/2] tst_fs_setup.c: Add tst_ prefix to new API functions Petr Vorel
2024-02-26 14:20   ` Cyril Hrubis
2024-03-13 14:12   ` Martin Doucha
2024-03-13 21:15     ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox