Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 1 | /* |
| 2 | * JFFS2 -- Journalling Flash File System, Version 2. |
| 3 | * |
David Woodhouse | c00c310 | 2007-04-25 14:16:47 +0100 | [diff] [blame] | 4 | * Copyright © 2001-2007 Red Hat, Inc. |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 5 | * |
| 6 | * Created by David Woodhouse <dwmw2@infradead.org> |
| 7 | * |
| 8 | * For licensing information, see the file 'LICENCE' in this directory. |
| 9 | * |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 10 | */ |
David Woodhouse | c00c310 | 2007-04-25 14:16:47 +0100 | [diff] [blame] | 11 | |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 12 | #ifndef _JFFS2_DEBUG_H_ |
| 13 | #define _JFFS2_DEBUG_H_ |
| 14 | |
David Woodhouse | e499e01 | 2007-01-13 08:19:03 +0800 | [diff] [blame] | 15 | #include <linux/sched.h> |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 16 | |
| 17 | #ifndef CONFIG_JFFS2_FS_DEBUG |
Artem B. Bityutskiy | f538c96 | 2005-07-27 15:16:57 +0100 | [diff] [blame] | 18 | #define CONFIG_JFFS2_FS_DEBUG 0 |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 19 | #endif |
| 20 | |
Artem B. Bityutskiy | 008531f | 2005-10-24 17:22:36 +0100 | [diff] [blame] | 21 | #if CONFIG_JFFS2_FS_DEBUG > 0 |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 22 | /* Enable "paranoia" checks and dumps */ |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 23 | #define JFFS2_DBG_PARANOIA_CHECKS |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 24 | #define JFFS2_DBG_DUMPS |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 25 | |
Thomas Gleixner | 182ec4e | 2005-11-07 11:16:07 +0000 | [diff] [blame] | 26 | /* |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 27 | * By defining/undefining the below macros one may select debugging messages |
| 28 | * fro specific JFFS2 subsystems. |
| 29 | */ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 30 | #define JFFS2_DBG_READINODE_MESSAGES |
| 31 | #define JFFS2_DBG_FRAGTREE_MESSAGES |
| 32 | #define JFFS2_DBG_DENTLIST_MESSAGES |
| 33 | #define JFFS2_DBG_NODEREF_MESSAGES |
| 34 | #define JFFS2_DBG_INOCACHE_MESSAGES |
Ferenc Havasi | e631ddb | 2005-09-07 09:35:26 +0100 | [diff] [blame] | 35 | #define JFFS2_DBG_SUMMARY_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 36 | #define JFFS2_DBG_FSBUILD_MESSAGES |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 37 | #endif |
| 38 | |
Artem B. Bityutskiy | 008531f | 2005-10-24 17:22:36 +0100 | [diff] [blame] | 39 | #if CONFIG_JFFS2_FS_DEBUG > 1 |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 40 | #define JFFS2_DBG_FRAGTREE2_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 41 | #define JFFS2_DBG_MEMALLOC_MESSAGES |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 42 | #endif |
| 43 | |
Artem B. Bityutskiy | 45ca1b5 | 2005-08-05 12:43:47 +0100 | [diff] [blame] | 44 | /* Sanity checks are supposed to be light-weight and enabled by default */ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 45 | #define JFFS2_DBG_SANITY_CHECKS |
| 46 | |
Thomas Gleixner | 182ec4e | 2005-11-07 11:16:07 +0000 | [diff] [blame] | 47 | /* |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 48 | * Dx() are mainly used for debugging messages, they must go away and be |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 49 | * superseded by nicer dbg_xxx() macros... |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 50 | */ |
| 51 | #if CONFIG_JFFS2_FS_DEBUG > 0 |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 52 | #define D1(x) x |
| 53 | #else |
| 54 | #define D1(x) |
| 55 | #endif |
| 56 | |
| 57 | #if CONFIG_JFFS2_FS_DEBUG > 1 |
| 58 | #define D2(x) x |
| 59 | #else |
| 60 | #define D2(x) |
| 61 | #endif |
| 62 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 63 | /* The prefixes of JFFS2 messages */ |
Artem B. Bityutskiy | 81e39cf | 2005-09-14 17:57:35 +0100 | [diff] [blame] | 64 | #define JFFS2_DBG_PREFIX "[JFFS2 DBG]" |
| 65 | #define JFFS2_ERR_PREFIX "JFFS2 error:" |
| 66 | #define JFFS2_WARN_PREFIX "JFFS2 warning:" |
| 67 | #define JFFS2_NOTICE_PREFIX "JFFS2 notice:" |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 68 | |
Artem B. Bityutskiy | 81e39cf | 2005-09-14 17:57:35 +0100 | [diff] [blame] | 69 | #define JFFS2_ERR KERN_ERR |
| 70 | #define JFFS2_WARN KERN_WARNING |
| 71 | #define JFFS2_NOT KERN_NOTICE |
| 72 | #define JFFS2_DBG KERN_DEBUG |
| 73 | |
| 74 | #define JFFS2_DBG_MSG_PREFIX JFFS2_DBG JFFS2_DBG_PREFIX |
| 75 | #define JFFS2_ERR_MSG_PREFIX JFFS2_ERR JFFS2_ERR_PREFIX |
| 76 | #define JFFS2_WARN_MSG_PREFIX JFFS2_WARN JFFS2_WARN_PREFIX |
| 77 | #define JFFS2_NOTICE_MSG_PREFIX JFFS2_NOT JFFS2_NOTICE_PREFIX |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 78 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 79 | /* JFFS2 message macros */ |
| 80 | #define JFFS2_ERROR(fmt, ...) \ |
| 81 | do { \ |
Artem B. Bityutskiy | 81e39cf | 2005-09-14 17:57:35 +0100 | [diff] [blame] | 82 | printk(JFFS2_ERR_MSG_PREFIX \ |
Pavel Emelyanov | ba25f9d | 2007-10-18 23:40:40 -0700 | [diff] [blame] | 83 | " (%d) %s: " fmt, task_pid_nr(current), \ |
Andrew Morton | 02b7068 | 2005-11-23 13:37:47 -0800 | [diff] [blame] | 84 | __FUNCTION__ , ##__VA_ARGS__); \ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 85 | } while(0) |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 86 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 87 | #define JFFS2_WARNING(fmt, ...) \ |
| 88 | do { \ |
Artem B. Bityutskiy | 81e39cf | 2005-09-14 17:57:35 +0100 | [diff] [blame] | 89 | printk(JFFS2_WARN_MSG_PREFIX \ |
Pavel Emelyanov | ba25f9d | 2007-10-18 23:40:40 -0700 | [diff] [blame] | 90 | " (%d) %s: " fmt, task_pid_nr(current), \ |
Andrew Morton | 02b7068 | 2005-11-23 13:37:47 -0800 | [diff] [blame] | 91 | __FUNCTION__ , ##__VA_ARGS__); \ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 92 | } while(0) |
Thomas Gleixner | 182ec4e | 2005-11-07 11:16:07 +0000 | [diff] [blame] | 93 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 94 | #define JFFS2_NOTICE(fmt, ...) \ |
| 95 | do { \ |
Artem B. Bityutskiy | 81e39cf | 2005-09-14 17:57:35 +0100 | [diff] [blame] | 96 | printk(JFFS2_NOTICE_MSG_PREFIX \ |
Pavel Emelyanov | ba25f9d | 2007-10-18 23:40:40 -0700 | [diff] [blame] | 97 | " (%d) %s: " fmt, task_pid_nr(current), \ |
Andrew Morton | 02b7068 | 2005-11-23 13:37:47 -0800 | [diff] [blame] | 98 | __FUNCTION__ , ##__VA_ARGS__); \ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 99 | } while(0) |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 100 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 101 | #define JFFS2_DEBUG(fmt, ...) \ |
| 102 | do { \ |
Artem B. Bityutskiy | 81e39cf | 2005-09-14 17:57:35 +0100 | [diff] [blame] | 103 | printk(JFFS2_DBG_MSG_PREFIX \ |
Pavel Emelyanov | ba25f9d | 2007-10-18 23:40:40 -0700 | [diff] [blame] | 104 | " (%d) %s: " fmt, task_pid_nr(current), \ |
Andrew Morton | 02b7068 | 2005-11-23 13:37:47 -0800 | [diff] [blame] | 105 | __FUNCTION__ , ##__VA_ARGS__); \ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 106 | } while(0) |
| 107 | |
Thomas Gleixner | 182ec4e | 2005-11-07 11:16:07 +0000 | [diff] [blame] | 108 | /* |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 109 | * We split our debugging messages on several parts, depending on the JFFS2 |
| 110 | * subsystem the message belongs to. |
| 111 | */ |
| 112 | /* Read inode debugging messages */ |
| 113 | #ifdef JFFS2_DBG_READINODE_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 114 | #define dbg_readinode(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 115 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 116 | #define dbg_readinode(fmt, ...) |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 117 | #endif |
| 118 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 119 | /* Fragtree build debugging messages */ |
| 120 | #ifdef JFFS2_DBG_FRAGTREE_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 121 | #define dbg_fragtree(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 122 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 123 | #define dbg_fragtree(fmt, ...) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 124 | #endif |
Artem B. Bityutskiy | e0e3006 | 2005-07-31 10:08:41 +0100 | [diff] [blame] | 125 | #ifdef JFFS2_DBG_FRAGTREE2_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 126 | #define dbg_fragtree2(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Artem B. Bityutskiy | e0e3006 | 2005-07-31 10:08:41 +0100 | [diff] [blame] | 127 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 128 | #define dbg_fragtree2(fmt, ...) |
Artem B. Bityutskiy | e0e3006 | 2005-07-31 10:08:41 +0100 | [diff] [blame] | 129 | #endif |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 130 | |
| 131 | /* Directory entry list manilulation debugging messages */ |
| 132 | #ifdef JFFS2_DBG_DENTLIST_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 133 | #define dbg_dentlist(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 134 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 135 | #define dbg_dentlist(fmt, ...) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 136 | #endif |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 137 | |
Artem B. Bityutskiy | f538c96 | 2005-07-27 15:16:57 +0100 | [diff] [blame] | 138 | /* Print the messages about manipulating node_refs */ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 139 | #ifdef JFFS2_DBG_NODEREF_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 140 | #define dbg_noderef(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 141 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 142 | #define dbg_noderef(fmt, ...) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 143 | #endif |
| 144 | |
Artem B. Bityutskiy | f538c96 | 2005-07-27 15:16:57 +0100 | [diff] [blame] | 145 | /* Manipulations with the list of inodes (JFFS2 inocache) */ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 146 | #ifdef JFFS2_DBG_INOCACHE_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 147 | #define dbg_inocache(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 148 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 149 | #define dbg_inocache(fmt, ...) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 150 | #endif |
| 151 | |
Ferenc Havasi | e631ddb | 2005-09-07 09:35:26 +0100 | [diff] [blame] | 152 | /* Summary debugging messages */ |
| 153 | #ifdef JFFS2_DBG_SUMMARY_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 154 | #define dbg_summary(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Ferenc Havasi | e631ddb | 2005-09-07 09:35:26 +0100 | [diff] [blame] | 155 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 156 | #define dbg_summary(fmt, ...) |
| 157 | #endif |
| 158 | |
| 159 | /* File system build messages */ |
| 160 | #ifdef JFFS2_DBG_FSBUILD_MESSAGES |
| 161 | #define dbg_fsbuild(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
| 162 | #else |
| 163 | #define dbg_fsbuild(fmt, ...) |
Ferenc Havasi | e631ddb | 2005-09-07 09:35:26 +0100 | [diff] [blame] | 164 | #endif |
| 165 | |
Artem B. Bityutskiy | f538c96 | 2005-07-27 15:16:57 +0100 | [diff] [blame] | 166 | /* Watch the object allocations */ |
| 167 | #ifdef JFFS2_DBG_MEMALLOC_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 168 | #define dbg_memalloc(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Artem B. Bityutskiy | f538c96 | 2005-07-27 15:16:57 +0100 | [diff] [blame] | 169 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 170 | #define dbg_memalloc(fmt, ...) |
Artem B. Bityutskiy | f538c96 | 2005-07-27 15:16:57 +0100 | [diff] [blame] | 171 | #endif |
| 172 | |
KaiGai Kohei | aa98d7c | 2006-05-13 15:09:47 +0900 | [diff] [blame] | 173 | /* Watch the XATTR subsystem */ |
| 174 | #ifdef JFFS2_DBG_XATTR_MESSAGES |
| 175 | #define dbg_xattr(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
| 176 | #else |
| 177 | #define dbg_xattr(fmt, ...) |
| 178 | #endif |
Artem B. Bityutskiy | f538c96 | 2005-07-27 15:16:57 +0100 | [diff] [blame] | 179 | |
Artem B. Bityutskiy | 45ca1b5 | 2005-08-05 12:43:47 +0100 | [diff] [blame] | 180 | /* "Sanity" checks */ |
| 181 | void |
| 182 | __jffs2_dbg_acct_sanity_check_nolock(struct jffs2_sb_info *c, |
| 183 | struct jffs2_eraseblock *jeb); |
| 184 | void |
| 185 | __jffs2_dbg_acct_sanity_check(struct jffs2_sb_info *c, |
| 186 | struct jffs2_eraseblock *jeb); |
| 187 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 188 | /* "Paranoia" checks */ |
| 189 | void |
| 190 | __jffs2_dbg_fragtree_paranoia_check(struct jffs2_inode_info *f); |
| 191 | void |
| 192 | __jffs2_dbg_fragtree_paranoia_check_nolock(struct jffs2_inode_info *f); |
| 193 | void |
| 194 | __jffs2_dbg_acct_paranoia_check(struct jffs2_sb_info *c, |
| 195 | struct jffs2_eraseblock *jeb); |
| 196 | void |
| 197 | __jffs2_dbg_acct_paranoia_check_nolock(struct jffs2_sb_info *c, |
| 198 | struct jffs2_eraseblock *jeb); |
| 199 | void |
| 200 | __jffs2_dbg_prewrite_paranoia_check(struct jffs2_sb_info *c, |
| 201 | uint32_t ofs, int len); |
| 202 | |
| 203 | /* "Dump" functions */ |
| 204 | void |
| 205 | __jffs2_dbg_dump_jeb(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); |
| 206 | void |
| 207 | __jffs2_dbg_dump_jeb_nolock(struct jffs2_eraseblock *jeb); |
| 208 | void |
| 209 | __jffs2_dbg_dump_block_lists(struct jffs2_sb_info *c); |
| 210 | void |
| 211 | __jffs2_dbg_dump_block_lists_nolock(struct jffs2_sb_info *c); |
| 212 | void |
| 213 | __jffs2_dbg_dump_node_refs(struct jffs2_sb_info *c, |
| 214 | struct jffs2_eraseblock *jeb); |
| 215 | void |
| 216 | __jffs2_dbg_dump_node_refs_nolock(struct jffs2_sb_info *c, |
| 217 | struct jffs2_eraseblock *jeb); |
| 218 | void |
| 219 | __jffs2_dbg_dump_fragtree(struct jffs2_inode_info *f); |
| 220 | void |
| 221 | __jffs2_dbg_dump_fragtree_nolock(struct jffs2_inode_info *f); |
| 222 | void |
| 223 | __jffs2_dbg_dump_buffer(unsigned char *buf, int len, uint32_t offs); |
| 224 | void |
| 225 | __jffs2_dbg_dump_node(struct jffs2_sb_info *c, uint32_t ofs); |
| 226 | |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 227 | #ifdef JFFS2_DBG_PARANOIA_CHECKS |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 228 | #define jffs2_dbg_fragtree_paranoia_check(f) \ |
| 229 | __jffs2_dbg_fragtree_paranoia_check(f) |
| 230 | #define jffs2_dbg_fragtree_paranoia_check_nolock(f) \ |
| 231 | __jffs2_dbg_fragtree_paranoia_check_nolock(f) |
| 232 | #define jffs2_dbg_acct_paranoia_check(c, jeb) \ |
| 233 | __jffs2_dbg_acct_paranoia_check(c,jeb) |
| 234 | #define jffs2_dbg_acct_paranoia_check_nolock(c, jeb) \ |
| 235 | __jffs2_dbg_acct_paranoia_check_nolock(c,jeb) |
| 236 | #define jffs2_dbg_prewrite_paranoia_check(c, ofs, len) \ |
| 237 | __jffs2_dbg_prewrite_paranoia_check(c, ofs, len) |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 238 | #else |
| 239 | #define jffs2_dbg_fragtree_paranoia_check(f) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 240 | #define jffs2_dbg_fragtree_paranoia_check_nolock(f) |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 241 | #define jffs2_dbg_acct_paranoia_check(c, jeb) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 242 | #define jffs2_dbg_acct_paranoia_check_nolock(c, jeb) |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 243 | #define jffs2_dbg_prewrite_paranoia_check(c, ofs, len) |
| 244 | #endif /* !JFFS2_PARANOIA_CHECKS */ |
| 245 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 246 | #ifdef JFFS2_DBG_DUMPS |
| 247 | #define jffs2_dbg_dump_jeb(c, jeb) \ |
| 248 | __jffs2_dbg_dump_jeb(c, jeb); |
| 249 | #define jffs2_dbg_dump_jeb_nolock(jeb) \ |
| 250 | __jffs2_dbg_dump_jeb_nolock(jeb); |
| 251 | #define jffs2_dbg_dump_block_lists(c) \ |
| 252 | __jffs2_dbg_dump_block_lists(c) |
| 253 | #define jffs2_dbg_dump_block_lists_nolock(c) \ |
| 254 | __jffs2_dbg_dump_block_lists_nolock(c) |
| 255 | #define jffs2_dbg_dump_fragtree(f) \ |
| 256 | __jffs2_dbg_dump_fragtree(f); |
| 257 | #define jffs2_dbg_dump_fragtree_nolock(f) \ |
| 258 | __jffs2_dbg_dump_fragtree_nolock(f); |
| 259 | #define jffs2_dbg_dump_buffer(buf, len, offs) \ |
| 260 | __jffs2_dbg_dump_buffer(*buf, len, offs); |
| 261 | #define jffs2_dbg_dump_node(c, ofs) \ |
| 262 | __jffs2_dbg_dump_node(c, ofs); |
| 263 | #else |
| 264 | #define jffs2_dbg_dump_jeb(c, jeb) |
| 265 | #define jffs2_dbg_dump_jeb_nolock(jeb) |
| 266 | #define jffs2_dbg_dump_block_lists(c) |
| 267 | #define jffs2_dbg_dump_block_lists_nolock(c) |
| 268 | #define jffs2_dbg_dump_fragtree(f) |
| 269 | #define jffs2_dbg_dump_fragtree_nolock(f) |
| 270 | #define jffs2_dbg_dump_buffer(buf, len, offs) |
| 271 | #define jffs2_dbg_dump_node(c, ofs) |
| 272 | #endif /* !JFFS2_DBG_DUMPS */ |
| 273 | |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 274 | #ifdef JFFS2_DBG_SANITY_CHECKS |
Artem B. Bityutskiy | 45ca1b5 | 2005-08-05 12:43:47 +0100 | [diff] [blame] | 275 | #define jffs2_dbg_acct_sanity_check(c, jeb) \ |
| 276 | __jffs2_dbg_acct_sanity_check(c, jeb) |
| 277 | #define jffs2_dbg_acct_sanity_check_nolock(c, jeb) \ |
| 278 | __jffs2_dbg_acct_sanity_check_nolock(c, jeb) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 279 | #else |
| 280 | #define jffs2_dbg_acct_sanity_check(c, jeb) |
| 281 | #define jffs2_dbg_acct_sanity_check_nolock(c, jeb) |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 282 | #endif /* !JFFS2_DBG_SANITY_CHECKS */ |
| 283 | |
| 284 | #endif /* _JFFS2_DEBUG_H_ */ |