debug.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  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. ubifs_err(fmt, ##__VA_ARGS__); \
  153. } while (0)
  154. #define ubifs_dbg_msg(type, fmt, ...) \
  155. pr_debug("UBIFS DBG " type ": " fmt "\n", ##__VA_ARGS__)
  156. #define DBG_KEY_BUF_LEN 48
  157. #define ubifs_dbg_msg_key(type, key, fmt, ...) do { \
  158. char __tmp_key_buf[DBG_KEY_BUF_LEN]; \
  159. pr_debug("UBIFS DBG " type ": " fmt "%s\n", ##__VA_ARGS__, \
  160. dbg_snprintf_key(c, key, __tmp_key_buf, DBG_KEY_BUF_LEN)); \
  161. } while (0)
  162. /* Just a debugging messages not related to any specific UBIFS subsystem */
  163. #define dbg_msg(fmt, ...) \
  164. printk(KERN_DEBUG "UBIFS DBG (pid %d): %s: " fmt "\n", current->pid, \
  165. __func__, ##__VA_ARGS__)
  166. /* General messages */
  167. #define dbg_gen(fmt, ...) ubifs_dbg_msg("gen", fmt, ##__VA_ARGS__)
  168. /* Additional journal messages */
  169. #define dbg_jnl(fmt, ...) ubifs_dbg_msg("jnl", fmt, ##__VA_ARGS__)
  170. #define dbg_jnlk(key, fmt, ...) \
  171. ubifs_dbg_msg_key("jnl", key, fmt, ##__VA_ARGS__)
  172. /* Additional TNC messages */
  173. #define dbg_tnc(fmt, ...) ubifs_dbg_msg("tnc", fmt, ##__VA_ARGS__)
  174. #define dbg_tnck(key, fmt, ...) \
  175. ubifs_dbg_msg_key("tnc", key, fmt, ##__VA_ARGS__)
  176. /* Additional lprops messages */
  177. #define dbg_lp(fmt, ...) ubifs_dbg_msg("lp", fmt, ##__VA_ARGS__)
  178. /* Additional LEB find messages */
  179. #define dbg_find(fmt, ...) ubifs_dbg_msg("find", fmt, ##__VA_ARGS__)
  180. /* Additional mount messages */
  181. #define dbg_mnt(fmt, ...) ubifs_dbg_msg("mnt", fmt, ##__VA_ARGS__)
  182. #define dbg_mntk(key, fmt, ...) \
  183. ubifs_dbg_msg_key("mnt", key, fmt, ##__VA_ARGS__)
  184. /* Additional I/O messages */
  185. #define dbg_io(fmt, ...) ubifs_dbg_msg("io", fmt, ##__VA_ARGS__)
  186. /* Additional commit messages */
  187. #define dbg_cmt(fmt, ...) ubifs_dbg_msg("cmt", fmt, ##__VA_ARGS__)
  188. /* Additional budgeting messages */
  189. #define dbg_budg(fmt, ...) ubifs_dbg_msg("budg", fmt, ##__VA_ARGS__)
  190. /* Additional log messages */
  191. #define dbg_log(fmt, ...) ubifs_dbg_msg("log", fmt, ##__VA_ARGS__)
  192. /* Additional gc messages */
  193. #define dbg_gc(fmt, ...) ubifs_dbg_msg("gc", fmt, ##__VA_ARGS__)
  194. /* Additional scan messages */
  195. #define dbg_scan(fmt, ...) ubifs_dbg_msg("scan", fmt, ##__VA_ARGS__)
  196. /* Additional recovery messages */
  197. #define dbg_rcvry(fmt, ...) ubifs_dbg_msg("rcvry", fmt, ##__VA_ARGS__)
  198. extern struct ubifs_global_debug_info ubifs_dbg;
  199. static inline int dbg_is_chk_gen(const struct ubifs_info *c)
  200. {
  201. return !!(ubifs_dbg.chk_gen || c->dbg->chk_gen);
  202. }
  203. static inline int dbg_is_chk_index(const struct ubifs_info *c)
  204. {
  205. return !!(ubifs_dbg.chk_index || c->dbg->chk_index);
  206. }
  207. static inline int dbg_is_chk_orph(const struct ubifs_info *c)
  208. {
  209. return !!(ubifs_dbg.chk_orph || c->dbg->chk_orph);
  210. }
  211. static inline int dbg_is_chk_lprops(const struct ubifs_info *c)
  212. {
  213. return !!(ubifs_dbg.chk_lprops || c->dbg->chk_lprops);
  214. }
  215. static inline int dbg_is_chk_fs(const struct ubifs_info *c)
  216. {
  217. return !!(ubifs_dbg.chk_fs || c->dbg->chk_fs);
  218. }
  219. static inline int dbg_is_tst_rcvry(const struct ubifs_info *c)
  220. {
  221. return !!(ubifs_dbg.tst_rcvry || c->dbg->tst_rcvry);
  222. }
  223. static inline int dbg_is_power_cut(const struct ubifs_info *c)
  224. {
  225. return !!c->dbg->pc_happened;
  226. }
  227. int ubifs_debugging_init(struct ubifs_info *c);
  228. void ubifs_debugging_exit(struct ubifs_info *c);
  229. /* Dump functions */
  230. const char *dbg_ntype(int type);
  231. const char *dbg_cstate(int cmt_state);
  232. const char *dbg_jhead(int jhead);
  233. const char *dbg_get_key_dump(const struct ubifs_info *c,
  234. const union ubifs_key *key);
  235. const char *dbg_snprintf_key(const struct ubifs_info *c,
  236. const union ubifs_key *key, char *buffer, int len);
  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_jnlk(key, fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  317. #define dbg_tnc(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  318. #define dbg_tnck(key, fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  319. #define dbg_lp(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  320. #define dbg_find(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  321. #define dbg_mnt(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  322. #define dbg_mntk(key, fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  323. #define dbg_io(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  324. #define dbg_cmt(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  325. #define dbg_budg(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  326. #define dbg_log(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  327. #define dbg_gc(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  328. #define dbg_scan(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  329. #define dbg_rcvry(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
  330. static inline int ubifs_debugging_init(struct ubifs_info *c) { return 0; }
  331. static inline void ubifs_debugging_exit(struct ubifs_info *c) { return; }
  332. static inline const char *dbg_ntype(int type) { return ""; }
  333. static inline const char *dbg_cstate(int cmt_state) { return ""; }
  334. static inline const char *dbg_jhead(int jhead) { return ""; }
  335. static inline const char *
  336. dbg_get_key_dump(const struct ubifs_info *c,
  337. const union ubifs_key *key) { return ""; }
  338. static inline const char *
  339. dbg_snprintf_key(const struct ubifs_info *c,
  340. const union ubifs_key *key, char *buffer,
  341. int len) { return ""; }
  342. static inline void dbg_dump_inode(struct ubifs_info *c,
  343. const struct inode *inode) { return; }
  344. static inline void dbg_dump_node(const struct ubifs_info *c,
  345. const void *node) { return; }
  346. static inline void dbg_dump_lpt_node(const struct ubifs_info *c,
  347. void *node, int lnum,
  348. int offs) { return; }
  349. static inline void
  350. dbg_dump_budget_req(const struct ubifs_budget_req *req) { return; }
  351. static inline void
  352. dbg_dump_lstats(const struct ubifs_lp_stats *lst) { return; }
  353. static inline void
  354. dbg_dump_budg(struct ubifs_info *c,
  355. const struct ubifs_budg_info *bi) { return; }
  356. static inline void dbg_dump_lprop(const struct ubifs_info *c,
  357. const struct ubifs_lprops *lp) { return; }
  358. static inline void dbg_dump_lprops(struct ubifs_info *c) { return; }
  359. static inline void dbg_dump_lpt_info(struct ubifs_info *c) { return; }
  360. static inline void dbg_dump_leb(const struct ubifs_info *c,
  361. int lnum) { return; }
  362. static inline void
  363. dbg_dump_sleb(const struct ubifs_info *c,
  364. const struct ubifs_scan_leb *sleb, int offs) { return; }
  365. static inline void
  366. dbg_dump_znode(const struct ubifs_info *c,
  367. const struct ubifs_znode *znode) { return; }
  368. static inline void dbg_dump_heap(struct ubifs_info *c,
  369. struct ubifs_lpt_heap *heap,
  370. int cat) { return; }
  371. static inline void dbg_dump_pnode(struct ubifs_info *c,
  372. struct ubifs_pnode *pnode,
  373. struct ubifs_nnode *parent,
  374. int iip) { return; }
  375. static inline void dbg_dump_tnc(struct ubifs_info *c) { return; }
  376. static inline void dbg_dump_index(struct ubifs_info *c) { return; }
  377. static inline void dbg_dump_lpt_lebs(const struct ubifs_info *c) { return; }
  378. static inline int dbg_walk_index(struct ubifs_info *c,
  379. dbg_leaf_callback leaf_cb,
  380. dbg_znode_callback znode_cb,
  381. void *priv) { return 0; }
  382. static inline void dbg_save_space_info(struct ubifs_info *c) { return; }
  383. static inline int dbg_check_space_info(struct ubifs_info *c) { return 0; }
  384. static inline int dbg_check_lprops(struct ubifs_info *c) { return 0; }
  385. static inline int
  386. dbg_old_index_check_init(struct ubifs_info *c,
  387. struct ubifs_zbranch *zroot) { return 0; }
  388. static inline int
  389. dbg_check_old_index(struct ubifs_info *c,
  390. struct ubifs_zbranch *zroot) { return 0; }
  391. static inline int dbg_check_cats(struct ubifs_info *c) { return 0; }
  392. static inline int dbg_check_ltab(struct ubifs_info *c) { return 0; }
  393. static inline int dbg_chk_lpt_free_spc(struct ubifs_info *c) { return 0; }
  394. static inline int dbg_chk_lpt_sz(struct ubifs_info *c,
  395. int action, int len) { return 0; }
  396. static inline int
  397. dbg_check_synced_i_size(const struct ubifs_info *c,
  398. struct inode *inode) { return 0; }
  399. static inline int dbg_check_dir(struct ubifs_info *c,
  400. const struct inode *dir) { return 0; }
  401. static inline int dbg_check_tnc(struct ubifs_info *c, int extra) { return 0; }
  402. static inline int dbg_check_idx_size(struct ubifs_info *c,
  403. long long idx_size) { return 0; }
  404. static inline int dbg_check_filesystem(struct ubifs_info *c) { return 0; }
  405. static inline void dbg_check_heap(struct ubifs_info *c,
  406. struct ubifs_lpt_heap *heap,
  407. int cat, int add_pos) { return; }
  408. static inline int dbg_check_lpt_nodes(struct ubifs_info *c,
  409. struct ubifs_cnode *cnode, int row, int col) { return 0; }
  410. static inline int dbg_check_inode_size(struct ubifs_info *c,
  411. const struct inode *inode,
  412. loff_t size) { return 0; }
  413. static inline int
  414. dbg_check_data_nodes_order(struct ubifs_info *c,
  415. struct list_head *head) { return 0; }
  416. static inline int
  417. dbg_check_nondata_nodes_order(struct ubifs_info *c,
  418. struct list_head *head) { return 0; }
  419. static inline int dbg_leb_write(struct ubifs_info *c, int lnum,
  420. const void *buf, int offset,
  421. int len, int dtype) { return 0; }
  422. static inline int dbg_leb_change(struct ubifs_info *c, int lnum,
  423. const void *buf, int len,
  424. int dtype) { return 0; }
  425. static inline int dbg_leb_unmap(struct ubifs_info *c, int lnum) { return 0; }
  426. static inline int dbg_leb_map(struct ubifs_info *c, int lnum,
  427. int dtype) { return 0; }
  428. static inline int dbg_is_chk_gen(const struct ubifs_info *c) { return 0; }
  429. static inline int dbg_is_chk_index(const struct ubifs_info *c) { return 0; }
  430. static inline int dbg_is_chk_orph(const struct ubifs_info *c) { return 0; }
  431. static inline int dbg_is_chk_lprops(const struct ubifs_info *c) { return 0; }
  432. static inline int dbg_is_chk_fs(const struct ubifs_info *c) { return 0; }
  433. static inline int dbg_is_tst_rcvry(const struct ubifs_info *c) { return 0; }
  434. static inline int dbg_is_power_cut(const struct ubifs_info *c) { return 0; }
  435. static inline int dbg_debugfs_init(void) { return 0; }
  436. static inline void dbg_debugfs_exit(void) { return; }
  437. static inline int dbg_debugfs_init_fs(struct ubifs_info *c) { return 0; }
  438. static inline int dbg_debugfs_exit_fs(struct ubifs_info *c) { return 0; }
  439. #endif /* !CONFIG_UBIFS_FS_DEBUG */
  440. #endif /* !__UBIFS_DEBUG_H__ */