Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * debug.h - NTFS kernel debug support. Part of the Linux-NTFS project.
0004  *
0005  * Copyright (c) 2001-2004 Anton Altaparmakov
0006  */
0007 
0008 #ifndef _LINUX_NTFS_DEBUG_H
0009 #define _LINUX_NTFS_DEBUG_H
0010 
0011 #include <linux/fs.h>
0012 
0013 #include "runlist.h"
0014 
0015 #ifdef DEBUG
0016 
0017 extern int debug_msgs;
0018 
0019 extern __printf(4, 5)
0020 void __ntfs_debug(const char *file, int line, const char *function,
0021           const char *format, ...);
0022 /**
0023  * ntfs_debug - write a debug level message to syslog
0024  * @f:      a printf format string containing the message
0025  * @...:    the variables to substitute into @f
0026  *
0027  * ntfs_debug() writes a DEBUG level message to the syslog but only if the
0028  * driver was compiled with -DDEBUG. Otherwise, the call turns into a NOP.
0029  */
0030 #define ntfs_debug(f, a...)                     \
0031     __ntfs_debug(__FILE__, __LINE__, __func__, f, ##a)
0032 
0033 extern void ntfs_debug_dump_runlist(const runlist_element *rl);
0034 
0035 #else   /* !DEBUG */
0036 
0037 #define ntfs_debug(fmt, ...)                        \
0038 do {                                    \
0039     if (0)                              \
0040         no_printk(fmt, ##__VA_ARGS__);              \
0041 } while (0)
0042 
0043 #define ntfs_debug_dump_runlist(rl) do {} while (0)
0044 
0045 #endif  /* !DEBUG */
0046 
0047 extern  __printf(3, 4)
0048 void __ntfs_warning(const char *function, const struct super_block *sb,
0049             const char *fmt, ...);
0050 #define ntfs_warning(sb, f, a...)   __ntfs_warning(__func__, sb, f, ##a)
0051 
0052 extern  __printf(3, 4)
0053 void __ntfs_error(const char *function, const struct super_block *sb,
0054           const char *fmt, ...);
0055 #define ntfs_error(sb, f, a...)     __ntfs_error(__func__, sb, f, ##a)
0056 
0057 #endif /* _LINUX_NTFS_DEBUG_H */