summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@kernel.org>2024-02-14 18:25:14 -0500
committerMike Snitzer <snitzer@kernel.org>2024-02-20 13:43:19 -0500
commit1e00d57694bc2f050f73b632ce3822fe28af63d2 (patch)
treed2daf930215696564c0c47bbe0e85c4d28cdc5f9 /drivers/md
parent318a9ce59bfaf47d23b7e80eb8c2697281108a5f (diff)
downloadlinux-stable-1e00d57694bc2f050f73b632ce3822fe28af63d2.tar.gz
linux-stable-1e00d57694bc2f050f73b632ce3822fe28af63d2.tar.bz2
linux-stable-1e00d57694bc2f050f73b632ce3822fe28af63d2.zip
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: Mike Snitzer <snitzer@kernel.org> Signed-off-by: Bruce Johnston <bjohnsto@redhat.com> Signed-off-by: Matthew Sakai <msakai@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-vdo/logger.c10
-rw-r--r--drivers/md/dm-vdo/logger.h8
2 files changed, 8 insertions, 10 deletions
diff --git a/drivers/md/dm-vdo/logger.c b/drivers/md/dm-vdo/logger.c
index 322224a07cf5..1efbf8d52f2c 100644
--- a/drivers/md/dm-vdo/logger.c
+++ b/drivers/md/dm-vdo/logger.c
@@ -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);
diff --git a/drivers/md/dm-vdo/logger.h b/drivers/md/dm-vdo/logger.h
index 09d448ff9ca9..4e2f18042ba7 100644
--- a/drivers/md/dm-vdo/logger.h
+++ b/drivers/md/dm-vdo/logger.h
@@ -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, ...) \