scoutfs: add scoutfs_bug_on()

Add a BUG_ON() wrapper that identifies the file system via the super
block and prints the condition and some additional formatted output.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2018-03-27 12:44:27 -07:00
committed by Mark Swan
parent 4b413ed804
commit 704714c2ee

View File

@@ -15,4 +15,12 @@ void __printf(4, 5) scoutfs_msg(struct super_block *sb, const char *prefix,
#define scoutfs_info(sb, fmt, args...) \
scoutfs_msg(sb, KERN_INFO, "", fmt, ##args)
#define scoutfs_bug_on(sb, cond, fmt, args...) \
do { \
if (cond) { \
scoutfs_err(sb, "(" __stringify(cond) "), " fmt, ##args); \
BUG(); \
} \
} while (0) \
#endif