debug.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  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. * The UBIFS debugfs directory name pattern and maximum name length (3 for "ubi"
  32. * + 1 for "_" and plus 2x2 for 2 UBI numbers and 1 for the trailing zero byte.
  33. */
  34. #define UBIFS_DFS_DIR_NAME "ubi%d_%d"
  35. #define UBIFS_DFS_DIR_LEN (3 + 1 + 2*2 + 1)
  36. /**
  37. * ubifs_debug_info - per-FS debugging information.
  38. * @old_zroot: old index root - used by 'dbg_check_old_index()'
  39. * @old_zroot_level: old index root level - used by 'dbg_check_old_index()'
  40. * @old_zroot_sqnum: old index root sqnum - used by 'dbg_check_old_index()'
  41. *
  42. * @pc_happened: non-zero if an emulated power cut happened
  43. * @pc_delay: 0=>don't delay, 1=>delay a time, 2=>delay a number of calls
  44. * @pc_timeout: time in jiffies when delay of failure mode expires
  45. * @pc_cnt: current number of calls to failure mode I/O functions
  46. * @pc_cnt_max: number of calls by which to delay failure mode
  47. *
  48. * @chk_lpt_sz: used by LPT tree size checker
  49. * @chk_lpt_sz2: used by LPT tree size checker
  50. * @chk_lpt_wastage: used by LPT tree size checker
  51. * @chk_lpt_lebs: used by LPT tree size checker
  52. * @new_nhead_offs: used by LPT tree size checker
  53. * @new_ihead_lnum: used by debugging to check @c->ihead_lnum
  54. * @new_ihead_offs: used by debugging to check @c->ihead_offs
  55. *
  56. * @saved_lst: saved lprops statistics (used by 'dbg_save_space_info()')
  57. * @saved_bi: saved budgeting information
  58. * @saved_free: saved amount of free space
  59. * @saved_idx_gc_cnt: saved value of @c->idx_gc_cnt
  60. *
  61. * @chk_gen: if general extra checks are enabled
  62. * @chk_index: if index xtra checks are enabled
  63. * @chk_orph: if orphans extra checks are enabled
  64. * @chk_lprops: if lprops extra checks are enabled
  65. * @chk_fs: if UBIFS contents extra checks are enabled
  66. * @tst_rcvry: if UBIFS recovery testing mode enabled
  67. *
  68. * @dfs_dir_name: name of debugfs directory containing this file-system's files
  69. * @dfs_dir: direntry object of the file-system debugfs directory
  70. * @dfs_dump_lprops: "dump lprops" debugfs knob
  71. * @dfs_dump_budg: "dump budgeting information" debugfs knob
  72. * @dfs_dump_tnc: "dump TNC" debugfs knob
  73. * @dfs_chk_gen: debugfs knob to enable UBIFS general extra checks
  74. * @dfs_chk_index: debugfs knob to enable UBIFS index extra checks
  75. * @dfs_chk_orph: debugfs knob to enable UBIFS orphans extra checks
  76. * @dfs_chk_lprops: debugfs knob to enable UBIFS LEP properties extra checks
  77. * @dfs_chk_fs: debugfs knob to enable UBIFS contents extra checks
  78. * @dfs_tst_rcvry: debugfs knob to enable UBIFS recovery testing
  79. */
  80. struct ubifs_debug_info {
  81. struct ubifs_zbranch old_zroot;
  82. int old_zroot_level;
  83. unsigned long long old_zroot_sqnum;
  84. int pc_happened;
  85. int pc_delay;
  86. unsigned long pc_timeout;
  87. unsigned int pc_cnt;
  88. unsigned int pc_cnt_max;
  89. long long chk_lpt_sz;
  90. long long chk_lpt_sz2;
  91. long long chk_lpt_wastage;
  92. int chk_lpt_lebs;
  93. int new_nhead_offs;
  94. int new_ihead_lnum;
  95. int new_ihead_offs;
  96. struct ubifs_lp_stats saved_lst;
  97. struct ubifs_budg_info saved_bi;
  98. long long saved_free;
  99. int saved_idx_gc_cnt;
  100. unsigned int chk_gen:1;
  101. unsigned int chk_index:1;
  102. unsigned int chk_orph:1;
  103. unsigned int chk_lprops:1;
  104. unsigned int chk_fs:1;
  105. unsigned int tst_rcvry:1;
  106. char dfs_dir_name[UBIFS_DFS_DIR_LEN + 1];
  107. struct dentry *dfs_dir;
  108. struct dentry *dfs_dump_lprops;
  109. struct dentry *dfs_dump_budg;
  110. struct dentry *dfs_dump_tnc;
  111. struct dentry *dfs_chk_gen;
  112. struct dentry *dfs_chk_index;
  113. struct dentry *dfs_chk_orph;
  114. struct dentry *dfs_chk_lprops;
  115. struct dentry *dfs_chk_fs;
  116. struct dentry *dfs_tst_rcvry;
  117. };
  118. /**
  119. * ubifs_global_debug_info - global (not per-FS) UBIFS debugging information.
  120. *
  121. * @chk_gen: if general extra checks are enabled
  122. * @chk_index: if index xtra checks are enabled
  123. * @chk_orph: if orphans extra checks are enabled
  124. * @chk_lprops: if lprops extra checks are enabled
  125. * @chk_fs: if UBIFS contents extra checks are enabled
  126. * @tst_rcvry: if UBIFS recovery testing mode enabled
  127. */
  128. struct ubifs_global_debug_info {
  129. unsigned int chk_gen:1;
  130. unsigned int chk_index:1;
  131. unsigned int chk_orph:1;
  132. unsigned int chk_lprops:1;
  133. unsigned int chk_fs:1;
  134. unsigned int tst_rcvry:1;
  135. };
  136. #define ubifs_assert(expr) do { \
  137. if (unlikely(!(expr))) { \
  138. printk(KERN_CRIT "UBIFS assert failed in %s at %u (pid %d)\n", \
  139. __func__, __LINE__, current->pid); \
  140. dbg_dump_stack(); \
  141. } \
  142. } while (0)
  143. #define ubifs_assert_cmt_locked(c) do { \
  144. if (unlikely(down_write_trylock(&(c)->commit_sem))) { \
  145. up_write(&(c)->commit_sem); \
  146. printk(KERN_CRIT "commit lock is not locked!\n"); \
  147. ubifs_assert(0); \
  148. } \
  149. } while (0)
  150. #define dbg_dump_stack() dump_stack()
  151. #define dbg_err(fmt, ...) do { \
  152. spin_lock(&dbg_lock); \
  153. ubifs_err(fmt, ##__VA_ARGS__); \
  154. spin_unlock(&dbg_lock); \
  155. } while (0)
  156. const char *dbg_key_str0(const struct ubifs_info *c,
  157. const union ubifs_key *key);
  158. const char *dbg_key_str1(const struct ubifs_info *c,
  159. const union ubifs_key *key);
  160. /*
  161. * DBGKEY macros require @dbg_lock to be held, which it is in the dbg message
  162. * macros.
  163. */
  164. #define DBGKEY(key) dbg_key_str0(c, (key))
  165. #define DBGKEY1(key) dbg_key_str1(c, (key))
  166. extern spinlock_t dbg_lock;
  167. #define ubifs_dbg_msg(type, fmt, ...) do { \
  168. spin_lock(&dbg_lock); \
  169. pr_debug("UBIFS DBG " type ": " fmt "\n", ##__VA_ARGS__); \
  170. spin_unlock(&dbg_lock); \
  171. } while (0)
  172. /* Just a debugging messages not related to any specific UBIFS subsystem */
  173. #define dbg_msg(fmt, ...) ubifs_dbg_msg("msg", fmt, ##__VA_ARGS__)
  174. /* General messages */
  175. #define dbg_gen(fmt, ...) ubifs_dbg_msg("gen", fmt, ##__VA_ARGS__)
  176. /* Additional journal messages */
  177. #define dbg_jnl(fmt, ...) ubifs_dbg_msg("jnl", fmt, ##__VA_ARGS__)
  178. /* Additional TNC messages */
  179. #define dbg_tnc(fmt, ...) ubifs_dbg_msg("tnc", fmt, ##__VA_ARGS__)
  180. /* Additional lprops messages */
  181. #define dbg_lp(fmt, ...) ubifs_dbg_msg("lp", fmt, ##__VA_ARGS__)
  182. /* Additional LEB find messages */
  183. #define dbg_find(fmt, ...) ubifs_dbg_msg("find", fmt, ##__VA_ARGS__)
  184. /* Additional mount messages */
  185. #define dbg_mnt(fmt, ...) ubifs_dbg_msg("mnt", fmt, ##__VA_ARGS__)
  186. /* Additional I/O messages */
  187. #define dbg_io(fmt, ...) ubifs_dbg_msg("io", fmt, ##__VA_ARGS__)
  188. /* Additional commit messages */
  189. #define dbg_cmt(fmt, ...) ubifs_dbg_msg("cmt", fmt, ##__VA_ARGS__)
  190. /* Additional budgeting messages */
  191. #define dbg_budg(fmt, ...) ubifs_dbg_msg("budg", fmt, ##__VA_ARGS__)
  192. /* Additional log messages */
  193. #define dbg_log(fmt, ...) ubifs_dbg_msg("log", fmt, ##__VA_ARGS__)
  194. /* Additional gc messages */
  195. #define dbg_gc(fmt, ...) ubifs_dbg_msg("gc", fmt, ##__VA_ARGS__)
  196. /* Additional scan messages */
  197. #define dbg_scan(fmt, ...) ubifs_dbg_msg("scan", fmt, ##__VA_ARGS__)
  198. /* Additional recovery messages */
  199. #define dbg_rcvry(fmt, ...) ubifs_dbg_msg("rcvry", fmt, ##__VA_ARGS__)
  200. extern struct ubifs_global_debug_info ubifs_dbg;
  201. static inline int dbg_is_chk_gen(const struct ubifs_info *c)
  202. {
  203. return !!(ubifs_dbg.chk_gen || c->dbg->chk_gen);
  204. }
  205. static inline int dbg_is_chk_index(const struct ubifs_info *c)
  206. {
  207. return !!(ubifs_dbg.chk_index || c->dbg->chk_index);
  208. }
  209. static inline int dbg_is_chk_orph(const struct ubifs_info *c)
  210. {
  211. return !!(ubifs_dbg.chk_orph || c->dbg->chk_orph);
  212. }
  213. static inline int dbg_is_chk_lprops(const struct ubifs_info *c)
  214. {
  215. return !!(ubifs_dbg.chk_lprops || c->dbg->chk_lprops);
  216. }
  217. static inline int dbg_is_chk_fs(const struct ubifs_info *c)
  218. {
  219. return !!(ubifs_dbg.chk_fs || c->dbg->chk_fs);
  220. }
  221. static inline int dbg_is_tst_rcvry(const struct ubifs_info *c)
  222. {
  223. return !!(ubifs_dbg.tst_rcvry || c->dbg->tst_rcvry);
  224. }
  225. static inline int dbg_is_power_cut(const struct ubifs_info *c)
  226. {
  227. return !!c->dbg->pc_happened;
  228. }
  229. int ubifs_debugging_init(struct ubifs_info *c);
  230. void ubifs_debugging_exit(struct ubifs_info *c);
  231. /* Dump functions */
  232. const char *dbg_ntype(int type);
  233. const char *dbg_cstate(int cmt_state);
  234. const char *dbg_jhead(int jhead);
  235. const char *dbg_get_key_dump(const struct ubifs_info *c,
  236. const union ubifs_key *key);
  237. void dbg_dump_inode(struct ubifs_info *c, const struct inode *inode);
  238. void dbg_dump_node(const struct ubifs_info *c, const void *node);
  239. void dbg_dump_lpt_node(const struct ubifs_info *c, void *node, int lnum,
  240. int offs);
  241. void dbg_dump_budget_req(const struct ubifs_budget_req *req);
  242. void dbg_dump_lstats(const struct ubifs_lp_stats *lst);
  243. void dbg_dump_budg(struct ubifs_info *c, const struct ubifs_budg_info *bi);
  244. void dbg_dump_lprop(const struct ubifs_info *c, const struct ubifs_lprops *lp);
  245. void dbg_dump_lprops(struct ubifs_info *c);
  246. void dbg_dump_lpt_info(struct ubifs_info *c);
  247. void dbg_dump_leb(const struct ubifs_info *c, int lnum);
  248. void dbg_dump_sleb(const struct ubifs_info *c,
  249. const struct ubifs_scan_leb *sleb, int offs);
  250. void dbg_dump_znode(const struct ubifs_info *c,
  251. const struct ubifs_znode *znode);
  252. void dbg_dump_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat);
  253. void dbg_dump_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode,
  254. struct ubifs_nnode *parent, int iip);
  255. void dbg_dump_tnc(struct ubifs_info *c);
  256. void dbg_dump_index(struct ubifs_info *c);
  257. void dbg_dump_lpt_lebs(const struct ubifs_info *c);
  258. int dbg_walk_index(struct ubifs_info *c, dbg_leaf_callback leaf_cb,
  259. dbg_znode_callback znode_cb, void *priv);
  260. /* Checking functions */
  261. void dbg_save_space_info(struct ubifs_info *c);
  262. int dbg_check_space_info(struct ubifs_info *c);
  263. int dbg_check_lprops(struct ubifs_info *c);
  264. int dbg_old_index_check_init(struct ubifs_info *c, struct ubifs_zbranch *zroot);
  265. int dbg_check_old_index(struct ubifs_info *c, struct ubifs_zbranch *zroot);
  266. int dbg_check_cats(struct ubifs_info *c);
  267. int dbg_check_ltab(struct ubifs_info *c);
  268. int dbg_chk_lpt_free_spc(struct ubifs_info *c);
  269. int dbg_chk_lpt_sz(struct ubifs_info *c, int action, int len);
  270. int dbg_check_synced_i_size(const struct ubifs_info *c, struct inode *inode);
  271. int dbg_check_dir(struct ubifs_info *c, const struct inode *dir);
  272. int dbg_check_tnc(struct ubifs_info *c, int extra);
  273. int dbg_check_idx_size(struct ubifs_info *c, long long idx_size);
  274. int dbg_check_filesystem(struct ubifs_info *c);
  275. void dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat,
  276. int add_pos);
  277. int dbg_check_lpt_nodes(struct ubifs_info *c, struct ubifs_cnode *cnode,
  278. int row, int col);
  279. int dbg_check_inode_size(struct ubifs_info *c, const struct inode *inode,
  280. loff_t size);
  281. int dbg_check_data_nodes_order(struct ubifs_info *c, struct list_head *head);
  282. int dbg_check_nondata_nodes_order(struct ubifs_info *c, struct list_head *head);
  283. int dbg_leb_write(struct ubifs_info *c, int lnum, const void *buf, int offs,
  284. int len, int dtype);
  285. int dbg_leb_change(struct ubifs_info *c, int lnum, const void *buf, int len,
  286. int dtype);
  287. int dbg_leb_unmap(struct ubifs_info *c, int lnum);
  288. int dbg_leb_map(struct ubifs_info *c, int lnum, int dtype);
  289. /* Debugfs-related stuff */
  290. int dbg_debugfs_init(void);
  291. void dbg_debugfs_exit(void);
  292. int dbg_debugfs_init_fs(struct ubifs_info *c);
  293. void dbg_debugfs_exit_fs(struct ubifs_info *c);
  294. #else /* !CONFIG_UBIFS_FS_DEBUG */
  295. /* Use "if (0)" to make compiler check arguments even if debugging is off */
  296. #define ubifs_assert(expr) do { \
  297. if (0) \
  298. printk(KERN_CRIT "UBIFS assert failed in %s at %u (pid %d)\n", \
  299. __func__, __LINE__, current->pid); \
  300. } while (0)
  301. #define dbg_err(fmt, ...) do { \
  302. if (0) \
  303. ubifs_err(fmt, ##__VA_ARGS__); \
  304. } while (0)
  305. #define DBGKEY(key) ((char *)(key))
  306. #define DBGKEY1(key) ((char *)(key))
  307. #define ubifs_dbg_msg(fmt, ...) do { \
  308. if (0) \
  309. printk(KERN_DEBUG fmt "\n", ##__VA_ARGS__); \
  310. } while (0)
  311. #define dbg_dump_stack()
  312. #define ubifs_assert_cmt_locked(c)
  313. #define dbg_msg(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  314. #define dbg_gen(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  315. #define dbg_jnl(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  316. #define dbg_tnc(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  317. #define dbg_lp(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  318. #define dbg_find(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  319. #define dbg_mnt(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  320. #define dbg_io(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  321. #define dbg_cmt(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  322. #define dbg_budg(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  323. #define dbg_log(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  324. #define dbg_gc(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  325. #define dbg_scan(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  326. #define dbg_rcvry(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  327. static inline int ubifs_debugging_init(struct ubifs_info *c) { return 0; }
  328. static inline void ubifs_debugging_exit(struct ubifs_info *c) { return; }
  329. static inline const char *dbg_ntype(int type) { return ""; }
  330. static inline const char *dbg_cstate(int cmt_state) { return ""; }
  331. static inline const char *dbg_jhead(int jhead) { return ""; }
  332. static inline const char *
  333. dbg_get_key_dump(const struct ubifs_info *c,
  334. const union ubifs_key *key) { return ""; }
  335. static inline void dbg_dump_inode(struct ubifs_info *c,
  336. const struct inode *inode) { return; }
  337. static inline void dbg_dump_node(const struct ubifs_info *c,
  338. const void *node) { return; }
  339. static inline void dbg_dump_lpt_node(const struct ubifs_info *c,
  340. void *node, int lnum,
  341. int offs) { return; }
  342. static inline void
  343. dbg_dump_budget_req(const struct ubifs_budget_req *req) { return; }
  344. static inline void
  345. dbg_dump_lstats(const struct ubifs_lp_stats *lst) { return; }
  346. static inline void
  347. dbg_dump_budg(struct ubifs_info *c,
  348. const struct ubifs_budg_info *bi) { return; }
  349. static inline void dbg_dump_lprop(const struct ubifs_info *c,
  350. const struct ubifs_lprops *lp) { return; }
  351. static inline void dbg_dump_lprops(struct ubifs_info *c) { return; }
  352. static inline void dbg_dump_lpt_info(struct ubifs_info *c) { return; }
  353. static inline void dbg_dump_leb(const struct ubifs_info *c,
  354. int lnum) { return; }
  355. static inline void
  356. dbg_dump_sleb(const struct ubifs_info *c,
  357. const struct ubifs_scan_leb *sleb, int offs) { return; }
  358. static inline void
  359. dbg_dump_znode(const struct ubifs_info *c,
  360. const struct ubifs_znode *znode) { return; }
  361. static inline void dbg_dump_heap(struct ubifs_info *c,
  362. struct ubifs_lpt_heap *heap,
  363. int cat) { return; }
  364. static inline void dbg_dump_pnode(struct ubifs_info *c,
  365. struct ubifs_pnode *pnode,
  366. struct ubifs_nnode *parent,
  367. int iip) { return; }
  368. static inline void dbg_dump_tnc(struct ubifs_info *c) { return; }
  369. static inline void dbg_dump_index(struct ubifs_info *c) { return; }
  370. static inline void dbg_dump_lpt_lebs(const struct ubifs_info *c) { return; }
  371. static inline int dbg_walk_index(struct ubifs_info *c,
  372. dbg_leaf_callback leaf_cb,
  373. dbg_znode_callback znode_cb,
  374. void *priv) { return 0; }
  375. static inline void dbg_save_space_info(struct ubifs_info *c) { return; }
  376. static inline int dbg_check_space_info(struct ubifs_info *c) { return 0; }
  377. static inline int dbg_check_lprops(struct ubifs_info *c) { return 0; }
  378. static inline int
  379. dbg_old_index_check_init(struct ubifs_info *c,
  380. struct ubifs_zbranch *zroot) { return 0; }
  381. static inline int
  382. dbg_check_old_index(struct ubifs_info *c,
  383. struct ubifs_zbranch *zroot) { return 0; }
  384. static inline int dbg_check_cats(struct ubifs_info *c) { return 0; }
  385. static inline int dbg_check_ltab(struct ubifs_info *c) { return 0; }
  386. static inline int dbg_chk_lpt_free_spc(struct ubifs_info *c) { return 0; }
  387. static inline int dbg_chk_lpt_sz(struct ubifs_info *c,
  388. int action, int len) { return 0; }
  389. static inline int
  390. dbg_check_synced_i_size(const struct ubifs_info *c,
  391. struct inode *inode) { return 0; }
  392. static inline int dbg_check_dir(struct ubifs_info *c,
  393. const struct inode *dir) { return 0; }
  394. static inline int dbg_check_tnc(struct ubifs_info *c, int extra) { return 0; }
  395. static inline int dbg_check_idx_size(struct ubifs_info *c,
  396. long long idx_size) { return 0; }
  397. static inline int dbg_check_filesystem(struct ubifs_info *c) { return 0; }
  398. static inline void dbg_check_heap(struct ubifs_info *c,
  399. struct ubifs_lpt_heap *heap,
  400. int cat, int add_pos) { return; }
  401. static inline int dbg_check_lpt_nodes(struct ubifs_info *c,
  402. struct ubifs_cnode *cnode, int row, int col) { return 0; }
  403. static inline int dbg_check_inode_size(struct ubifs_info *c,
  404. const struct inode *inode,
  405. loff_t size) { return 0; }
  406. static inline int
  407. dbg_check_data_nodes_order(struct ubifs_info *c,
  408. struct list_head *head) { return 0; }
  409. static inline int
  410. dbg_check_nondata_nodes_order(struct ubifs_info *c,
  411. struct list_head *head) { return 0; }
  412. static inline int dbg_leb_write(struct ubifs_info *c, int lnum,
  413. const void *buf, int offset,
  414. int len, int dtype) { return 0; }
  415. static inline int dbg_leb_change(struct ubifs_info *c, int lnum,
  416. const void *buf, int len,
  417. int dtype) { return 0; }
  418. static inline int dbg_leb_unmap(struct ubifs_info *c, int lnum) { return 0; }
  419. static inline int dbg_leb_map(struct ubifs_info *c, int lnum,
  420. int dtype) { return 0; }
  421. static inline int dbg_is_chk_gen(const struct ubifs_info *c) { return 0; }
  422. static inline int dbg_is_chk_index(const struct ubifs_info *c) { return 0; }
  423. static inline int dbg_is_chk_orph(const struct ubifs_info *c) { return 0; }
  424. static inline int dbg_is_chk_lprops(const struct ubifs_info *c) { return 0; }
  425. static inline int dbg_is_chk_fs(const struct ubifs_info *c) { return 0; }
  426. static inline int dbg_is_tst_rcvry(const struct ubifs_info *c) { return 0; }
  427. static inline int dbg_is_power_cut(const struct ubifs_info *c) { return 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__ */