Commit 1e00d576 authored by Mike Snitzer's avatar Mike Snitzer

dm vdo logger: update logging to start with "device-mapper: vdo"

Stops short of actually using DM's various logging macros (e.g. DMERR,
DMINFO, etc) because VDO's logger isn't quite compatible with them.

Also switch emit_log_message_to_kernel() from open-coding printk with
log-level to using corresponding pr_ macro.
Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
Signed-off-by: default avatarBruce Johnston <bjohnsto@redhat.com>
Signed-off-by: default avatarMatthew Sakai <msakai@redhat.com>
parent 318a9ce5
......@@ -115,20 +115,20 @@ static void emit_log_message_to_kernel(int priority, const char *fmt, ...)
case UDS_LOG_EMERG:
case UDS_LOG_ALERT:
case UDS_LOG_CRIT:
printk(KERN_CRIT "%pV", &vaf);
pr_crit("%pV", &vaf);
break;
case UDS_LOG_ERR:
printk(KERN_ERR "%pV", &vaf);
pr_err("%pV", &vaf);
break;
case UDS_LOG_WARNING:
printk(KERN_WARNING "%pV", &vaf);
pr_warn("%pV", &vaf);
break;
case UDS_LOG_NOTICE:
case UDS_LOG_INFO:
printk(KERN_INFO "%pV", &vaf);
pr_info("%pV", &vaf);
break;
case UDS_LOG_DEBUG:
printk(KERN_DEBUG "%pV", &vaf);
pr_debug("%pV", &vaf);
break;
default:
printk(KERN_DEFAULT "%pV", &vaf);
......
......@@ -8,6 +8,7 @@
#include <linux/module.h>
#include <linux/ratelimit.h>
#include <linux/device-mapper.h>
/* Custom logging utilities for UDS */
......@@ -20,11 +21,8 @@
#define UDS_LOG_INFO 6
#define UDS_LOG_DEBUG 7
#if defined(MODULE)
#define UDS_LOGGING_MODULE_NAME THIS_MODULE->name
#else /* compiled into the kernel */
#define UDS_LOGGING_MODULE_NAME "vdo"
#endif
#define DM_MSG_PREFIX "vdo"
#define UDS_LOGGING_MODULE_NAME DM_NAME ": " DM_MSG_PREFIX
/* Apply a rate limiter to a log method call. */
#define uds_log_ratelimit(log_fn, ...) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment