#ifndef _JFFS2_DEBUG_H_
#define _JFFS2_DEBUG_H_
#include <linux/printk.h>
#include <linux/sched.h>
#ifndef CONFIG_JFFS2_FS_DEBUG
#define CONFIG_JFFS2_FS_DEBUG …
#endif
#if CONFIG_JFFS2_FS_DEBUG > 0
#define JFFS2_DBG_PARANOIA_CHECKS
#define JFFS2_DBG_DUMPS
#define JFFS2_DBG_READINODE_MESSAGES
#define JFFS2_DBG_FRAGTREE_MESSAGES
#define JFFS2_DBG_DENTLIST_MESSAGES
#define JFFS2_DBG_NODEREF_MESSAGES
#define JFFS2_DBG_INOCACHE_MESSAGES
#define JFFS2_DBG_SUMMARY_MESSAGES
#define JFFS2_DBG_FSBUILD_MESSAGES
#endif
#if CONFIG_JFFS2_FS_DEBUG > 1
#define JFFS2_DBG_FRAGTREE2_MESSAGES
#define JFFS2_DBG_READINODE2_MESSAGES
#define JFFS2_DBG_MEMALLOC_MESSAGES
#endif
#define JFFS2_DBG_SANITY_CHECKS
#if CONFIG_JFFS2_FS_DEBUG > 0
#define DEBUG
#define D1 …
#else
#define D1(x) …
#endif
#if CONFIG_JFFS2_FS_DEBUG > 1
#define D2 …
#else
#define D2(x) …
#endif
#define jffs2_dbg(level, fmt, ...) …
#define JFFS2_DBG …
#define JFFS2_DBG_PREFIX …
#define JFFS2_DBG_MSG_PREFIX …
#define JFFS2_ERROR(fmt, ...) …
#define JFFS2_WARNING(fmt, ...) …
#define JFFS2_NOTICE(fmt, ...) …
#define JFFS2_DEBUG(fmt, ...) …
#ifdef JFFS2_DBG_READINODE_MESSAGES
#define dbg_readinode …
#else
#define dbg_readinode(fmt, ...) …
#endif
#ifdef JFFS2_DBG_READINODE2_MESSAGES
#define dbg_readinode2 …
#else
#define dbg_readinode2(fmt, ...) …
#endif
#ifdef JFFS2_DBG_FRAGTREE_MESSAGES
#define dbg_fragtree …
#else
#define dbg_fragtree(fmt, ...) …
#endif
#ifdef JFFS2_DBG_FRAGTREE2_MESSAGES
#define dbg_fragtree2 …
#else
#define dbg_fragtree2(fmt, ...) …
#endif
#ifdef JFFS2_DBG_DENTLIST_MESSAGES
#define dbg_dentlist …
#else
#define dbg_dentlist(fmt, ...) …
#endif
#ifdef JFFS2_DBG_NODEREF_MESSAGES
#define dbg_noderef …
#else
#define dbg_noderef(fmt, ...) …
#endif
#ifdef JFFS2_DBG_INOCACHE_MESSAGES
#define dbg_inocache …
#else
#define dbg_inocache(fmt, ...) …
#endif
#ifdef JFFS2_DBG_SUMMARY_MESSAGES
#define dbg_summary …
#else
#define dbg_summary(fmt, ...) …
#endif
#ifdef JFFS2_DBG_FSBUILD_MESSAGES
#define dbg_fsbuild …
#else
#define dbg_fsbuild(fmt, ...) …
#endif
#ifdef JFFS2_DBG_MEMALLOC_MESSAGES
#define dbg_memalloc …
#else
#define dbg_memalloc(fmt, ...) …
#endif
#ifdef JFFS2_DBG_XATTR_MESSAGES
#define dbg_xattr …
#else
#define dbg_xattr(fmt, ...) …
#endif
void
__jffs2_dbg_acct_sanity_check_nolock(struct jffs2_sb_info *c,
struct jffs2_eraseblock *jeb);
void
__jffs2_dbg_acct_sanity_check(struct jffs2_sb_info *c,
struct jffs2_eraseblock *jeb);
void
__jffs2_dbg_fragtree_paranoia_check(struct jffs2_inode_info *f);
void
__jffs2_dbg_fragtree_paranoia_check_nolock(struct jffs2_inode_info *f);
void
__jffs2_dbg_acct_paranoia_check(struct jffs2_sb_info *c,
struct jffs2_eraseblock *jeb);
void
__jffs2_dbg_acct_paranoia_check_nolock(struct jffs2_sb_info *c,
struct jffs2_eraseblock *jeb);
void
__jffs2_dbg_prewrite_paranoia_check(struct jffs2_sb_info *c,
uint32_t ofs, int len);
void
__jffs2_dbg_dump_jeb(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
void
__jffs2_dbg_dump_jeb_nolock(struct jffs2_eraseblock *jeb);
void
__jffs2_dbg_dump_block_lists(struct jffs2_sb_info *c);
void
__jffs2_dbg_dump_block_lists_nolock(struct jffs2_sb_info *c);
void
__jffs2_dbg_dump_node_refs(struct jffs2_sb_info *c,
struct jffs2_eraseblock *jeb);
void
__jffs2_dbg_dump_node_refs_nolock(struct jffs2_sb_info *c,
struct jffs2_eraseblock *jeb);
void
__jffs2_dbg_dump_fragtree(struct jffs2_inode_info *f);
void
__jffs2_dbg_dump_fragtree_nolock(struct jffs2_inode_info *f);
void
__jffs2_dbg_dump_buffer(unsigned char *buf, int len, uint32_t offs);
void
__jffs2_dbg_dump_node(struct jffs2_sb_info *c, uint32_t ofs);
#ifdef JFFS2_DBG_PARANOIA_CHECKS
#define jffs2_dbg_fragtree_paranoia_check …
#define jffs2_dbg_fragtree_paranoia_check_nolock …
#define jffs2_dbg_acct_paranoia_check …
#define jffs2_dbg_acct_paranoia_check_nolock …
#define jffs2_dbg_prewrite_paranoia_check …
#else
#define jffs2_dbg_fragtree_paranoia_check(f) …
#define jffs2_dbg_fragtree_paranoia_check_nolock(f) …
#define jffs2_dbg_acct_paranoia_check(c, jeb) …
#define jffs2_dbg_acct_paranoia_check_nolock(c, jeb) …
#define jffs2_dbg_prewrite_paranoia_check(c, ofs, len) …
#endif
#ifdef JFFS2_DBG_DUMPS
#define jffs2_dbg_dump_jeb …
#define jffs2_dbg_dump_jeb_nolock …
#define jffs2_dbg_dump_block_lists …
#define jffs2_dbg_dump_block_lists_nolock …
#define jffs2_dbg_dump_fragtree …
#define jffs2_dbg_dump_fragtree_nolock …
#define jffs2_dbg_dump_buffer …
#define jffs2_dbg_dump_node …
#else
#define jffs2_dbg_dump_jeb(c, jeb) …
#define jffs2_dbg_dump_jeb_nolock(jeb) …
#define jffs2_dbg_dump_block_lists(c) …
#define jffs2_dbg_dump_block_lists_nolock(c) …
#define jffs2_dbg_dump_fragtree(f) …
#define jffs2_dbg_dump_fragtree_nolock(f) …
#define jffs2_dbg_dump_buffer(buf, len, offs) …
#define jffs2_dbg_dump_node(c, ofs) …
#endif
#ifdef JFFS2_DBG_SANITY_CHECKS
#define jffs2_dbg_acct_sanity_check(c, jeb) …
#define jffs2_dbg_acct_sanity_check_nolock(c, jeb) …
#else
#define jffs2_dbg_acct_sanity_check …
#define jffs2_dbg_acct_sanity_check_nolock …
#endif
#endif