18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * This file is part of UBIFS. 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 2006-2008 Nokia Corporation. 68c2ecf20Sopenharmony_ci * 78c2ecf20Sopenharmony_ci * Authors: Artem Bityutskiy (Битюцкий Артём) 88c2ecf20Sopenharmony_ci * Adrian Hunter 98c2ecf20Sopenharmony_ci */ 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#ifndef __UBIFS_DEBUG_H__ 128c2ecf20Sopenharmony_ci#define __UBIFS_DEBUG_H__ 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci/* Checking helper functions */ 158c2ecf20Sopenharmony_citypedef int (*dbg_leaf_callback)(struct ubifs_info *c, 168c2ecf20Sopenharmony_ci struct ubifs_zbranch *zbr, void *priv); 178c2ecf20Sopenharmony_citypedef int (*dbg_znode_callback)(struct ubifs_info *c, 188c2ecf20Sopenharmony_ci struct ubifs_znode *znode, void *priv); 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci/* 218c2ecf20Sopenharmony_ci * The UBIFS debugfs directory name pattern and maximum name length (3 for "ubi" 228c2ecf20Sopenharmony_ci * + 1 for "_" and plus 2x2 for 2 UBI numbers and 1 for the trailing zero byte. 238c2ecf20Sopenharmony_ci */ 248c2ecf20Sopenharmony_ci#define UBIFS_DFS_DIR_NAME "ubi%d_%d" 258c2ecf20Sopenharmony_ci#define UBIFS_DFS_DIR_LEN (3 + 1 + 2*2 + 1) 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci/** 288c2ecf20Sopenharmony_ci * ubifs_debug_info - per-FS debugging information. 298c2ecf20Sopenharmony_ci * @old_zroot: old index root - used by 'dbg_check_old_index()' 308c2ecf20Sopenharmony_ci * @old_zroot_level: old index root level - used by 'dbg_check_old_index()' 318c2ecf20Sopenharmony_ci * @old_zroot_sqnum: old index root sqnum - used by 'dbg_check_old_index()' 328c2ecf20Sopenharmony_ci * 338c2ecf20Sopenharmony_ci * @pc_happened: non-zero if an emulated power cut happened 348c2ecf20Sopenharmony_ci * @pc_delay: 0=>don't delay, 1=>delay a time, 2=>delay a number of calls 358c2ecf20Sopenharmony_ci * @pc_timeout: time in jiffies when delay of failure mode expires 368c2ecf20Sopenharmony_ci * @pc_cnt: current number of calls to failure mode I/O functions 378c2ecf20Sopenharmony_ci * @pc_cnt_max: number of calls by which to delay failure mode 388c2ecf20Sopenharmony_ci * 398c2ecf20Sopenharmony_ci * @chk_lpt_sz: used by LPT tree size checker 408c2ecf20Sopenharmony_ci * @chk_lpt_sz2: used by LPT tree size checker 418c2ecf20Sopenharmony_ci * @chk_lpt_wastage: used by LPT tree size checker 428c2ecf20Sopenharmony_ci * @chk_lpt_lebs: used by LPT tree size checker 438c2ecf20Sopenharmony_ci * @new_nhead_offs: used by LPT tree size checker 448c2ecf20Sopenharmony_ci * @new_ihead_lnum: used by debugging to check @c->ihead_lnum 458c2ecf20Sopenharmony_ci * @new_ihead_offs: used by debugging to check @c->ihead_offs 468c2ecf20Sopenharmony_ci * 478c2ecf20Sopenharmony_ci * @saved_lst: saved lprops statistics (used by 'dbg_save_space_info()') 488c2ecf20Sopenharmony_ci * @saved_bi: saved budgeting information 498c2ecf20Sopenharmony_ci * @saved_free: saved amount of free space 508c2ecf20Sopenharmony_ci * @saved_idx_gc_cnt: saved value of @c->idx_gc_cnt 518c2ecf20Sopenharmony_ci * 528c2ecf20Sopenharmony_ci * @chk_gen: if general extra checks are enabled 538c2ecf20Sopenharmony_ci * @chk_index: if index xtra checks are enabled 548c2ecf20Sopenharmony_ci * @chk_orph: if orphans extra checks are enabled 558c2ecf20Sopenharmony_ci * @chk_lprops: if lprops extra checks are enabled 568c2ecf20Sopenharmony_ci * @chk_fs: if UBIFS contents extra checks are enabled 578c2ecf20Sopenharmony_ci * @tst_rcvry: if UBIFS recovery testing mode enabled 588c2ecf20Sopenharmony_ci * 598c2ecf20Sopenharmony_ci * @dfs_dir_name: name of debugfs directory containing this file-system's files 608c2ecf20Sopenharmony_ci * @dfs_dir: direntry object of the file-system debugfs directory 618c2ecf20Sopenharmony_ci * @dfs_dump_lprops: "dump lprops" debugfs knob 628c2ecf20Sopenharmony_ci * @dfs_dump_budg: "dump budgeting information" debugfs knob 638c2ecf20Sopenharmony_ci * @dfs_dump_tnc: "dump TNC" debugfs knob 648c2ecf20Sopenharmony_ci * @dfs_chk_gen: debugfs knob to enable UBIFS general extra checks 658c2ecf20Sopenharmony_ci * @dfs_chk_index: debugfs knob to enable UBIFS index extra checks 668c2ecf20Sopenharmony_ci * @dfs_chk_orph: debugfs knob to enable UBIFS orphans extra checks 678c2ecf20Sopenharmony_ci * @dfs_chk_lprops: debugfs knob to enable UBIFS LEP properties extra checks 688c2ecf20Sopenharmony_ci * @dfs_chk_fs: debugfs knob to enable UBIFS contents extra checks 698c2ecf20Sopenharmony_ci * @dfs_tst_rcvry: debugfs knob to enable UBIFS recovery testing 708c2ecf20Sopenharmony_ci * @dfs_ro_error: debugfs knob to switch UBIFS to R/O mode (different to 718c2ecf20Sopenharmony_ci * re-mounting to R/O mode because it does not flush any buffers 728c2ecf20Sopenharmony_ci * and UBIFS just starts returning -EROFS on all write 738c2ecf20Sopenharmony_ci * operations) 748c2ecf20Sopenharmony_ci */ 758c2ecf20Sopenharmony_cistruct ubifs_debug_info { 768c2ecf20Sopenharmony_ci struct ubifs_zbranch old_zroot; 778c2ecf20Sopenharmony_ci int old_zroot_level; 788c2ecf20Sopenharmony_ci unsigned long long old_zroot_sqnum; 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci int pc_happened; 818c2ecf20Sopenharmony_ci int pc_delay; 828c2ecf20Sopenharmony_ci unsigned long pc_timeout; 838c2ecf20Sopenharmony_ci unsigned int pc_cnt; 848c2ecf20Sopenharmony_ci unsigned int pc_cnt_max; 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_ci long long chk_lpt_sz; 878c2ecf20Sopenharmony_ci long long chk_lpt_sz2; 888c2ecf20Sopenharmony_ci long long chk_lpt_wastage; 898c2ecf20Sopenharmony_ci int chk_lpt_lebs; 908c2ecf20Sopenharmony_ci int new_nhead_offs; 918c2ecf20Sopenharmony_ci int new_ihead_lnum; 928c2ecf20Sopenharmony_ci int new_ihead_offs; 938c2ecf20Sopenharmony_ci 948c2ecf20Sopenharmony_ci struct ubifs_lp_stats saved_lst; 958c2ecf20Sopenharmony_ci struct ubifs_budg_info saved_bi; 968c2ecf20Sopenharmony_ci long long saved_free; 978c2ecf20Sopenharmony_ci int saved_idx_gc_cnt; 988c2ecf20Sopenharmony_ci 998c2ecf20Sopenharmony_ci unsigned int chk_gen:1; 1008c2ecf20Sopenharmony_ci unsigned int chk_index:1; 1018c2ecf20Sopenharmony_ci unsigned int chk_orph:1; 1028c2ecf20Sopenharmony_ci unsigned int chk_lprops:1; 1038c2ecf20Sopenharmony_ci unsigned int chk_fs:1; 1048c2ecf20Sopenharmony_ci unsigned int tst_rcvry:1; 1058c2ecf20Sopenharmony_ci 1068c2ecf20Sopenharmony_ci char dfs_dir_name[UBIFS_DFS_DIR_LEN + 1]; 1078c2ecf20Sopenharmony_ci struct dentry *dfs_dir; 1088c2ecf20Sopenharmony_ci struct dentry *dfs_dump_lprops; 1098c2ecf20Sopenharmony_ci struct dentry *dfs_dump_budg; 1108c2ecf20Sopenharmony_ci struct dentry *dfs_dump_tnc; 1118c2ecf20Sopenharmony_ci struct dentry *dfs_chk_gen; 1128c2ecf20Sopenharmony_ci struct dentry *dfs_chk_index; 1138c2ecf20Sopenharmony_ci struct dentry *dfs_chk_orph; 1148c2ecf20Sopenharmony_ci struct dentry *dfs_chk_lprops; 1158c2ecf20Sopenharmony_ci struct dentry *dfs_chk_fs; 1168c2ecf20Sopenharmony_ci struct dentry *dfs_tst_rcvry; 1178c2ecf20Sopenharmony_ci struct dentry *dfs_ro_error; 1188c2ecf20Sopenharmony_ci}; 1198c2ecf20Sopenharmony_ci 1208c2ecf20Sopenharmony_ci/** 1218c2ecf20Sopenharmony_ci * ubifs_global_debug_info - global (not per-FS) UBIFS debugging information. 1228c2ecf20Sopenharmony_ci * 1238c2ecf20Sopenharmony_ci * @chk_gen: if general extra checks are enabled 1248c2ecf20Sopenharmony_ci * @chk_index: if index xtra checks are enabled 1258c2ecf20Sopenharmony_ci * @chk_orph: if orphans extra checks are enabled 1268c2ecf20Sopenharmony_ci * @chk_lprops: if lprops extra checks are enabled 1278c2ecf20Sopenharmony_ci * @chk_fs: if UBIFS contents extra checks are enabled 1288c2ecf20Sopenharmony_ci * @tst_rcvry: if UBIFS recovery testing mode enabled 1298c2ecf20Sopenharmony_ci */ 1308c2ecf20Sopenharmony_cistruct ubifs_global_debug_info { 1318c2ecf20Sopenharmony_ci unsigned int chk_gen:1; 1328c2ecf20Sopenharmony_ci unsigned int chk_index:1; 1338c2ecf20Sopenharmony_ci unsigned int chk_orph:1; 1348c2ecf20Sopenharmony_ci unsigned int chk_lprops:1; 1358c2ecf20Sopenharmony_ci unsigned int chk_fs:1; 1368c2ecf20Sopenharmony_ci unsigned int tst_rcvry:1; 1378c2ecf20Sopenharmony_ci}; 1388c2ecf20Sopenharmony_ci 1398c2ecf20Sopenharmony_civoid ubifs_assert_failed(struct ubifs_info *c, const char *expr, 1408c2ecf20Sopenharmony_ci const char *file, int line); 1418c2ecf20Sopenharmony_ci 1428c2ecf20Sopenharmony_ci#define ubifs_assert(c, expr) do { \ 1438c2ecf20Sopenharmony_ci if (unlikely(!(expr))) { \ 1448c2ecf20Sopenharmony_ci ubifs_assert_failed((struct ubifs_info *)c, #expr, __FILE__, \ 1458c2ecf20Sopenharmony_ci __LINE__); \ 1468c2ecf20Sopenharmony_ci } \ 1478c2ecf20Sopenharmony_ci} while (0) 1488c2ecf20Sopenharmony_ci 1498c2ecf20Sopenharmony_ci#define ubifs_assert_cmt_locked(c) do { \ 1508c2ecf20Sopenharmony_ci if (unlikely(down_write_trylock(&(c)->commit_sem))) { \ 1518c2ecf20Sopenharmony_ci up_write(&(c)->commit_sem); \ 1528c2ecf20Sopenharmony_ci ubifs_err(c, "commit lock is not locked!\n"); \ 1538c2ecf20Sopenharmony_ci ubifs_assert(c, 0); \ 1548c2ecf20Sopenharmony_ci } \ 1558c2ecf20Sopenharmony_ci} while (0) 1568c2ecf20Sopenharmony_ci 1578c2ecf20Sopenharmony_ci#define ubifs_dbg_msg(type, fmt, ...) \ 1588c2ecf20Sopenharmony_ci pr_debug("UBIFS DBG " type " (pid %d): " fmt "\n", current->pid, \ 1598c2ecf20Sopenharmony_ci ##__VA_ARGS__) 1608c2ecf20Sopenharmony_ci 1618c2ecf20Sopenharmony_ci#define DBG_KEY_BUF_LEN 48 1628c2ecf20Sopenharmony_ci#define ubifs_dbg_msg_key(type, key, fmt, ...) do { \ 1638c2ecf20Sopenharmony_ci char __tmp_key_buf[DBG_KEY_BUF_LEN]; \ 1648c2ecf20Sopenharmony_ci pr_debug("UBIFS DBG " type " (pid %d): " fmt "%s\n", current->pid, \ 1658c2ecf20Sopenharmony_ci ##__VA_ARGS__, \ 1668c2ecf20Sopenharmony_ci dbg_snprintf_key(c, key, __tmp_key_buf, DBG_KEY_BUF_LEN)); \ 1678c2ecf20Sopenharmony_ci} while (0) 1688c2ecf20Sopenharmony_ci 1698c2ecf20Sopenharmony_ci/* General messages */ 1708c2ecf20Sopenharmony_ci#define dbg_gen(fmt, ...) ubifs_dbg_msg("gen", fmt, ##__VA_ARGS__) 1718c2ecf20Sopenharmony_ci/* Additional journal messages */ 1728c2ecf20Sopenharmony_ci#define dbg_jnl(fmt, ...) ubifs_dbg_msg("jnl", fmt, ##__VA_ARGS__) 1738c2ecf20Sopenharmony_ci#define dbg_jnlk(key, fmt, ...) \ 1748c2ecf20Sopenharmony_ci ubifs_dbg_msg_key("jnl", key, fmt, ##__VA_ARGS__) 1758c2ecf20Sopenharmony_ci/* Additional TNC messages */ 1768c2ecf20Sopenharmony_ci#define dbg_tnc(fmt, ...) ubifs_dbg_msg("tnc", fmt, ##__VA_ARGS__) 1778c2ecf20Sopenharmony_ci#define dbg_tnck(key, fmt, ...) \ 1788c2ecf20Sopenharmony_ci ubifs_dbg_msg_key("tnc", key, fmt, ##__VA_ARGS__) 1798c2ecf20Sopenharmony_ci/* Additional lprops messages */ 1808c2ecf20Sopenharmony_ci#define dbg_lp(fmt, ...) ubifs_dbg_msg("lp", fmt, ##__VA_ARGS__) 1818c2ecf20Sopenharmony_ci/* Additional LEB find messages */ 1828c2ecf20Sopenharmony_ci#define dbg_find(fmt, ...) ubifs_dbg_msg("find", fmt, ##__VA_ARGS__) 1838c2ecf20Sopenharmony_ci/* Additional mount messages */ 1848c2ecf20Sopenharmony_ci#define dbg_mnt(fmt, ...) ubifs_dbg_msg("mnt", fmt, ##__VA_ARGS__) 1858c2ecf20Sopenharmony_ci#define dbg_mntk(key, fmt, ...) \ 1868c2ecf20Sopenharmony_ci ubifs_dbg_msg_key("mnt", key, fmt, ##__VA_ARGS__) 1878c2ecf20Sopenharmony_ci/* Additional I/O messages */ 1888c2ecf20Sopenharmony_ci#define dbg_io(fmt, ...) ubifs_dbg_msg("io", fmt, ##__VA_ARGS__) 1898c2ecf20Sopenharmony_ci/* Additional commit messages */ 1908c2ecf20Sopenharmony_ci#define dbg_cmt(fmt, ...) ubifs_dbg_msg("cmt", fmt, ##__VA_ARGS__) 1918c2ecf20Sopenharmony_ci/* Additional budgeting messages */ 1928c2ecf20Sopenharmony_ci#define dbg_budg(fmt, ...) ubifs_dbg_msg("budg", fmt, ##__VA_ARGS__) 1938c2ecf20Sopenharmony_ci/* Additional log messages */ 1948c2ecf20Sopenharmony_ci#define dbg_log(fmt, ...) ubifs_dbg_msg("log", fmt, ##__VA_ARGS__) 1958c2ecf20Sopenharmony_ci/* Additional gc messages */ 1968c2ecf20Sopenharmony_ci#define dbg_gc(fmt, ...) ubifs_dbg_msg("gc", fmt, ##__VA_ARGS__) 1978c2ecf20Sopenharmony_ci/* Additional scan messages */ 1988c2ecf20Sopenharmony_ci#define dbg_scan(fmt, ...) ubifs_dbg_msg("scan", fmt, ##__VA_ARGS__) 1998c2ecf20Sopenharmony_ci/* Additional recovery messages */ 2008c2ecf20Sopenharmony_ci#define dbg_rcvry(fmt, ...) ubifs_dbg_msg("rcvry", fmt, ##__VA_ARGS__) 2018c2ecf20Sopenharmony_ci 2028c2ecf20Sopenharmony_ciextern struct ubifs_global_debug_info ubifs_dbg; 2038c2ecf20Sopenharmony_ci 2048c2ecf20Sopenharmony_cistatic inline int dbg_is_chk_gen(const struct ubifs_info *c) 2058c2ecf20Sopenharmony_ci{ 2068c2ecf20Sopenharmony_ci return !!(ubifs_dbg.chk_gen || c->dbg->chk_gen); 2078c2ecf20Sopenharmony_ci} 2088c2ecf20Sopenharmony_cistatic inline int dbg_is_chk_index(const struct ubifs_info *c) 2098c2ecf20Sopenharmony_ci{ 2108c2ecf20Sopenharmony_ci return !!(ubifs_dbg.chk_index || c->dbg->chk_index); 2118c2ecf20Sopenharmony_ci} 2128c2ecf20Sopenharmony_cistatic inline int dbg_is_chk_orph(const struct ubifs_info *c) 2138c2ecf20Sopenharmony_ci{ 2148c2ecf20Sopenharmony_ci return !!(ubifs_dbg.chk_orph || c->dbg->chk_orph); 2158c2ecf20Sopenharmony_ci} 2168c2ecf20Sopenharmony_cistatic inline int dbg_is_chk_lprops(const struct ubifs_info *c) 2178c2ecf20Sopenharmony_ci{ 2188c2ecf20Sopenharmony_ci return !!(ubifs_dbg.chk_lprops || c->dbg->chk_lprops); 2198c2ecf20Sopenharmony_ci} 2208c2ecf20Sopenharmony_cistatic inline int dbg_is_chk_fs(const struct ubifs_info *c) 2218c2ecf20Sopenharmony_ci{ 2228c2ecf20Sopenharmony_ci return !!(ubifs_dbg.chk_fs || c->dbg->chk_fs); 2238c2ecf20Sopenharmony_ci} 2248c2ecf20Sopenharmony_cistatic inline int dbg_is_tst_rcvry(const struct ubifs_info *c) 2258c2ecf20Sopenharmony_ci{ 2268c2ecf20Sopenharmony_ci return !!(ubifs_dbg.tst_rcvry || c->dbg->tst_rcvry); 2278c2ecf20Sopenharmony_ci} 2288c2ecf20Sopenharmony_cistatic inline int dbg_is_power_cut(const struct ubifs_info *c) 2298c2ecf20Sopenharmony_ci{ 2308c2ecf20Sopenharmony_ci return !!c->dbg->pc_happened; 2318c2ecf20Sopenharmony_ci} 2328c2ecf20Sopenharmony_ci 2338c2ecf20Sopenharmony_ciint ubifs_debugging_init(struct ubifs_info *c); 2348c2ecf20Sopenharmony_civoid ubifs_debugging_exit(struct ubifs_info *c); 2358c2ecf20Sopenharmony_ci 2368c2ecf20Sopenharmony_ci/* Dump functions */ 2378c2ecf20Sopenharmony_ciconst char *dbg_ntype(int type); 2388c2ecf20Sopenharmony_ciconst char *dbg_cstate(int cmt_state); 2398c2ecf20Sopenharmony_ciconst char *dbg_jhead(int jhead); 2408c2ecf20Sopenharmony_ciconst char *dbg_get_key_dump(const struct ubifs_info *c, 2418c2ecf20Sopenharmony_ci const union ubifs_key *key); 2428c2ecf20Sopenharmony_ciconst char *dbg_snprintf_key(const struct ubifs_info *c, 2438c2ecf20Sopenharmony_ci const union ubifs_key *key, char *buffer, int len); 2448c2ecf20Sopenharmony_civoid ubifs_dump_inode(struct ubifs_info *c, const struct inode *inode); 2458c2ecf20Sopenharmony_civoid ubifs_dump_node(const struct ubifs_info *c, const void *node, 2468c2ecf20Sopenharmony_ci int node_len); 2478c2ecf20Sopenharmony_civoid ubifs_dump_budget_req(const struct ubifs_budget_req *req); 2488c2ecf20Sopenharmony_civoid ubifs_dump_lstats(const struct ubifs_lp_stats *lst); 2498c2ecf20Sopenharmony_civoid ubifs_dump_budg(struct ubifs_info *c, const struct ubifs_budg_info *bi); 2508c2ecf20Sopenharmony_civoid ubifs_dump_lprop(const struct ubifs_info *c, 2518c2ecf20Sopenharmony_ci const struct ubifs_lprops *lp); 2528c2ecf20Sopenharmony_civoid ubifs_dump_lprops(struct ubifs_info *c); 2538c2ecf20Sopenharmony_civoid ubifs_dump_lpt_info(struct ubifs_info *c); 2548c2ecf20Sopenharmony_civoid ubifs_dump_leb(const struct ubifs_info *c, int lnum); 2558c2ecf20Sopenharmony_civoid ubifs_dump_znode(const struct ubifs_info *c, 2568c2ecf20Sopenharmony_ci const struct ubifs_znode *znode); 2578c2ecf20Sopenharmony_civoid ubifs_dump_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, 2588c2ecf20Sopenharmony_ci int cat); 2598c2ecf20Sopenharmony_civoid ubifs_dump_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode, 2608c2ecf20Sopenharmony_ci struct ubifs_nnode *parent, int iip); 2618c2ecf20Sopenharmony_civoid ubifs_dump_tnc(struct ubifs_info *c); 2628c2ecf20Sopenharmony_civoid ubifs_dump_index(struct ubifs_info *c); 2638c2ecf20Sopenharmony_civoid ubifs_dump_lpt_lebs(const struct ubifs_info *c); 2648c2ecf20Sopenharmony_ci 2658c2ecf20Sopenharmony_ciint dbg_walk_index(struct ubifs_info *c, dbg_leaf_callback leaf_cb, 2668c2ecf20Sopenharmony_ci dbg_znode_callback znode_cb, void *priv); 2678c2ecf20Sopenharmony_ci 2688c2ecf20Sopenharmony_ci/* Checking functions */ 2698c2ecf20Sopenharmony_civoid dbg_save_space_info(struct ubifs_info *c); 2708c2ecf20Sopenharmony_ciint dbg_check_space_info(struct ubifs_info *c); 2718c2ecf20Sopenharmony_ciint dbg_check_lprops(struct ubifs_info *c); 2728c2ecf20Sopenharmony_ciint dbg_old_index_check_init(struct ubifs_info *c, struct ubifs_zbranch *zroot); 2738c2ecf20Sopenharmony_ciint dbg_check_old_index(struct ubifs_info *c, struct ubifs_zbranch *zroot); 2748c2ecf20Sopenharmony_ciint dbg_check_cats(struct ubifs_info *c); 2758c2ecf20Sopenharmony_ciint dbg_check_ltab(struct ubifs_info *c); 2768c2ecf20Sopenharmony_ciint dbg_chk_lpt_free_spc(struct ubifs_info *c); 2778c2ecf20Sopenharmony_ciint dbg_chk_lpt_sz(struct ubifs_info *c, int action, int len); 2788c2ecf20Sopenharmony_ciint dbg_check_synced_i_size(const struct ubifs_info *c, struct inode *inode); 2798c2ecf20Sopenharmony_ciint dbg_check_dir(struct ubifs_info *c, const struct inode *dir); 2808c2ecf20Sopenharmony_ciint dbg_check_tnc(struct ubifs_info *c, int extra); 2818c2ecf20Sopenharmony_ciint dbg_check_idx_size(struct ubifs_info *c, long long idx_size); 2828c2ecf20Sopenharmony_ciint dbg_check_filesystem(struct ubifs_info *c); 2838c2ecf20Sopenharmony_civoid dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat, 2848c2ecf20Sopenharmony_ci int add_pos); 2858c2ecf20Sopenharmony_ciint dbg_check_lpt_nodes(struct ubifs_info *c, struct ubifs_cnode *cnode, 2868c2ecf20Sopenharmony_ci int row, int col); 2878c2ecf20Sopenharmony_ciint dbg_check_inode_size(struct ubifs_info *c, const struct inode *inode, 2888c2ecf20Sopenharmony_ci loff_t size); 2898c2ecf20Sopenharmony_ciint dbg_check_data_nodes_order(struct ubifs_info *c, struct list_head *head); 2908c2ecf20Sopenharmony_ciint dbg_check_nondata_nodes_order(struct ubifs_info *c, struct list_head *head); 2918c2ecf20Sopenharmony_ci 2928c2ecf20Sopenharmony_ciint dbg_leb_write(struct ubifs_info *c, int lnum, const void *buf, int offs, 2938c2ecf20Sopenharmony_ci int len); 2948c2ecf20Sopenharmony_ciint dbg_leb_change(struct ubifs_info *c, int lnum, const void *buf, int len); 2958c2ecf20Sopenharmony_ciint dbg_leb_unmap(struct ubifs_info *c, int lnum); 2968c2ecf20Sopenharmony_ciint dbg_leb_map(struct ubifs_info *c, int lnum); 2978c2ecf20Sopenharmony_ci 2988c2ecf20Sopenharmony_ci/* Debugfs-related stuff */ 2998c2ecf20Sopenharmony_civoid dbg_debugfs_init(void); 3008c2ecf20Sopenharmony_civoid dbg_debugfs_exit(void); 3018c2ecf20Sopenharmony_civoid dbg_debugfs_init_fs(struct ubifs_info *c); 3028c2ecf20Sopenharmony_civoid dbg_debugfs_exit_fs(struct ubifs_info *c); 3038c2ecf20Sopenharmony_ci 3048c2ecf20Sopenharmony_ci#endif /* !__UBIFS_DEBUG_H__ */ 305