|
@@ -3814,6 +3814,22 @@ void btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...)
|
|
|
#define btrfs_debug(fs_info, fmt, args...) \
|
|
|
btrfs_printk(fs_info, KERN_DEBUG fmt, ##args)
|
|
|
|
|
|
+#ifdef CONFIG_BTRFS_ASSERT
|
|
|
+
|
|
|
+static inline void assfail(char *expr, char *file, int line)
|
|
|
+{
|
|
|
+ printk(KERN_ERR "BTRFS assertion failed: %s, file: %s, line: %d",
|
|
|
+ expr, file, line);
|
|
|
+ BUG();
|
|
|
+}
|
|
|
+
|
|
|
+#define ASSERT(expr) \
|
|
|
+ (likely(expr) ? (void)0 : assfail(#expr, __FILE__, __LINE__))
|
|
|
+#else
|
|
|
+#define ASSERT(expr) ((void)0)
|
|
|
+#endif
|
|
|
+
|
|
|
+#define btrfs_assert()
|
|
|
__printf(5, 6)
|
|
|
void __btrfs_std_error(struct btrfs_fs_info *fs_info, const char *function,
|
|
|
unsigned int line, int errno, const char *fmt, ...);
|