summaryrefslogtreecommitdiffstats
path: root/include/linux/device-mapper.h
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2017-04-20 13:46:07 -0400
committerMike Snitzer <snitzer@redhat.com>2017-06-19 11:03:50 -0400
commitd2c3c8dcb5987b8352e82089c79a41b6e17e28d2 (patch)
treea9a3b736ee8ddb6b8f44aae99479897a781270c2 /include/linux/device-mapper.h
parent7e3fd855ad66ffc0dd926911da23dd21e59f9462 (diff)
dm: convert DM printk macros to pr_<level> macros
Using pr_<level> is the more common logging style. Standardize style and use new macro DM_FMT. Use no_printk in DMDEBUG macros when CONFIG_DM_DEBUG is not #defined. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'include/linux/device-mapper.h')
-rw-r--r--include/linux/device-mapper.h71
1 files changed, 32 insertions, 39 deletions
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 456da5017b32..19bc7fdfd6da 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -543,48 +543,41 @@ extern struct ratelimit_state dm_ratelimit_state;
543#define dm_ratelimit() 0 543#define dm_ratelimit() 0
544#endif 544#endif
545 545
546#define DMCRIT(f, arg...) \ 546#define DM_FMT(fmt) DM_NAME ": " DM_MSG_PREFIX ": " fmt "\n"
547 printk(KERN_CRIT DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) 547
548 548#define DMCRIT(fmt, ...) pr_crit(DM_FMT(fmt), ##__VA_ARGS__)
549#define DMERR(f, arg...) \ 549
550 printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) 550#define DMERR(fmt, ...) pr_err(DM_FMT(fmt), ##__VA_ARGS__)
551#define DMERR_LIMIT(f, arg...) \ 551#define DMERR_LIMIT(fmt, ...) \
552 do { \ 552do { \
553 if (dm_ratelimit()) \ 553 if (dm_ratelimit()) \
554 printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " \ 554 DMERR(fmt, ##__VA_ARGS__); \
555 f "\n", ## arg); \ 555} while (0)
556 } while (0) 556
557 557#define DMWARN(fmt, ...) pr_warn(DM_FMT(fmt), ##__VA_ARGS__)
558#define DMWARN(f, arg...) \ 558#define DMWARN_LIMIT(fmt, ...) \
559 printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) 559do { \
560#define DMWARN_LIMIT(f, arg...) \ 560 if (dm_ratelimit()) \
561 do { \ 561 DMWARN(fmt, ##__VA_ARGS__); \
562 if (dm_ratelimit()) \ 562} while (0)
563 printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " \ 563
564 f "\n", ## arg); \ 564#define DMINFO(fmt, ...) pr_info(DM_FMT(fmt), ##__VA_ARGS__)
565 } while (0) 565#define DMINFO_LIMIT(fmt, ...) \
566 566do { \
567#define DMINFO(f, arg...) \ 567 if (dm_ratelimit()) \
568 printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) 568 DMINFO(fmt, ##__VA_ARGS__); \
569#define DMINFO_LIMIT(f, arg...) \ 569} while (0)
570 do { \
571 if (dm_ratelimit()) \
572 printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f \
573 "\n", ## arg); \
574 } while (0)
575 570
576#ifdef CONFIG_DM_DEBUG 571#ifdef CONFIG_DM_DEBUG
577# define DMDEBUG(f, arg...) \ 572#define DMDEBUG(fmt, ...) printk(KERN_DEBUG DM_FMT(fmt), ##__VA_ARGS__)
578 printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX " DEBUG: " f "\n", ## arg) 573#define DMDEBUG_LIMIT(fmt, ...) \
579# define DMDEBUG_LIMIT(f, arg...) \ 574do { \
580 do { \ 575 if (dm_ratelimit()) \
581 if (dm_ratelimit()) \ 576 DMDEBUG(fmt, ##__VA_ARGS__); \
582 printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX ": " f \ 577} while (0)
583 "\n", ## arg); \
584 } while (0)
585#else 578#else
586# define DMDEBUG(f, arg...) do {} while (0) 579#define DMDEBUG(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
587# define DMDEBUG_LIMIT(f, arg...) do {} while (0) 580#define DMDEBUG_LIMIT(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
588#endif 581#endif
589 582
590#define DMEMIT(x...) sz += ((sz >= maxlen) ? \ 583#define DMEMIT(x...) sz += ((sz >= maxlen) ? \