debug.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  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. #ifndef __UBIFS_DEBUG_H__
  23. #define __UBIFS_DEBUG_H__
  24. /* Checking helper functions */
  25. typedef int (*dbg_leaf_callback)(struct ubifs_info *c,
  26. struct ubifs_zbranch *zbr, void *priv);
  27. typedef int (*dbg_znode_callback)(struct ubifs_info *c,
  28. struct ubifs_znode *znode, void *priv);
  29. #ifdef CONFIG_UBIFS_FS_DEBUG
  30. /**
  31. * ubifs_debug_info - per-FS debugging information.
  32. * @old_zroot: old index root - used by 'dbg_check_old_index()'
  33. * @old_zroot_level: old index root level - used by 'dbg_check_old_index()'
  34. * @old_zroot_sqnum: old index root sqnum - used by 'dbg_check_old_index()'
  35. * @failure_mode: failure mode for recovery testing
  36. * @fail_delay: 0=>don't delay, 1=>delay a time, 2=>delay a number of calls
  37. * @fail_timeout: time in jiffies when delay of failure mode expires
  38. * @fail_cnt: current number of calls to failure mode I/O functions
  39. * @fail_cnt_max: number of calls by which to delay failure mode
  40. * @chk_lpt_sz: used by LPT tree size checker
  41. * @chk_lpt_sz2: used by LPT tree size checker
  42. * @chk_lpt_wastage: used by LPT tree size checker
  43. * @chk_lpt_lebs: used by LPT tree size checker
  44. * @new_nhead_offs: used by LPT tree size checker
  45. * @new_ihead_lnum: used by debugging to check @c->ihead_lnum
  46. * @new_ihead_offs: used by debugging to check @c->ihead_offs
  47. *
  48. * @saved_lst: saved lprops statistics (used by 'dbg_save_space_info()')
  49. * @saved_free: saved free space (used by 'dbg_save_space_info()')
  50. *
  51. * dfs_dir_name: name of debugfs directory containing this file-system's files
  52. * dfs_dir: direntry object of the file-system debugfs directory
  53. * dfs_dump_lprops: "dump lprops" debugfs knob
  54. * dfs_dump_budg: "dump budgeting information" debugfs knob
  55. * dfs_dump_tnc: "dump TNC" debugfs knob
  56. */
  57. struct ubifs_debug_info {
  58. struct ubifs_zbranch old_zroot;
  59. int old_zroot_level;
  60. unsigned long long old_zroot_sqnum;
  61. int failure_mode;
  62. int fail_delay;
  63. unsigned long fail_timeout;
  64. unsigned int fail_cnt;
  65. unsigned int fail_cnt_max;
  66. long long chk_lpt_sz;
  67. long long chk_lpt_sz2;
  68. long long chk_lpt_wastage;
  69. int chk_lpt_lebs;
  70. int new_nhead_offs;
  71. int new_ihead_lnum;
  72. int new_ihead_offs;
  73. struct ubifs_lp_stats saved_lst;
  74. long long saved_free;
  75. char dfs_dir_name[100];
  76. struct dentry *dfs_dir;
  77. struct dentry *dfs_dump_lprops;
  78. struct dentry *dfs_dump_budg;
  79. struct dentry *dfs_dump_tnc;
  80. };
  81. #define ubifs_assert(expr) do { \
  82. if (unlikely(!(expr))) { \
  83. printk(KERN_CRIT "UBIFS assert failed in %s at %u (pid %d)\n", \
  84. __func__, __LINE__, current->pid); \
  85. dbg_dump_stack(); \
  86. } \
  87. } while (0)
  88. #define ubifs_assert_cmt_locked(c) do { \
  89. if (unlikely(down_write_trylock(&(c)->commit_sem))) { \
  90. up_write(&(c)->commit_sem); \
  91. printk(KERN_CRIT "commit lock is not locked!\n"); \
  92. ubifs_assert(0); \
  93. } \
  94. } while (0)
  95. #define dbg_dump_stack() do { \
  96. if (!dbg_failure_mode) \
  97. dump_stack(); \
  98. } while (0)
  99. /* Generic debugging messages */
  100. #define dbg_msg(fmt, ...) do { \
  101. spin_lock(&dbg_lock); \
  102. printk(KERN_DEBUG "UBIFS DBG (pid %d): %s: " fmt "\n", current->pid, \
  103. __func__, ##__VA_ARGS__); \
  104. spin_unlock(&dbg_lock); \
  105. } while (0)
  106. #define dbg_do_msg(typ, fmt, ...) do { \
  107. if (ubifs_msg_flags & typ) \
  108. dbg_msg(fmt, ##__VA_ARGS__); \
  109. } while (0)
  110. #define dbg_err(fmt, ...) do { \
  111. spin_lock(&dbg_lock); \
  112. ubifs_err(fmt, ##__VA_ARGS__); \
  113. spin_unlock(&dbg_lock); \
  114. } while (0)
  115. const char *dbg_key_str0(const struct ubifs_info *c,
  116. const union ubifs_key *key);
  117. const char *dbg_key_str1(const struct ubifs_info *c,
  118. const union ubifs_key *key);
  119. /*
  120. * DBGKEY macros require @dbg_lock to be held, which it is in the dbg message
  121. * macros.
  122. */
  123. #define DBGKEY(key) dbg_key_str0(c, (key))
  124. #define DBGKEY1(key) dbg_key_str1(c, (key))
  125. /* General messages */
  126. #define dbg_gen(fmt, ...) dbg_do_msg(UBIFS_MSG_GEN, fmt, ##__VA_ARGS__)
  127. /* Additional journal messages */
  128. #define dbg_jnl(fmt, ...) dbg_do_msg(UBIFS_MSG_JNL, fmt, ##__VA_ARGS__)
  129. /* Additional TNC messages */
  130. #define dbg_tnc(fmt, ...) dbg_do_msg(UBIFS_MSG_TNC, fmt, ##__VA_ARGS__)
  131. /* Additional lprops messages */
  132. #define dbg_lp(fmt, ...) dbg_do_msg(UBIFS_MSG_LP, fmt, ##__VA_ARGS__)
  133. /* Additional LEB find messages */
  134. #define dbg_find(fmt, ...) dbg_do_msg(UBIFS_MSG_FIND, fmt, ##__VA_ARGS__)
  135. /* Additional mount messages */
  136. #define dbg_mnt(fmt, ...) dbg_do_msg(UBIFS_MSG_MNT, fmt, ##__VA_ARGS__)
  137. /* Additional I/O messages */
  138. #define dbg_io(fmt, ...) dbg_do_msg(UBIFS_MSG_IO, fmt, ##__VA_ARGS__)
  139. /* Additional commit messages */
  140. #define dbg_cmt(fmt, ...) dbg_do_msg(UBIFS_MSG_CMT, fmt, ##__VA_ARGS__)
  141. /* Additional budgeting messages */
  142. #define dbg_budg(fmt, ...) dbg_do_msg(UBIFS_MSG_BUDG, fmt, ##__VA_ARGS__)
  143. /* Additional log messages */
  144. #define dbg_log(fmt, ...) dbg_do_msg(UBIFS_MSG_LOG, fmt, ##__VA_ARGS__)
  145. /* Additional gc messages */
  146. #define dbg_gc(fmt, ...) dbg_do_msg(UBIFS_MSG_GC, fmt, ##__VA_ARGS__)
  147. /* Additional scan messages */
  148. #define dbg_scan(fmt, ...) dbg_do_msg(UBIFS_MSG_SCAN, fmt, ##__VA_ARGS__)
  149. /* Additional recovery messages */
  150. #define dbg_rcvry(fmt, ...) dbg_do_msg(UBIFS_MSG_RCVRY, fmt, ##__VA_ARGS__)
  151. /*
  152. * Debugging message type flags.
  153. *
  154. * UBIFS_MSG_GEN: general messages
  155. * UBIFS_MSG_JNL: journal messages
  156. * UBIFS_MSG_MNT: mount messages
  157. * UBIFS_MSG_CMT: commit messages
  158. * UBIFS_MSG_FIND: LEB find messages
  159. * UBIFS_MSG_BUDG: budgeting messages
  160. * UBIFS_MSG_GC: garbage collection messages
  161. * UBIFS_MSG_TNC: TNC messages
  162. * UBIFS_MSG_LP: lprops messages
  163. * UBIFS_MSG_IO: I/O messages
  164. * UBIFS_MSG_LOG: log messages
  165. * UBIFS_MSG_SCAN: scan messages
  166. * UBIFS_MSG_RCVRY: recovery messages
  167. */
  168. enum {
  169. UBIFS_MSG_GEN = 0x1,
  170. UBIFS_MSG_JNL = 0x2,
  171. UBIFS_MSG_MNT = 0x4,
  172. UBIFS_MSG_CMT = 0x8,
  173. UBIFS_MSG_FIND = 0x10,
  174. UBIFS_MSG_BUDG = 0x20,
  175. UBIFS_MSG_GC = 0x40,
  176. UBIFS_MSG_TNC = 0x80,
  177. UBIFS_MSG_LP = 0x100,
  178. UBIFS_MSG_IO = 0x200,
  179. UBIFS_MSG_LOG = 0x400,
  180. UBIFS_MSG_SCAN = 0x800,
  181. UBIFS_MSG_RCVRY = 0x1000,
  182. };
  183. /*
  184. * Debugging check flags.
  185. *
  186. * UBIFS_CHK_GEN: general checks
  187. * UBIFS_CHK_TNC: check TNC
  188. * UBIFS_CHK_IDX_SZ: check index size
  189. * UBIFS_CHK_ORPH: check orphans
  190. * UBIFS_CHK_OLD_IDX: check the old index
  191. * UBIFS_CHK_LPROPS: check lprops
  192. * UBIFS_CHK_FS: check the file-system
  193. */
  194. enum {
  195. UBIFS_CHK_GEN = 0x1,
  196. UBIFS_CHK_TNC = 0x2,
  197. UBIFS_CHK_IDX_SZ = 0x4,
  198. UBIFS_CHK_ORPH = 0x8,
  199. UBIFS_CHK_OLD_IDX = 0x10,
  200. UBIFS_CHK_LPROPS = 0x20,
  201. UBIFS_CHK_FS = 0x40,
  202. };
  203. /*
  204. * Special testing flags.
  205. *
  206. * UBIFS_TST_FORCE_IN_THE_GAPS: force the use of in-the-gaps method
  207. * UBIFS_TST_RCVRY: failure mode for recovery testing
  208. */
  209. enum {
  210. UBIFS_TST_FORCE_IN_THE_GAPS = 0x2,
  211. UBIFS_TST_RCVRY = 0x4,
  212. };
  213. extern spinlock_t dbg_lock;
  214. extern unsigned int ubifs_msg_flags;
  215. extern unsigned int ubifs_chk_flags;
  216. extern unsigned int ubifs_tst_flags;
  217. int ubifs_debugging_init(struct ubifs_info *c);
  218. void ubifs_debugging_exit(struct ubifs_info *c);
  219. /* Dump functions */
  220. const char *dbg_ntype(int type);
  221. const char *dbg_cstate(int cmt_state);
  222. const char *dbg_jhead(int jhead);
  223. const char *dbg_get_key_dump(const struct ubifs_info *c,
  224. const union ubifs_key *key);
  225. void dbg_dump_inode(const struct ubifs_info *c, const struct inode *inode);
  226. void dbg_dump_node(const struct ubifs_info *c, const void *node);
  227. void dbg_dump_lpt_node(const struct ubifs_info *c, void *node, int lnum,
  228. int offs);
  229. void dbg_dump_budget_req(const struct ubifs_budget_req *req);
  230. void dbg_dump_lstats(const struct ubifs_lp_stats *lst);
  231. void dbg_dump_budg(struct ubifs_info *c);
  232. void dbg_dump_lprop(const struct ubifs_info *c, const struct ubifs_lprops *lp);
  233. void dbg_dump_lprops(struct ubifs_info *c);
  234. void dbg_dump_lpt_info(struct ubifs_info *c);
  235. void dbg_dump_leb(const struct ubifs_info *c, int lnum);
  236. void dbg_dump_znode(const struct ubifs_info *c,
  237. const struct ubifs_znode *znode);
  238. void dbg_dump_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat);
  239. void dbg_dump_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode,
  240. struct ubifs_nnode *parent, int iip);
  241. void dbg_dump_tnc(struct ubifs_info *c);
  242. void dbg_dump_index(struct ubifs_info *c);
  243. void dbg_dump_lpt_lebs(const struct ubifs_info *c);
  244. int dbg_walk_index(struct ubifs_info *c, dbg_leaf_callback leaf_cb,
  245. dbg_znode_callback znode_cb, void *priv);
  246. /* Checking functions */
  247. void dbg_save_space_info(struct ubifs_info *c);
  248. int dbg_check_space_info(struct ubifs_info *c);
  249. int dbg_check_lprops(struct ubifs_info *c);
  250. int dbg_old_index_check_init(struct ubifs_info *c, struct ubifs_zbranch *zroot);
  251. int dbg_check_old_index(struct ubifs_info *c, struct ubifs_zbranch *zroot);
  252. int dbg_check_cats(struct ubifs_info *c);
  253. int dbg_check_ltab(struct ubifs_info *c);
  254. int dbg_chk_lpt_free_spc(struct ubifs_info *c);
  255. int dbg_chk_lpt_sz(struct ubifs_info *c, int action, int len);
  256. int dbg_check_synced_i_size(struct inode *inode);
  257. int dbg_check_dir_size(struct ubifs_info *c, const struct inode *dir);
  258. int dbg_check_tnc(struct ubifs_info *c, int extra);
  259. int dbg_check_idx_size(struct ubifs_info *c, long long idx_size);
  260. int dbg_check_filesystem(struct ubifs_info *c);
  261. void dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat,
  262. int add_pos);
  263. int dbg_check_lpt_nodes(struct ubifs_info *c, struct ubifs_cnode *cnode,
  264. int row, int col);
  265. int dbg_check_inode_size(struct ubifs_info *c, const struct inode *inode,
  266. loff_t size);
  267. int dbg_check_data_nodes_order(struct ubifs_info *c, struct list_head *head);
  268. int dbg_check_nondata_nodes_order(struct ubifs_info *c, struct list_head *head);
  269. /* Force the use of in-the-gaps method for testing */
  270. #define dbg_force_in_the_gaps_enabled \
  271. (ubifs_tst_flags & UBIFS_TST_FORCE_IN_THE_GAPS)
  272. int dbg_force_in_the_gaps(void);
  273. /* Failure mode for recovery testing */
  274. #define dbg_failure_mode (ubifs_tst_flags & UBIFS_TST_RCVRY)
  275. #ifndef UBIFS_DBG_PRESERVE_UBI
  276. #define ubi_leb_read dbg_leb_read
  277. #define ubi_leb_write dbg_leb_write
  278. #define ubi_leb_change dbg_leb_change
  279. #define ubi_leb_erase dbg_leb_erase
  280. #define ubi_leb_unmap dbg_leb_unmap
  281. #define ubi_is_mapped dbg_is_mapped
  282. #define ubi_leb_map dbg_leb_map
  283. #endif
  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. static inline int dbg_read(struct ubi_volume_desc *desc, int lnum, char *buf,
  295. int offset, int len)
  296. {
  297. return dbg_leb_read(desc, lnum, buf, offset, len, 0);
  298. }
  299. static inline int dbg_write(struct ubi_volume_desc *desc, int lnum,
  300. const void *buf, int offset, int len)
  301. {
  302. return dbg_leb_write(desc, lnum, buf, offset, len, UBI_UNKNOWN);
  303. }
  304. static inline int dbg_change(struct ubi_volume_desc *desc, int lnum,
  305. const void *buf, int len)
  306. {
  307. return dbg_leb_change(desc, lnum, buf, len, UBI_UNKNOWN);
  308. }
  309. /* Debugfs-related stuff */
  310. int dbg_debugfs_init(void);
  311. void dbg_debugfs_exit(void);
  312. int dbg_debugfs_init_fs(struct ubifs_info *c);
  313. void dbg_debugfs_exit_fs(struct ubifs_info *c);
  314. #else /* !CONFIG_UBIFS_FS_DEBUG */
  315. /* Use "if (0)" to make compiler check arguments even if debugging is off */
  316. #define ubifs_assert(expr) do { \
  317. if (0 && (expr)) \
  318. printk(KERN_CRIT "UBIFS assert failed in %s at %u (pid %d)\n", \
  319. __func__, __LINE__, current->pid); \
  320. } while (0)
  321. #define dbg_err(fmt, ...) do { \
  322. if (0) \
  323. ubifs_err(fmt, ##__VA_ARGS__); \
  324. } while (0)
  325. #define dbg_msg(fmt, ...) do { \
  326. if (0) \
  327. printk(KERN_DEBUG "UBIFS DBG (pid %d): %s: " fmt "\n", \
  328. current->pid, __func__, ##__VA_ARGS__); \
  329. } while (0)
  330. #define dbg_dump_stack()
  331. #define ubifs_assert_cmt_locked(c)
  332. #define dbg_gen(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
  333. #define dbg_jnl(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
  334. #define dbg_tnc(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
  335. #define dbg_lp(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
  336. #define dbg_find(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
  337. #define dbg_mnt(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
  338. #define dbg_io(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
  339. #define dbg_cmt(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
  340. #define dbg_budg(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
  341. #define dbg_log(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
  342. #define dbg_gc(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
  343. #define dbg_scan(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
  344. #define dbg_rcvry(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
  345. #define DBGKEY(key) ((char *)(key))
  346. #define DBGKEY1(key) ((char *)(key))
  347. static inline int ubifs_debugging_init(struct ubifs_info *c) { return 0; }
  348. static inline void ubifs_debugging_exit(struct ubifs_info *c) { return; }
  349. static inline const char *dbg_ntype(int type) { return ""; }
  350. static inline const char *dbg_cstate(int cmt_state) { return ""; }
  351. static inline const char *dbg_jhead(int jhead) { return ""; }
  352. static inline const char *
  353. dbg_get_key_dump(const struct ubifs_info *c,
  354. const union ubifs_key *key) { return ""; }
  355. static inline void dbg_dump_inode(const struct ubifs_info *c,
  356. const struct inode *inode) { return; }
  357. static inline void dbg_dump_node(const struct ubifs_info *c,
  358. const void *node) { return; }
  359. static inline void dbg_dump_lpt_node(const struct ubifs_info *c,
  360. void *node, int lnum,
  361. int offs) { return; }
  362. static inline void
  363. dbg_dump_budget_req(const struct ubifs_budget_req *req) { return; }
  364. static inline void
  365. dbg_dump_lstats(const struct ubifs_lp_stats *lst) { return; }
  366. static inline void dbg_dump_budg(struct ubifs_info *c) { return; }
  367. static inline void dbg_dump_lprop(const struct ubifs_info *c,
  368. const struct ubifs_lprops *lp) { return; }
  369. static inline void dbg_dump_lprops(struct ubifs_info *c) { return; }
  370. static inline void dbg_dump_lpt_info(struct ubifs_info *c) { return; }
  371. static inline void dbg_dump_leb(const struct ubifs_info *c,
  372. int lnum) { return; }
  373. static inline void
  374. dbg_dump_znode(const struct ubifs_info *c,
  375. const struct ubifs_znode *znode) { return; }
  376. static inline void dbg_dump_heap(struct ubifs_info *c,
  377. struct ubifs_lpt_heap *heap,
  378. int cat) { return; }
  379. static inline void dbg_dump_pnode(struct ubifs_info *c,
  380. struct ubifs_pnode *pnode,
  381. struct ubifs_nnode *parent,
  382. int iip) { return; }
  383. static inline void dbg_dump_tnc(struct ubifs_info *c) { return; }
  384. static inline void dbg_dump_index(struct ubifs_info *c) { return; }
  385. static inline void dbg_dump_lpt_lebs(const struct ubifs_info *c) { return; }
  386. static inline int dbg_walk_index(struct ubifs_info *c,
  387. dbg_leaf_callback leaf_cb,
  388. dbg_znode_callback znode_cb,
  389. void *priv) { return 0; }
  390. static inline void dbg_save_space_info(struct ubifs_info *c) { return; }
  391. static inline int dbg_check_space_info(struct ubifs_info *c) { return 0; }
  392. static inline int dbg_check_lprops(struct ubifs_info *c) { return 0; }
  393. static inline int
  394. dbg_old_index_check_init(struct ubifs_info *c,
  395. struct ubifs_zbranch *zroot) { return 0; }
  396. static inline int
  397. dbg_check_old_index(struct ubifs_info *c,
  398. struct ubifs_zbranch *zroot) { return 0; }
  399. static inline int dbg_check_cats(struct ubifs_info *c) { return 0; }
  400. static inline int dbg_check_ltab(struct ubifs_info *c) { return 0; }
  401. static inline int dbg_chk_lpt_free_spc(struct ubifs_info *c) { return 0; }
  402. static inline int dbg_chk_lpt_sz(struct ubifs_info *c,
  403. int action, int len) { return 0; }
  404. static inline int dbg_check_synced_i_size(struct inode *inode) { return 0; }
  405. static inline int dbg_check_dir_size(struct ubifs_info *c,
  406. const struct inode *dir) { return 0; }
  407. static inline int dbg_check_tnc(struct ubifs_info *c, int extra) { return 0; }
  408. static inline int dbg_check_idx_size(struct ubifs_info *c,
  409. long long idx_size) { return 0; }
  410. static inline int dbg_check_filesystem(struct ubifs_info *c) { return 0; }
  411. static inline void dbg_check_heap(struct ubifs_info *c,
  412. struct ubifs_lpt_heap *heap,
  413. int cat, int add_pos) { return; }
  414. static inline int dbg_check_lpt_nodes(struct ubifs_info *c,
  415. struct ubifs_cnode *cnode, int row, int col) { return 0; }
  416. static inline int dbg_check_inode_size(struct ubifs_info *c,
  417. const struct inode *inode,
  418. loff_t size) { return 0; }
  419. static inline int
  420. dbg_check_data_nodes_order(struct ubifs_info *c,
  421. struct list_head *head) { return 0; }
  422. static inline int
  423. dbg_check_nondata_nodes_order(struct ubifs_info *c,
  424. struct list_head *head) { return 0; }
  425. static inline int dbg_force_in_the_gaps(void) { return 0; }
  426. #define dbg_force_in_the_gaps_enabled 0
  427. #define dbg_failure_mode 0
  428. static inline int dbg_debugfs_init(void) { return 0; }
  429. static inline void dbg_debugfs_exit(void) { return; }
  430. static inline int dbg_debugfs_init_fs(struct ubifs_info *c) { return 0; }
  431. static inline int dbg_debugfs_exit_fs(struct ubifs_info *c) { return 0; }
  432. #endif /* !CONFIG_UBIFS_FS_DEBUG */
  433. #endif /* !__UBIFS_DEBUG_H__ */