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