Skip to content

Commit 6e268f5

Browse files
committed
libvnme: Remove __nvme_msg from export map
nvme-cli was using the library infrastructure for logging. In the meantime this has been removed, hence we can remove this function from the export map. Furthermore, move nvme_msg() and __nvme_msg() to private header. Signed-off-by: Daniel Wagner <[email protected]>
1 parent 36c1a8e commit 6e268f5

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

src/libnvme.map

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
LIBNVME_1_0 {
22
global:
3-
__nvme_msg;
43
nvme_admin_passthru64;
54
nvme_admin_passthru;
65
nvme_attach_ns;

src/nvme/json.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include "fabrics.h"
1616
#include "log.h"
17+
#include "private.h"
1718

1819
#define json_object_add_value_string(o, k, v) \
1920
json_object_object_add(o, k, json_object_new_string(v))

src/nvme/log.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,6 @@
1515
# define DEFAULT_LOGLEVEL LOG_NOTICE
1616
#endif
1717

18-
#if (LOG_FUNCNAME == 1)
19-
#define __nvme_log_func __func__
20-
#else
21-
#define __nvme_log_func NULL
22-
#endif
23-
24-
void __attribute__((format(printf, 4, 5)))
25-
__nvme_msg(nvme_root_t r, int lvl, const char *func, const char *format, ...);
26-
27-
#define nvme_msg(r, lvl, format, ...) \
28-
do { \
29-
if ((lvl) <= MAX_LOGLEVEL) \
30-
__nvme_msg(r, lvl, __nvme_log_func, \
31-
format, ##__VA_ARGS__); \
32-
} while (0)
33-
3418
/**
3519
* nvme_init_logging() - initialize logging
3620
* @r: nvme_root_t context

src/nvme/private.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,20 @@ void json_read_config(nvme_root_t r, const char *config_file);
133133

134134
int json_update_config(nvme_root_t r, const char *config_file);
135135

136+
#if (LOG_FUNCNAME == 1)
137+
#define __nvme_log_func __func__
138+
#else
139+
#define __nvme_log_func NULL
140+
#endif
141+
142+
void __attribute__((format(printf, 4, 5)))
143+
__nvme_msg(nvme_root_t r, int lvl, const char *func, const char *format, ...);
144+
145+
#define nvme_msg(r, lvl, format, ...) \
146+
do { \
147+
if ((lvl) <= MAX_LOGLEVEL) \
148+
__nvme_msg(r, lvl, __nvme_log_func, \
149+
format, ##__VA_ARGS__); \
150+
} while (0)
151+
136152
#endif /* _LIBNVME_PRIVATE_H */

0 commit comments

Comments
 (0)