]>
Commit | Line | Data |
---|---|---|
1e51764a AB |
1 | /* |
2 | * This file is part of UBIFS. | |
3 | * | |
4 | * Copyright (C) 2006-2008 Nokia Corporation. | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify it | |
7 | * under the terms of the GNU General Public License version 2 as published by | |
8 | * the Free Software Foundation. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, but WITHOUT | |
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
13 | * more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License along with | |
16 | * this program; if not, write to the Free Software Foundation, Inc., 51 | |
17 | * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
18 | * | |
19 | * Authors: Artem Bityutskiy (Битюцкий Артём) | |
20 | * Adrian Hunter | |
21 | */ | |
22 | ||
23 | #ifndef __UBIFS_DEBUG_H__ | |
24 | #define __UBIFS_DEBUG_H__ | |
25 | ||
1dcffad7 MR |
26 | /* Checking helper functions */ |
27 | typedef int (*dbg_leaf_callback)(struct ubifs_info *c, | |
28 | struct ubifs_zbranch *zbr, void *priv); | |
29 | typedef int (*dbg_znode_callback)(struct ubifs_info *c, | |
30 | struct ubifs_znode *znode, void *priv); | |
31 | ||
1e51764a AB |
32 | #ifdef CONFIG_UBIFS_FS_DEBUG |
33 | ||
bc3f07f0 AB |
34 | #include <linux/random.h> |
35 | ||
ae380ce0 AB |
36 | /* |
37 | * The UBIFS debugfs directory name pattern and maximum name length (3 for "ubi" | |
38 | * + 1 for "_" and plus 2x2 for 2 UBI numbers and 1 for the trailing zero byte. | |
39 | */ | |
40 | #define UBIFS_DFS_DIR_NAME "ubi%d_%d" | |
41 | #define UBIFS_DFS_DIR_LEN (3 + 1 + 2*2 + 1) | |
42 | ||
17c2f9f8 AB |
43 | /** |
44 | * ubifs_debug_info - per-FS debugging information. | |
17c2f9f8 AB |
45 | * @old_zroot: old index root - used by 'dbg_check_old_index()' |
46 | * @old_zroot_level: old index root level - used by 'dbg_check_old_index()' | |
47 | * @old_zroot_sqnum: old index root sqnum - used by 'dbg_check_old_index()' | |
48 | * @failure_mode: failure mode for recovery testing | |
49 | * @fail_delay: 0=>don't delay, 1=>delay a time, 2=>delay a number of calls | |
50 | * @fail_timeout: time in jiffies when delay of failure mode expires | |
51 | * @fail_cnt: current number of calls to failure mode I/O functions | |
52 | * @fail_cnt_max: number of calls by which to delay failure mode | |
53 | * @chk_lpt_sz: used by LPT tree size checker | |
54 | * @chk_lpt_sz2: used by LPT tree size checker | |
55 | * @chk_lpt_wastage: used by LPT tree size checker | |
56 | * @chk_lpt_lebs: used by LPT tree size checker | |
57 | * @new_nhead_offs: used by LPT tree size checker | |
84abf972 AB |
58 | * @new_ihead_lnum: used by debugging to check @c->ihead_lnum |
59 | * @new_ihead_offs: used by debugging to check @c->ihead_offs | |
552ff317 | 60 | * |
84abf972 | 61 | * @saved_lst: saved lprops statistics (used by 'dbg_save_space_info()') |
f1bd66af AB |
62 | * @saved_bi: saved budgeting information |
63 | * @saved_free: saved amount of free space | |
64 | * @saved_idx_gc_cnt: saved value of @c->idx_gc_cnt | |
84abf972 | 65 | * |
bdc1a1b6 AB |
66 | * @dfs_dir_name: name of debugfs directory containing this file-system's files |
67 | * @dfs_dir: direntry object of the file-system debugfs directory | |
68 | * @dfs_dump_lprops: "dump lprops" debugfs knob | |
69 | * @dfs_dump_budg: "dump budgeting information" debugfs knob | |
70 | * @dfs_dump_tnc: "dump TNC" debugfs knob | |
17c2f9f8 AB |
71 | */ |
72 | struct ubifs_debug_info { | |
17c2f9f8 AB |
73 | struct ubifs_zbranch old_zroot; |
74 | int old_zroot_level; | |
75 | unsigned long long old_zroot_sqnum; | |
76 | int failure_mode; | |
77 | int fail_delay; | |
78 | unsigned long fail_timeout; | |
79 | unsigned int fail_cnt; | |
80 | unsigned int fail_cnt_max; | |
81 | long long chk_lpt_sz; | |
82 | long long chk_lpt_sz2; | |
83 | long long chk_lpt_wastage; | |
84 | int chk_lpt_lebs; | |
85 | int new_nhead_offs; | |
86 | int new_ihead_lnum; | |
87 | int new_ihead_offs; | |
552ff317 | 88 | |
84abf972 | 89 | struct ubifs_lp_stats saved_lst; |
f1bd66af | 90 | struct ubifs_budg_info saved_bi; |
84abf972 | 91 | long long saved_free; |
f1bd66af | 92 | int saved_idx_gc_cnt; |
84abf972 | 93 | |
ae380ce0 | 94 | char dfs_dir_name[UBIFS_DFS_DIR_LEN + 1]; |
84abf972 AB |
95 | struct dentry *dfs_dir; |
96 | struct dentry *dfs_dump_lprops; | |
97 | struct dentry *dfs_dump_budg; | |
98 | struct dentry *dfs_dump_tnc; | |
17c2f9f8 | 99 | }; |
1e51764a | 100 | |
840dc6b8 | 101 | #define ubifs_assert(expr) do { \ |
1e51764a AB |
102 | if (unlikely(!(expr))) { \ |
103 | printk(KERN_CRIT "UBIFS assert failed in %s at %u (pid %d)\n", \ | |
104 | __func__, __LINE__, current->pid); \ | |
105 | dbg_dump_stack(); \ | |
106 | } \ | |
107 | } while (0) | |
108 | ||
109 | #define ubifs_assert_cmt_locked(c) do { \ | |
110 | if (unlikely(down_write_trylock(&(c)->commit_sem))) { \ | |
111 | up_write(&(c)->commit_sem); \ | |
112 | printk(KERN_CRIT "commit lock is not locked!\n"); \ | |
113 | ubifs_assert(0); \ | |
114 | } \ | |
115 | } while (0) | |
116 | ||
ec068142 | 117 | #define dbg_dump_stack() dump_stack() |
1e51764a | 118 | |
1e51764a AB |
119 | #define dbg_err(fmt, ...) do { \ |
120 | spin_lock(&dbg_lock); \ | |
121 | ubifs_err(fmt, ##__VA_ARGS__); \ | |
122 | spin_unlock(&dbg_lock); \ | |
123 | } while (0) | |
124 | ||
125 | const char *dbg_key_str0(const struct ubifs_info *c, | |
126 | const union ubifs_key *key); | |
127 | const char *dbg_key_str1(const struct ubifs_info *c, | |
128 | const union ubifs_key *key); | |
129 | ||
130 | /* | |
840dc6b8 | 131 | * DBGKEY macros require @dbg_lock to be held, which it is in the dbg message |
1e51764a AB |
132 | * macros. |
133 | */ | |
134 | #define DBGKEY(key) dbg_key_str0(c, (key)) | |
135 | #define DBGKEY1(key) dbg_key_str1(c, (key)) | |
136 | ||
56e46742 AB |
137 | #define ubifs_dbg_msg(type, fmt, ...) do { \ |
138 | spin_lock(&dbg_lock); \ | |
139 | pr_debug("UBIFS DBG " type ": " fmt "\n", ##__VA_ARGS__); \ | |
140 | spin_unlock(&dbg_lock); \ | |
141 | } while (0) | |
1e51764a | 142 | |
56e46742 AB |
143 | /* Just a debugging messages not related to any specific UBIFS subsystem */ |
144 | #define dbg_msg(fmt, ...) ubifs_dbg_msg("msg", fmt, ##__VA_ARGS__) | |
145 | /* General messages */ | |
146 | #define dbg_gen(fmt, ...) ubifs_dbg_msg("gen", fmt, ##__VA_ARGS__) | |
1e51764a | 147 | /* Additional journal messages */ |
56e46742 | 148 | #define dbg_jnl(fmt, ...) ubifs_dbg_msg("jnl", fmt, ##__VA_ARGS__) |
1e51764a | 149 | /* Additional TNC messages */ |
56e46742 | 150 | #define dbg_tnc(fmt, ...) ubifs_dbg_msg("tnc", fmt, ##__VA_ARGS__) |
1e51764a | 151 | /* Additional lprops messages */ |
56e46742 | 152 | #define dbg_lp(fmt, ...) ubifs_dbg_msg("lp", fmt, ##__VA_ARGS__) |
1e51764a | 153 | /* Additional LEB find messages */ |
56e46742 | 154 | #define dbg_find(fmt, ...) ubifs_dbg_msg("find", fmt, ##__VA_ARGS__) |
1e51764a | 155 | /* Additional mount messages */ |
56e46742 | 156 | #define dbg_mnt(fmt, ...) ubifs_dbg_msg("mnt", fmt, ##__VA_ARGS__) |
1e51764a | 157 | /* Additional I/O messages */ |
56e46742 | 158 | #define dbg_io(fmt, ...) ubifs_dbg_msg("io", fmt, ##__VA_ARGS__) |
1e51764a | 159 | /* Additional commit messages */ |
56e46742 | 160 | #define dbg_cmt(fmt, ...) ubifs_dbg_msg("cmt", fmt, ##__VA_ARGS__) |
1e51764a | 161 | /* Additional budgeting messages */ |
56e46742 | 162 | #define dbg_budg(fmt, ...) ubifs_dbg_msg("budg", fmt, ##__VA_ARGS__) |
1e51764a | 163 | /* Additional log messages */ |
56e46742 | 164 | #define dbg_log(fmt, ...) ubifs_dbg_msg("log", fmt, ##__VA_ARGS__) |
1e51764a | 165 | /* Additional gc messages */ |
56e46742 | 166 | #define dbg_gc(fmt, ...) ubifs_dbg_msg("gc", fmt, ##__VA_ARGS__) |
1e51764a | 167 | /* Additional scan messages */ |
56e46742 | 168 | #define dbg_scan(fmt, ...) ubifs_dbg_msg("scan", fmt, ##__VA_ARGS__) |
1e51764a | 169 | /* Additional recovery messages */ |
56e46742 | 170 | #define dbg_rcvry(fmt, ...) ubifs_dbg_msg("rcvry", fmt, ##__VA_ARGS__) |
1e51764a | 171 | |
1e51764a | 172 | /* |
5d630e43 | 173 | * Debugging check flags. |
1e51764a AB |
174 | * |
175 | * UBIFS_CHK_GEN: general checks | |
176 | * UBIFS_CHK_TNC: check TNC | |
177 | * UBIFS_CHK_IDX_SZ: check index size | |
178 | * UBIFS_CHK_ORPH: check orphans | |
179 | * UBIFS_CHK_OLD_IDX: check the old index | |
180 | * UBIFS_CHK_LPROPS: check lprops | |
181 | * UBIFS_CHK_FS: check the file-system | |
182 | */ | |
183 | enum { | |
184 | UBIFS_CHK_GEN = 0x1, | |
185 | UBIFS_CHK_TNC = 0x2, | |
186 | UBIFS_CHK_IDX_SZ = 0x4, | |
187 | UBIFS_CHK_ORPH = 0x8, | |
188 | UBIFS_CHK_OLD_IDX = 0x10, | |
189 | UBIFS_CHK_LPROPS = 0x20, | |
190 | UBIFS_CHK_FS = 0x40, | |
191 | }; | |
192 | ||
193 | /* | |
5d630e43 | 194 | * Special testing flags. |
1e51764a | 195 | * |
1e51764a AB |
196 | * UBIFS_TST_RCVRY: failure mode for recovery testing |
197 | */ | |
198 | enum { | |
1e51764a AB |
199 | UBIFS_TST_RCVRY = 0x4, |
200 | }; | |
201 | ||
1e51764a AB |
202 | extern spinlock_t dbg_lock; |
203 | ||
204 | extern unsigned int ubifs_msg_flags; | |
205 | extern unsigned int ubifs_chk_flags; | |
206 | extern unsigned int ubifs_tst_flags; | |
207 | ||
17c2f9f8 AB |
208 | int ubifs_debugging_init(struct ubifs_info *c); |
209 | void ubifs_debugging_exit(struct ubifs_info *c); | |
210 | ||
1e51764a | 211 | /* Dump functions */ |
1e51764a AB |
212 | const char *dbg_ntype(int type); |
213 | const char *dbg_cstate(int cmt_state); | |
77a7ae58 | 214 | const char *dbg_jhead(int jhead); |
1e51764a AB |
215 | const char *dbg_get_key_dump(const struct ubifs_info *c, |
216 | const union ubifs_key *key); | |
4315fb40 | 217 | void dbg_dump_inode(struct ubifs_info *c, const struct inode *inode); |
1e51764a | 218 | void dbg_dump_node(const struct ubifs_info *c, const void *node); |
2ba5f7ae AB |
219 | void dbg_dump_lpt_node(const struct ubifs_info *c, void *node, int lnum, |
220 | int offs); | |
1e51764a AB |
221 | void dbg_dump_budget_req(const struct ubifs_budget_req *req); |
222 | void dbg_dump_lstats(const struct ubifs_lp_stats *lst); | |
f1bd66af | 223 | void dbg_dump_budg(struct ubifs_info *c, const struct ubifs_budg_info *bi); |
1e51764a AB |
224 | void dbg_dump_lprop(const struct ubifs_info *c, const struct ubifs_lprops *lp); |
225 | void dbg_dump_lprops(struct ubifs_info *c); | |
73944a6d | 226 | void dbg_dump_lpt_info(struct ubifs_info *c); |
1e51764a AB |
227 | void dbg_dump_leb(const struct ubifs_info *c, int lnum); |
228 | void dbg_dump_znode(const struct ubifs_info *c, | |
229 | const struct ubifs_znode *znode); | |
230 | void dbg_dump_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat); | |
231 | void dbg_dump_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode, | |
232 | struct ubifs_nnode *parent, int iip); | |
233 | void dbg_dump_tnc(struct ubifs_info *c); | |
234 | void dbg_dump_index(struct ubifs_info *c); | |
2ba5f7ae | 235 | void dbg_dump_lpt_lebs(const struct ubifs_info *c); |
1e51764a | 236 | |
1e51764a AB |
237 | int dbg_walk_index(struct ubifs_info *c, dbg_leaf_callback leaf_cb, |
238 | dbg_znode_callback znode_cb, void *priv); | |
239 | ||
240 | /* Checking functions */ | |
84abf972 AB |
241 | void dbg_save_space_info(struct ubifs_info *c); |
242 | int dbg_check_space_info(struct ubifs_info *c); | |
1e51764a | 243 | int dbg_check_lprops(struct ubifs_info *c); |
1e51764a AB |
244 | int dbg_old_index_check_init(struct ubifs_info *c, struct ubifs_zbranch *zroot); |
245 | int dbg_check_old_index(struct ubifs_info *c, struct ubifs_zbranch *zroot); | |
1e51764a | 246 | int dbg_check_cats(struct ubifs_info *c); |
1e51764a | 247 | int dbg_check_ltab(struct ubifs_info *c); |
73944a6d AH |
248 | int dbg_chk_lpt_free_spc(struct ubifs_info *c); |
249 | int dbg_chk_lpt_sz(struct ubifs_info *c, int action, int len); | |
1e51764a | 250 | int dbg_check_synced_i_size(struct inode *inode); |
1b51e983 | 251 | int dbg_check_dir(struct ubifs_info *c, const struct inode *dir); |
1e51764a | 252 | int dbg_check_tnc(struct ubifs_info *c, int extra); |
1e51764a | 253 | int dbg_check_idx_size(struct ubifs_info *c, long long idx_size); |
1e51764a | 254 | int dbg_check_filesystem(struct ubifs_info *c); |
1e51764a AB |
255 | void dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat, |
256 | int add_pos); | |
1e51764a AB |
257 | int dbg_check_lpt_nodes(struct ubifs_info *c, struct ubifs_cnode *cnode, |
258 | int row, int col); | |
e3c3efc2 AB |
259 | int dbg_check_inode_size(struct ubifs_info *c, const struct inode *inode, |
260 | loff_t size); | |
3bb66b47 AB |
261 | int dbg_check_data_nodes_order(struct ubifs_info *c, struct list_head *head); |
262 | int dbg_check_nondata_nodes_order(struct ubifs_info *c, struct list_head *head); | |
1e51764a AB |
263 | |
264 | /* Force the use of in-the-gaps method for testing */ | |
bc3f07f0 AB |
265 | static inline int dbg_force_in_the_gaps_enabled(void) |
266 | { | |
267 | return ubifs_chk_flags & UBIFS_CHK_GEN; | |
268 | } | |
1e51764a AB |
269 | int dbg_force_in_the_gaps(void); |
270 | ||
271 | /* Failure mode for recovery testing */ | |
1e51764a AB |
272 | #define dbg_failure_mode (ubifs_tst_flags & UBIFS_TST_RCVRY) |
273 | ||
1e51764a | 274 | #ifndef UBIFS_DBG_PRESERVE_UBI |
1e51764a AB |
275 | #define ubi_leb_read dbg_leb_read |
276 | #define ubi_leb_write dbg_leb_write | |
277 | #define ubi_leb_change dbg_leb_change | |
278 | #define ubi_leb_erase dbg_leb_erase | |
279 | #define ubi_leb_unmap dbg_leb_unmap | |
280 | #define ubi_is_mapped dbg_is_mapped | |
281 | #define ubi_leb_map dbg_leb_map | |
1e51764a AB |
282 | #endif |
283 | ||
284 | int dbg_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset, | |
285 | int len, int check); | |
286 | int dbg_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf, | |
287 | int offset, int len, int dtype); | |
288 | int dbg_leb_change(struct ubi_volume_desc *desc, int lnum, const void *buf, | |
289 | int len, int dtype); | |
290 | int dbg_leb_erase(struct ubi_volume_desc *desc, int lnum); | |
291 | int dbg_leb_unmap(struct ubi_volume_desc *desc, int lnum); | |
292 | int dbg_is_mapped(struct ubi_volume_desc *desc, int lnum); | |
293 | int dbg_leb_map(struct ubi_volume_desc *desc, int lnum, int dtype); | |
294 | ||
295 | static inline int dbg_read(struct ubi_volume_desc *desc, int lnum, char *buf, | |
296 | int offset, int len) | |
297 | { | |
298 | return dbg_leb_read(desc, lnum, buf, offset, len, 0); | |
299 | } | |
300 | ||
301 | static inline int dbg_write(struct ubi_volume_desc *desc, int lnum, | |
302 | const void *buf, int offset, int len) | |
303 | { | |
304 | return dbg_leb_write(desc, lnum, buf, offset, len, UBI_UNKNOWN); | |
305 | } | |
306 | ||
307 | static inline int dbg_change(struct ubi_volume_desc *desc, int lnum, | |
308 | const void *buf, int len) | |
309 | { | |
310 | return dbg_leb_change(desc, lnum, buf, len, UBI_UNKNOWN); | |
311 | } | |
312 | ||
552ff317 AB |
313 | /* Debugfs-related stuff */ |
314 | int dbg_debugfs_init(void); | |
315 | void dbg_debugfs_exit(void); | |
316 | int dbg_debugfs_init_fs(struct ubifs_info *c); | |
317 | void dbg_debugfs_exit_fs(struct ubifs_info *c); | |
318 | ||
1e51764a AB |
319 | #else /* !CONFIG_UBIFS_FS_DEBUG */ |
320 | ||
840dc6b8 AB |
321 | /* Use "if (0)" to make compiler check arguments even if debugging is off */ |
322 | #define ubifs_assert(expr) do { \ | |
ae380ce0 | 323 | if (0) \ |
840dc6b8 AB |
324 | printk(KERN_CRIT "UBIFS assert failed in %s at %u (pid %d)\n", \ |
325 | __func__, __LINE__, current->pid); \ | |
326 | } while (0) | |
327 | ||
56e46742 AB |
328 | #define dbg_err(fmt, ...) do { \ |
329 | if (0) \ | |
330 | ubifs_err(fmt, ##__VA_ARGS__); \ | |
840dc6b8 AB |
331 | } while (0) |
332 | ||
56e46742 AB |
333 | #define ubifs_dbg_msg(fmt, ...) do { \ |
334 | if (0) \ | |
335 | pr_debug(fmt "\n", ##__VA_ARGS__); \ | |
840dc6b8 AB |
336 | } while (0) |
337 | ||
1e51764a | 338 | #define dbg_dump_stack() |
840dc6b8 | 339 | #define ubifs_assert_cmt_locked(c) |
1e51764a | 340 | |
56e46742 AB |
341 | #define dbg_msg(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) |
342 | #define dbg_gen(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) | |
343 | #define dbg_jnl(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) | |
344 | #define dbg_tnc(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) | |
345 | #define dbg_lp(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) | |
346 | #define dbg_find(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) | |
347 | #define dbg_mnt(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) | |
348 | #define dbg_io(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) | |
349 | #define dbg_cmt(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) | |
350 | #define dbg_budg(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) | |
351 | #define dbg_log(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) | |
352 | #define dbg_gc(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) | |
353 | #define dbg_scan(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) | |
354 | #define dbg_rcvry(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) | |
840dc6b8 AB |
355 | |
356 | #define DBGKEY(key) ((char *)(key)) | |
357 | #define DBGKEY1(key) ((char *)(key)) | |
358 | ||
1dcffad7 MR |
359 | static inline int ubifs_debugging_init(struct ubifs_info *c) { return 0; } |
360 | static inline void ubifs_debugging_exit(struct ubifs_info *c) { return; } | |
361 | static inline const char *dbg_ntype(int type) { return ""; } | |
362 | static inline const char *dbg_cstate(int cmt_state) { return ""; } | |
363 | static inline const char *dbg_jhead(int jhead) { return ""; } | |
364 | static inline const char * | |
365 | dbg_get_key_dump(const struct ubifs_info *c, | |
366 | const union ubifs_key *key) { return ""; } | |
4315fb40 | 367 | static inline void dbg_dump_inode(struct ubifs_info *c, |
1dcffad7 MR |
368 | const struct inode *inode) { return; } |
369 | static inline void dbg_dump_node(const struct ubifs_info *c, | |
370 | const void *node) { return; } | |
371 | static inline void dbg_dump_lpt_node(const struct ubifs_info *c, | |
372 | void *node, int lnum, | |
373 | int offs) { return; } | |
374 | static inline void | |
375 | dbg_dump_budget_req(const struct ubifs_budget_req *req) { return; } | |
376 | static inline void | |
377 | dbg_dump_lstats(const struct ubifs_lp_stats *lst) { return; } | |
f1bd66af AB |
378 | static inline void |
379 | dbg_dump_budg(struct ubifs_info *c, | |
380 | const struct ubifs_budg_info *bi) { return; } | |
1dcffad7 MR |
381 | static inline void dbg_dump_lprop(const struct ubifs_info *c, |
382 | const struct ubifs_lprops *lp) { return; } | |
383 | static inline void dbg_dump_lprops(struct ubifs_info *c) { return; } | |
384 | static inline void dbg_dump_lpt_info(struct ubifs_info *c) { return; } | |
385 | static inline void dbg_dump_leb(const struct ubifs_info *c, | |
386 | int lnum) { return; } | |
387 | static inline void | |
388 | dbg_dump_znode(const struct ubifs_info *c, | |
389 | const struct ubifs_znode *znode) { return; } | |
390 | static inline void dbg_dump_heap(struct ubifs_info *c, | |
391 | struct ubifs_lpt_heap *heap, | |
392 | int cat) { return; } | |
393 | static inline void dbg_dump_pnode(struct ubifs_info *c, | |
394 | struct ubifs_pnode *pnode, | |
395 | struct ubifs_nnode *parent, | |
396 | int iip) { return; } | |
397 | static inline void dbg_dump_tnc(struct ubifs_info *c) { return; } | |
398 | static inline void dbg_dump_index(struct ubifs_info *c) { return; } | |
399 | static inline void dbg_dump_lpt_lebs(const struct ubifs_info *c) { return; } | |
400 | ||
401 | static inline int dbg_walk_index(struct ubifs_info *c, | |
402 | dbg_leaf_callback leaf_cb, | |
403 | dbg_znode_callback znode_cb, | |
404 | void *priv) { return 0; } | |
405 | static inline void dbg_save_space_info(struct ubifs_info *c) { return; } | |
406 | static inline int dbg_check_space_info(struct ubifs_info *c) { return 0; } | |
407 | static inline int dbg_check_lprops(struct ubifs_info *c) { return 0; } | |
408 | static inline int | |
409 | dbg_old_index_check_init(struct ubifs_info *c, | |
410 | struct ubifs_zbranch *zroot) { return 0; } | |
411 | static inline int | |
412 | dbg_check_old_index(struct ubifs_info *c, | |
413 | struct ubifs_zbranch *zroot) { return 0; } | |
414 | static inline int dbg_check_cats(struct ubifs_info *c) { return 0; } | |
415 | static inline int dbg_check_ltab(struct ubifs_info *c) { return 0; } | |
416 | static inline int dbg_chk_lpt_free_spc(struct ubifs_info *c) { return 0; } | |
417 | static inline int dbg_chk_lpt_sz(struct ubifs_info *c, | |
418 | int action, int len) { return 0; } | |
419 | static inline int dbg_check_synced_i_size(struct inode *inode) { return 0; } | |
1b51e983 | 420 | static inline int dbg_check_dir(struct ubifs_info *c, |
4315fb40 | 421 | const struct inode *dir) { return 0; } |
1dcffad7 MR |
422 | static inline int dbg_check_tnc(struct ubifs_info *c, int extra) { return 0; } |
423 | static inline int dbg_check_idx_size(struct ubifs_info *c, | |
424 | long long idx_size) { return 0; } | |
425 | static inline int dbg_check_filesystem(struct ubifs_info *c) { return 0; } | |
426 | static inline void dbg_check_heap(struct ubifs_info *c, | |
427 | struct ubifs_lpt_heap *heap, | |
428 | int cat, int add_pos) { return; } | |
429 | static inline int dbg_check_lpt_nodes(struct ubifs_info *c, | |
430 | struct ubifs_cnode *cnode, int row, int col) { return 0; } | |
431 | static inline int dbg_check_inode_size(struct ubifs_info *c, | |
432 | const struct inode *inode, | |
433 | loff_t size) { return 0; } | |
434 | static inline int | |
435 | dbg_check_data_nodes_order(struct ubifs_info *c, | |
436 | struct list_head *head) { return 0; } | |
437 | static inline int | |
438 | dbg_check_nondata_nodes_order(struct ubifs_info *c, | |
439 | struct list_head *head) { return 0; } | |
440 | ||
441 | static inline int dbg_force_in_the_gaps(void) { return 0; } | |
bc3f07f0 AB |
442 | #define dbg_force_in_the_gaps_enabled() 0 |
443 | #define dbg_failure_mode 0 | |
1dcffad7 MR |
444 | |
445 | static inline int dbg_debugfs_init(void) { return 0; } | |
446 | static inline void dbg_debugfs_exit(void) { return; } | |
447 | static inline int dbg_debugfs_init_fs(struct ubifs_info *c) { return 0; } | |
448 | static inline int dbg_debugfs_exit_fs(struct ubifs_info *c) { return 0; } | |
1e51764a | 449 | |
552ff317 | 450 | #endif /* !CONFIG_UBIFS_FS_DEBUG */ |
1e51764a | 451 | #endif /* !__UBIFS_DEBUG_H__ */ |