2 * Copyright (c) International Business Machines Corp., 2000-2002
3 * Portions Copyright (c) Christoph Hellwig, 2001-2002
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
13 * the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 * global debug message, data structure/macro definitions
26 * under control of CONFIG_JFS_DEBUG, CONFIG_JFS_STATISTICS;
30 * Create /proc/fs/jfs if procfs is enabled andeither
31 * CONFIG_JFS_DEBUG or CONFIG_JFS_STATISTICS is defined
33 #if defined(CONFIG_PROC_FS) && (defined(CONFIG_JFS_DEBUG) || defined(CONFIG_JFS_STATISTICS))
38 * assert with traditional printf/panic
40 #ifdef CONFIG_KERNEL_ASSERTS
42 #define assert(p) KERNEL_ASSERT(#p, p)
47 printk("assert(%s)\n",#p);\
57 #ifdef CONFIG_JFS_DEBUG
58 #define ASSERT(p) assert(p)
60 /* dump memory contents */
61 extern void dump_mem(char *label, void *data, int length);
62 extern int jfsloglevel;
64 /* information message: e.g., configuration, major event */
65 #define jFYI(button, prspec) \
66 do { if (button && jfsloglevel > 1) printk prspec; } while (0)
68 /* error event message: e.g., i/o error */
70 #define jERROR(button, prspec) \
71 do { if (button && jfsloglevel > 0) { printk prspec; } } while (0)
73 /* debug event message: */
74 #define jEVENT(button,prspec) \
75 do { if (button) printk prspec; } while (0)
81 #else /* CONFIG_JFS_DEBUG */
82 #define dump_mem(label,data,length)
84 #define jEVENT(button,prspec)
85 #define jERROR(button,prspec)
86 #define jFYI(button,prspec)
87 #endif /* CONFIG_JFS_DEBUG */
93 #ifdef CONFIG_JFS_STATISTICS
94 #define INCREMENT(x) ((x)++)
95 #define DECREMENT(x) ((x)--)
96 #define HIGHWATERMARK(x,y) ((x) = max((x), (y)))
100 #define HIGHWATERMARK(x,y)
101 #endif /* CONFIG_JFS_STATISTICS */
103 #endif /* _H_JFS_DEBUG */