Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Joe Perches and committed by
Mike Marshall
1917a693 2eacea74

+16 -13
+16 -13
fs/orangefs/protocol.h
··· 1 + #include <linux/kernel.h> 1 2 #include <linux/types.h> 2 3 #include <linux/spinlock_types.h> 3 4 #include <linux/slab.h> ··· 428 427 /* gossip.h *****************************************************************/ 429 428 430 429 #ifdef GOSSIP_DISABLE_DEBUG 431 - #define gossip_debug(mask, format, f...) do {} while (0) 430 + #define gossip_debug(mask, fmt, ...) \ 431 + do { \ 432 + if (0) \ 433 + printk(KERN_DEBUG fmt, ##__VA_ARGS__); \ 434 + } while (0) 432 435 #else 433 436 extern __u64 gossip_debug_mask; 434 437 extern struct client_debug_mask client_debug_mask; 435 438 436 439 /* try to avoid function call overhead by checking masks in macro */ 437 - #define gossip_debug(mask, format, f...) \ 438 - do { \ 439 - if (gossip_debug_mask & mask) \ 440 - printk(format, ##f); \ 440 + #define gossip_debug(mask, fmt, ...) \ 441 + do { \ 442 + if (gossip_debug_mask & (mask)) \ 443 + printk(KERN_DEBUG fmt, ##__VA_ARGS__); \ 441 444 } while (0) 442 445 #endif /* GOSSIP_DISABLE_DEBUG */ 443 446 444 447 /* do file and line number printouts w/ the GNU preprocessor */ 445 - #define gossip_ldebug(mask, format, f...) \ 446 - gossip_debug(mask, "%s: " format, __func__, ##f) 448 + #define gossip_ldebug(mask, fmt, ...) \ 449 + gossip_debug(mask, "%s: " fmt, __func__, ##__VA_ARGS__) 447 450 448 - #define gossip_err printk 449 - #define gossip_lerr(format, f...) \ 450 - gossip_err("%s line %d: " format, \ 451 - __FILE__, \ 452 - __LINE__, \ 453 - ##f) 451 + #define gossip_err pr_err 452 + #define gossip_lerr(fmt, ...) \ 453 + gossip_err("%s line %d: " fmt, \ 454 + __FILE__, __LINE__, ##__VA_ARGS__)