diff options
author | Joe Perches <joe@perches.com> | 2016-03-27 17:34:52 -0400 |
---|---|---|
committer | Mike Marshall <hubcap@omnibond.com> | 2016-04-08 14:10:45 -0400 |
commit | 1917a6932870062778e3099eb432795d45918fc3 (patch) | |
tree | ddb90b56a6cea5e1ea52caacb4e3c100673311c6 | |
parent | 2eacea74cc465edc23ce5a4dd5c2213008ac3a05 (diff) |
orangefs: Add KERN_<LEVEL> to gossip_<level> macros
Emit the logging messages at the appropriate levels.
Miscellanea:
o Change format to fmt
o Use the more common ##__VA_ARGS__
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
-rw-r--r-- | fs/orangefs/protocol.h | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/fs/orangefs/protocol.h b/fs/orangefs/protocol.h index a7f21a3b2d02..1efc6f8a5224 100644 --- a/fs/orangefs/protocol.h +++ b/fs/orangefs/protocol.h | |||
@@ -1,3 +1,4 @@ | |||
1 | #include <linux/kernel.h> | ||
1 | #include <linux/types.h> | 2 | #include <linux/types.h> |
2 | #include <linux/spinlock_types.h> | 3 | #include <linux/spinlock_types.h> |
3 | #include <linux/slab.h> | 4 | #include <linux/slab.h> |
@@ -427,26 +428,28 @@ struct ORANGEFS_dev_map_desc { | |||
427 | /* gossip.h *****************************************************************/ | 428 | /* gossip.h *****************************************************************/ |
428 | 429 | ||
429 | #ifdef GOSSIP_DISABLE_DEBUG | 430 | #ifdef GOSSIP_DISABLE_DEBUG |
430 | #define gossip_debug(mask, format, f...) do {} while (0) | 431 | #define gossip_debug(mask, fmt, ...) \ |
432 | do { \ | ||
433 | if (0) \ | ||
434 | printk(KERN_DEBUG fmt, ##__VA_ARGS__); \ | ||
435 | } while (0) | ||
431 | #else | 436 | #else |
432 | extern __u64 gossip_debug_mask; | 437 | extern __u64 gossip_debug_mask; |
433 | extern struct client_debug_mask client_debug_mask; | 438 | extern struct client_debug_mask client_debug_mask; |
434 | 439 | ||
435 | /* try to avoid function call overhead by checking masks in macro */ | 440 | /* try to avoid function call overhead by checking masks in macro */ |
436 | #define gossip_debug(mask, format, f...) \ | 441 | #define gossip_debug(mask, fmt, ...) \ |
437 | do { \ | 442 | do { \ |
438 | if (gossip_debug_mask & mask) \ | 443 | if (gossip_debug_mask & (mask)) \ |
439 | printk(format, ##f); \ | 444 | printk(KERN_DEBUG fmt, ##__VA_ARGS__); \ |
440 | } while (0) | 445 | } while (0) |
441 | #endif /* GOSSIP_DISABLE_DEBUG */ | 446 | #endif /* GOSSIP_DISABLE_DEBUG */ |
442 | 447 | ||
443 | /* do file and line number printouts w/ the GNU preprocessor */ | 448 | /* do file and line number printouts w/ the GNU preprocessor */ |
444 | #define gossip_ldebug(mask, format, f...) \ | 449 | #define gossip_ldebug(mask, fmt, ...) \ |
445 | gossip_debug(mask, "%s: " format, __func__, ##f) | 450 | gossip_debug(mask, "%s: " fmt, __func__, ##__VA_ARGS__) |
446 | 451 | ||
447 | #define gossip_err printk | 452 | #define gossip_err pr_err |
448 | #define gossip_lerr(format, f...) \ | 453 | #define gossip_lerr(fmt, ...) \ |
449 | gossip_err("%s line %d: " format, \ | 454 | gossip_err("%s line %d: " fmt, \ |
450 | __FILE__, \ | 455 | __FILE__, __LINE__, ##__VA_ARGS__) |
451 | __LINE__, \ | ||
452 | ##f) | ||