Skip to content

Commit

Permalink
tst_fs_setup.c: Add tst_ prefix to new API functions
Browse files Browse the repository at this point in the history
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.

Link: https://lore.kernel.org/ltp/[email protected]/
Reviewed-by: Cyril Hrubis <[email protected]>
Reviewed-by: Martin Doucha <[email protected]>
Signed-off-by: Petr Vorel <[email protected]>
  • Loading branch information
pevik committed Mar 13, 2024
1 parent b78078e commit f21f1e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions include/tst_safe_file_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
7 changes: 4 additions & 3 deletions lib/tst_fs_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
Expand Down

0 comments on commit f21f1e4

Please sign in to comment.