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 | e631ddb | 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 */ |
Artem B. Bityutskiy | 81e39cf | 2005-09-14 17:57:35 +0100 | [diff] [blame] | 73 | #define JFFS2_DBG_PREFIX "[JFFS2 DBG]" |
| 74 | #define JFFS2_ERR_PREFIX "JFFS2 error:" |
| 75 | #define JFFS2_WARN_PREFIX "JFFS2 warning:" |
| 76 | #define JFFS2_NOTICE_PREFIX "JFFS2 notice:" |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 77 | |
Artem B. Bityutskiy | 81e39cf | 2005-09-14 17:57:35 +0100 | [diff] [blame] | 78 | #define JFFS2_ERR KERN_ERR |
| 79 | #define JFFS2_WARN KERN_WARNING |
| 80 | #define JFFS2_NOT KERN_NOTICE |
| 81 | #define JFFS2_DBG KERN_DEBUG |
| 82 | |
| 83 | #define JFFS2_DBG_MSG_PREFIX JFFS2_DBG JFFS2_DBG_PREFIX |
| 84 | #define JFFS2_ERR_MSG_PREFIX JFFS2_ERR JFFS2_ERR_PREFIX |
| 85 | #define JFFS2_WARN_MSG_PREFIX JFFS2_WARN JFFS2_WARN_PREFIX |
| 86 | #define JFFS2_NOTICE_MSG_PREFIX JFFS2_NOT JFFS2_NOTICE_PREFIX |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 87 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 88 | /* JFFS2 message macros */ |
| 89 | #define JFFS2_ERROR(fmt, ...) \ |
| 90 | do { \ |
Artem B. Bityutskiy | 81e39cf | 2005-09-14 17:57:35 +0100 | [diff] [blame] | 91 | printk(JFFS2_ERR_MSG_PREFIX \ |
Pavel Emelyanov | ba25f9d | 2007-10-18 23:40:40 -0700 | [diff] [blame] | 92 | " (%d) %s: " fmt, task_pid_nr(current), \ |
Harvey Harrison | 8e24eea | 2008-04-30 00:55:09 -0700 | [diff] [blame] | 93 | __func__ , ##__VA_ARGS__); \ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 94 | } while(0) |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 95 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 96 | #define JFFS2_WARNING(fmt, ...) \ |
| 97 | do { \ |
Artem B. Bityutskiy | 81e39cf | 2005-09-14 17:57:35 +0100 | [diff] [blame] | 98 | printk(JFFS2_WARN_MSG_PREFIX \ |
Pavel Emelyanov | ba25f9d | 2007-10-18 23:40:40 -0700 | [diff] [blame] | 99 | " (%d) %s: " fmt, task_pid_nr(current), \ |
Harvey Harrison | 8e24eea | 2008-04-30 00:55:09 -0700 | [diff] [blame] | 100 | __func__ , ##__VA_ARGS__); \ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 101 | } while(0) |
Thomas Gleixner | 182ec4e | 2005-11-07 11:16:07 +0000 | [diff] [blame] | 102 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 103 | #define JFFS2_NOTICE(fmt, ...) \ |
| 104 | do { \ |
Artem B. Bityutskiy | 81e39cf | 2005-09-14 17:57:35 +0100 | [diff] [blame] | 105 | printk(JFFS2_NOTICE_MSG_PREFIX \ |
Pavel Emelyanov | ba25f9d | 2007-10-18 23:40:40 -0700 | [diff] [blame] | 106 | " (%d) %s: " fmt, task_pid_nr(current), \ |
Harvey Harrison | 8e24eea | 2008-04-30 00:55:09 -0700 | [diff] [blame] | 107 | __func__ , ##__VA_ARGS__); \ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 108 | } while(0) |
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 | #define JFFS2_DEBUG(fmt, ...) \ |
| 111 | do { \ |
Artem B. Bityutskiy | 81e39cf | 2005-09-14 17:57:35 +0100 | [diff] [blame] | 112 | printk(JFFS2_DBG_MSG_PREFIX \ |
Pavel Emelyanov | ba25f9d | 2007-10-18 23:40:40 -0700 | [diff] [blame] | 113 | " (%d) %s: " fmt, task_pid_nr(current), \ |
Harvey Harrison | 8e24eea | 2008-04-30 00:55:09 -0700 | [diff] [blame] | 114 | __func__ , ##__VA_ARGS__); \ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 115 | } while(0) |
| 116 | |
Thomas Gleixner | 182ec4e | 2005-11-07 11:16:07 +0000 | [diff] [blame] | 117 | /* |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 118 | * We split our debugging messages on several parts, depending on the JFFS2 |
| 119 | * subsystem the message belongs to. |
| 120 | */ |
| 121 | /* Read inode debugging messages */ |
| 122 | #ifdef JFFS2_DBG_READINODE_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 123 | #define dbg_readinode(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 124 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 125 | #define dbg_readinode(fmt, ...) |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 126 | #endif |
David Woodhouse | 2c61cb2 | 2008-04-23 16:43:15 +0100 | [diff] [blame] | 127 | #ifdef JFFS2_DBG_READINODE2_MESSAGES |
| 128 | #define dbg_readinode2(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
| 129 | #else |
| 130 | #define dbg_readinode2(fmt, ...) |
| 131 | #endif |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 132 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 133 | /* Fragtree build debugging messages */ |
| 134 | #ifdef JFFS2_DBG_FRAGTREE_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 135 | #define dbg_fragtree(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 136 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 137 | #define dbg_fragtree(fmt, ...) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 138 | #endif |
Artem B. Bityutskiy | e0e3006 | 2005-07-31 10:08:41 +0100 | [diff] [blame] | 139 | #ifdef JFFS2_DBG_FRAGTREE2_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 140 | #define dbg_fragtree2(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Artem B. Bityutskiy | e0e3006 | 2005-07-31 10:08:41 +0100 | [diff] [blame] | 141 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 142 | #define dbg_fragtree2(fmt, ...) |
Artem B. Bityutskiy | e0e3006 | 2005-07-31 10:08:41 +0100 | [diff] [blame] | 143 | #endif |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 144 | |
| 145 | /* Directory entry list manilulation debugging messages */ |
| 146 | #ifdef JFFS2_DBG_DENTLIST_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 147 | #define dbg_dentlist(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_dentlist(fmt, ...) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 150 | #endif |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 151 | |
Artem B. Bityutskiy | f538c96 | 2005-07-27 15:16:57 +0100 | [diff] [blame] | 152 | /* Print the messages about manipulating node_refs */ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 153 | #ifdef JFFS2_DBG_NODEREF_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 154 | #define dbg_noderef(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 155 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 156 | #define dbg_noderef(fmt, ...) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 157 | #endif |
| 158 | |
Artem B. Bityutskiy | f538c96 | 2005-07-27 15:16:57 +0100 | [diff] [blame] | 159 | /* Manipulations with the list of inodes (JFFS2 inocache) */ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 160 | #ifdef JFFS2_DBG_INOCACHE_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 161 | #define dbg_inocache(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 162 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 163 | #define dbg_inocache(fmt, ...) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 164 | #endif |
| 165 | |
Ferenc Havasi | e631ddb | 2005-09-07 09:35:26 +0100 | [diff] [blame] | 166 | /* Summary debugging messages */ |
| 167 | #ifdef JFFS2_DBG_SUMMARY_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 168 | #define dbg_summary(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Ferenc Havasi | e631ddb | 2005-09-07 09:35:26 +0100 | [diff] [blame] | 169 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 170 | #define dbg_summary(fmt, ...) |
| 171 | #endif |
| 172 | |
| 173 | /* File system build messages */ |
| 174 | #ifdef JFFS2_DBG_FSBUILD_MESSAGES |
| 175 | #define dbg_fsbuild(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
| 176 | #else |
| 177 | #define dbg_fsbuild(fmt, ...) |
Ferenc Havasi | e631ddb | 2005-09-07 09:35:26 +0100 | [diff] [blame] | 178 | #endif |
| 179 | |
Artem B. Bityutskiy | f538c96 | 2005-07-27 15:16:57 +0100 | [diff] [blame] | 180 | /* Watch the object allocations */ |
| 181 | #ifdef JFFS2_DBG_MEMALLOC_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 182 | #define dbg_memalloc(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Artem B. Bityutskiy | f538c96 | 2005-07-27 15:16:57 +0100 | [diff] [blame] | 183 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 184 | #define dbg_memalloc(fmt, ...) |
Artem B. Bityutskiy | f538c96 | 2005-07-27 15:16:57 +0100 | [diff] [blame] | 185 | #endif |
| 186 | |
KaiGai Kohei | aa98d7c | 2006-05-13 15:09:47 +0900 | [diff] [blame] | 187 | /* Watch the XATTR subsystem */ |
| 188 | #ifdef JFFS2_DBG_XATTR_MESSAGES |
| 189 | #define dbg_xattr(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
| 190 | #else |
| 191 | #define dbg_xattr(fmt, ...) |
| 192 | #endif |
Artem B. Bityutskiy | f538c96 | 2005-07-27 15:16:57 +0100 | [diff] [blame] | 193 | |
Artem B. Bityutskiy | 45ca1b5 | 2005-08-05 12:43:47 +0100 | [diff] [blame] | 194 | /* "Sanity" checks */ |
| 195 | void |
| 196 | __jffs2_dbg_acct_sanity_check_nolock(struct jffs2_sb_info *c, |
| 197 | struct jffs2_eraseblock *jeb); |
| 198 | void |
| 199 | __jffs2_dbg_acct_sanity_check(struct jffs2_sb_info *c, |
| 200 | struct jffs2_eraseblock *jeb); |
| 201 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 202 | /* "Paranoia" checks */ |
| 203 | void |
| 204 | __jffs2_dbg_fragtree_paranoia_check(struct jffs2_inode_info *f); |
| 205 | void |
| 206 | __jffs2_dbg_fragtree_paranoia_check_nolock(struct jffs2_inode_info *f); |
| 207 | void |
| 208 | __jffs2_dbg_acct_paranoia_check(struct jffs2_sb_info *c, |
| 209 | struct jffs2_eraseblock *jeb); |
| 210 | void |
| 211 | __jffs2_dbg_acct_paranoia_check_nolock(struct jffs2_sb_info *c, |
| 212 | struct jffs2_eraseblock *jeb); |
| 213 | void |
| 214 | __jffs2_dbg_prewrite_paranoia_check(struct jffs2_sb_info *c, |
| 215 | uint32_t ofs, int len); |
| 216 | |
| 217 | /* "Dump" functions */ |
| 218 | void |
| 219 | __jffs2_dbg_dump_jeb(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); |
| 220 | void |
| 221 | __jffs2_dbg_dump_jeb_nolock(struct jffs2_eraseblock *jeb); |
| 222 | void |
| 223 | __jffs2_dbg_dump_block_lists(struct jffs2_sb_info *c); |
| 224 | void |
| 225 | __jffs2_dbg_dump_block_lists_nolock(struct jffs2_sb_info *c); |
| 226 | void |
| 227 | __jffs2_dbg_dump_node_refs(struct jffs2_sb_info *c, |
| 228 | struct jffs2_eraseblock *jeb); |
| 229 | void |
| 230 | __jffs2_dbg_dump_node_refs_nolock(struct jffs2_sb_info *c, |
| 231 | struct jffs2_eraseblock *jeb); |
| 232 | void |
| 233 | __jffs2_dbg_dump_fragtree(struct jffs2_inode_info *f); |
| 234 | void |
| 235 | __jffs2_dbg_dump_fragtree_nolock(struct jffs2_inode_info *f); |
| 236 | void |
| 237 | __jffs2_dbg_dump_buffer(unsigned char *buf, int len, uint32_t offs); |
| 238 | void |
| 239 | __jffs2_dbg_dump_node(struct jffs2_sb_info *c, uint32_t ofs); |
| 240 | |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 241 | #ifdef JFFS2_DBG_PARANOIA_CHECKS |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 242 | #define jffs2_dbg_fragtree_paranoia_check(f) \ |
| 243 | __jffs2_dbg_fragtree_paranoia_check(f) |
| 244 | #define jffs2_dbg_fragtree_paranoia_check_nolock(f) \ |
| 245 | __jffs2_dbg_fragtree_paranoia_check_nolock(f) |
| 246 | #define jffs2_dbg_acct_paranoia_check(c, jeb) \ |
| 247 | __jffs2_dbg_acct_paranoia_check(c,jeb) |
| 248 | #define jffs2_dbg_acct_paranoia_check_nolock(c, jeb) \ |
| 249 | __jffs2_dbg_acct_paranoia_check_nolock(c,jeb) |
| 250 | #define jffs2_dbg_prewrite_paranoia_check(c, ofs, len) \ |
| 251 | __jffs2_dbg_prewrite_paranoia_check(c, ofs, len) |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 252 | #else |
| 253 | #define jffs2_dbg_fragtree_paranoia_check(f) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 254 | #define jffs2_dbg_fragtree_paranoia_check_nolock(f) |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 255 | #define jffs2_dbg_acct_paranoia_check(c, jeb) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 256 | #define jffs2_dbg_acct_paranoia_check_nolock(c, jeb) |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 257 | #define jffs2_dbg_prewrite_paranoia_check(c, ofs, len) |
| 258 | #endif /* !JFFS2_PARANOIA_CHECKS */ |
| 259 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 260 | #ifdef JFFS2_DBG_DUMPS |
| 261 | #define jffs2_dbg_dump_jeb(c, jeb) \ |
| 262 | __jffs2_dbg_dump_jeb(c, jeb); |
| 263 | #define jffs2_dbg_dump_jeb_nolock(jeb) \ |
| 264 | __jffs2_dbg_dump_jeb_nolock(jeb); |
| 265 | #define jffs2_dbg_dump_block_lists(c) \ |
| 266 | __jffs2_dbg_dump_block_lists(c) |
| 267 | #define jffs2_dbg_dump_block_lists_nolock(c) \ |
| 268 | __jffs2_dbg_dump_block_lists_nolock(c) |
| 269 | #define jffs2_dbg_dump_fragtree(f) \ |
| 270 | __jffs2_dbg_dump_fragtree(f); |
| 271 | #define jffs2_dbg_dump_fragtree_nolock(f) \ |
| 272 | __jffs2_dbg_dump_fragtree_nolock(f); |
| 273 | #define jffs2_dbg_dump_buffer(buf, len, offs) \ |
| 274 | __jffs2_dbg_dump_buffer(*buf, len, offs); |
| 275 | #define jffs2_dbg_dump_node(c, ofs) \ |
| 276 | __jffs2_dbg_dump_node(c, ofs); |
| 277 | #else |
| 278 | #define jffs2_dbg_dump_jeb(c, jeb) |
| 279 | #define jffs2_dbg_dump_jeb_nolock(jeb) |
| 280 | #define jffs2_dbg_dump_block_lists(c) |
| 281 | #define jffs2_dbg_dump_block_lists_nolock(c) |
| 282 | #define jffs2_dbg_dump_fragtree(f) |
| 283 | #define jffs2_dbg_dump_fragtree_nolock(f) |
| 284 | #define jffs2_dbg_dump_buffer(buf, len, offs) |
| 285 | #define jffs2_dbg_dump_node(c, ofs) |
| 286 | #endif /* !JFFS2_DBG_DUMPS */ |
| 287 | |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 288 | #ifdef JFFS2_DBG_SANITY_CHECKS |
Artem B. Bityutskiy | 45ca1b5 | 2005-08-05 12:43:47 +0100 | [diff] [blame] | 289 | #define jffs2_dbg_acct_sanity_check(c, jeb) \ |
| 290 | __jffs2_dbg_acct_sanity_check(c, jeb) |
| 291 | #define jffs2_dbg_acct_sanity_check_nolock(c, jeb) \ |
| 292 | __jffs2_dbg_acct_sanity_check_nolock(c, jeb) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 293 | #else |
| 294 | #define jffs2_dbg_acct_sanity_check(c, jeb) |
| 295 | #define jffs2_dbg_acct_sanity_check_nolock(c, jeb) |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 296 | #endif /* !JFFS2_DBG_SANITY_CHECKS */ |
| 297 | |
| 298 | #endif /* _JFFS2_DEBUG_H_ */ |