fs/ubifs/debug.h

Source file repositories/reference/linux-study-clean/fs/ubifs/debug.h

File Facts

System
Linux kernel
Corpus path
fs/ubifs/debug.h
Extension
.h
Size
12106 bytes
Lines
306
Domain
Core OS
Bucket
VFS And Filesystem Core
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct ubifs_debug_info {
	struct ubifs_zbranch old_zroot;
	int old_zroot_level;
	unsigned long long old_zroot_sqnum;

	int pc_happened;
	int pc_delay;
	unsigned long pc_timeout;
	unsigned int pc_cnt;
	unsigned int pc_cnt_max;

	long long chk_lpt_sz;
	long long chk_lpt_sz2;
	long long chk_lpt_wastage;
	int chk_lpt_lebs;
	int new_nhead_offs;
	int new_ihead_lnum;
	int new_ihead_offs;

	struct ubifs_lp_stats saved_lst;
	struct ubifs_budg_info saved_bi;
	long long saved_free;
	int saved_idx_gc_cnt;

	unsigned int chk_gen:1;
	unsigned int chk_index:1;
	unsigned int chk_orph:1;
	unsigned int chk_lprops:1;
	unsigned int chk_fs:1;
	unsigned int tst_rcvry:1;

	char dfs_dir_name[UBIFS_DFS_DIR_LEN];
	struct dentry *dfs_dir;
	struct dentry *dfs_dump_lprops;
	struct dentry *dfs_dump_budg;
	struct dentry *dfs_dump_tnc;
	struct dentry *dfs_chk_gen;
	struct dentry *dfs_chk_index;
	struct dentry *dfs_chk_orph;
	struct dentry *dfs_chk_lprops;
	struct dentry *dfs_chk_fs;
	struct dentry *dfs_tst_rcvry;
	struct dentry *dfs_ro_error;
};

/**
 * ubifs_global_debug_info - global (not per-FS) UBIFS debugging information.
 *
 * @chk_gen: if general extra checks are enabled
 * @chk_index: if index xtra checks are enabled
 * @chk_orph: if orphans extra checks are enabled
 * @chk_lprops: if lprops extra checks are enabled
 * @chk_fs: if UBIFS contents extra checks are enabled
 * @tst_rcvry: if UBIFS recovery testing mode enabled
 */
struct ubifs_global_debug_info {
	unsigned int chk_gen:1;
	unsigned int chk_index:1;
	unsigned int chk_orph:1;
	unsigned int chk_lprops:1;
	unsigned int chk_fs:1;
	unsigned int tst_rcvry:1;
};

void ubifs_assert_failed(struct ubifs_info *c, const char *expr,
	const char *file, int line);

#define ubifs_assert(c, expr) do {                                             \
	if (unlikely(!(expr))) {                                               \
		ubifs_assert_failed((struct ubifs_info *)c, #expr, __FILE__,   \
		 __LINE__);                                                    \
	}                                                                      \
} while (0)

#define ubifs_assert_cmt_locked(c) do {                                        \
	if (unlikely(down_write_trylock(&(c)->commit_sem))) {                  \
		up_write(&(c)->commit_sem);                                    \
		ubifs_err(c, "commit lock is not locked!\n");                  \
		ubifs_assert(c, 0);                                            \
	}                                                                      \
} while (0)

#define ubifs_dbg_msg(type, fmt, ...) \
	pr_debug("UBIFS DBG " type " (pid %d): " fmt "\n", current->pid,       \
		 ##__VA_ARGS__)

#define DBG_KEY_BUF_LEN 48
#define ubifs_dbg_msg_key(type, key, fmt, ...) do {                            \
	char __tmp_key_buf[DBG_KEY_BUF_LEN];                                   \
	pr_debug("UBIFS DBG " type " (pid %d): " fmt "%s\n", current->pid,     \

Annotation

Implementation Notes