diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2016-08-03 00:05:02 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-08-03 02:35:16 +0300 |
commit | a66dfb0a91c211c77b5d4e503d3e760e2e566189 (patch) | |
tree | dfb792395b32499bd1c9e7175e103a5b1c693bb0 /fs/nilfs2/nilfs.h | |
parent | cae3d4ca6fd6872d8e9c21eff0e56398c938100a (diff) | |
download | linux-a66dfb0a91c211c77b5d4e503d3e760e2e566189.tar.xz |
nilfs2: add nilfs_msg() message interface
Define an own output routine to replace bare use of printk() function.
The output routine is implemented with a macro and a helper function,
which are named nilfs_msg() and __nilfs_msg(), respectively.
__nilfs_msg() formats a message like "NILFS (<device-name>): <message>",
prefixing it with a given log level, and terminates the statement with a
newline. The "device-name" is optional to make it available in early
stages; it will be omitted if a NULL pointer is passed to super block
instance argument. nilfs_msg() wraps __nilfs_msg() and is removed if
CONFIG_PRINTK is not set.
Link: http://lkml.kernel.org/r/1464875891-5443-3-git-send-email-konishi.ryusuke@lab.ntt.co.jp
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nilfs2/nilfs.h')
-rw-r--r-- | fs/nilfs2/nilfs.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/nilfs2/nilfs.h b/fs/nilfs2/nilfs.h index e482c78bcc86..b57ce41e8a1a 100644 --- a/fs/nilfs2/nilfs.h +++ b/fs/nilfs2/nilfs.h @@ -301,6 +301,9 @@ extern struct inode *nilfs_alloc_inode(struct super_block *); extern void nilfs_destroy_inode(struct inode *); extern __printf(3, 4) +void __nilfs_msg(struct super_block *sb, const char *level, + const char *fmt, ...); +extern __printf(3, 4) void __nilfs_error(struct super_block *sb, const char *function, const char *fmt, ...); extern __printf(3, 4) @@ -308,11 +311,15 @@ void nilfs_warning(struct super_block *, const char *, const char *, ...); #ifdef CONFIG_PRINTK +#define nilfs_msg(sb, level, fmt, ...) \ + __nilfs_msg(sb, level, fmt, ##__VA_ARGS__) #define nilfs_error(sb, fmt, ...) \ __nilfs_error(sb, __func__, fmt, ##__VA_ARGS__) #else +#define nilfs_msg(sb, level, fmt, ...) \ + no_printk(fmt, ##__VA_ARGS__) #define nilfs_error(sb, fmt, ...) \ do { \ no_printk(fmt, ##__VA_ARGS__); \ |