mtd/fs/jffs3 nodelist.h,3.3,3.4
Artem Bityuckiy
dedekind at infradead.org
Mon Dec 13 10:30:37 EST 2004
Update of /home/cvs/mtd/fs/jffs3
In directory phoenix.infradead.org:/tmp/cvs-serv24012
Modified Files:
nodelist.h
Log Message:
Move debugging stuff to debug.c/debug.h
Index: nodelist.h
===================================================================
RCS file: /home/cvs/mtd/fs/jffs3/nodelist.h,v
retrieving revision 3.3
retrieving revision 3.4
diff -u -r3.3 -r3.4
--- nodelist.h 13 Dec 2004 11:35:41 -0000 3.3
+++ nodelist.h 13 Dec 2004 15:30:33 -0000 3.4
@@ -205,22 +205,6 @@
struct jffs3_raw_node_ref *gc_node; /* Next node to be garbage collected */
};
-#define ACCT_SANITY_CHECK(c, jeb) do { \
- struct jffs3_eraseblock *___j = jeb; \
- if ((___j) && ___j->used_size + ___j->dirty_size + ___j->free_size + ___j->wasted_size + ___j->unchecked_size != c->sector_size) { \
- printk(KERN_NOTICE "Eeep. Space accounting for block at 0x%08x is screwed\n", ___j->offset); \
- printk(KERN_NOTICE "free 0x%08x + dirty 0x%08x + used %08x + wasted %08x + unchecked %08x != total %08x\n", \
- ___j->free_size, ___j->dirty_size, ___j->used_size, ___j->wasted_size, ___j->unchecked_size, c->sector_size); \
- BUG(); \
- } \
- if (c->used_size + c->dirty_size + c->free_size + c->erasing_size + c->bad_size + c->wasted_size + c->unchecked_size != c->flash_size) { \
- printk(KERN_NOTICE "Eeep. Space accounting superblock info is screwed\n"); \
- printk(KERN_NOTICE "free 0x%08x + dirty 0x%08x + used %08x + erasing %08x + bad %08x + wasted %08x + unchecked %08x != total %08x\n", \
- c->free_size, c->dirty_size, c->used_size, c->erasing_size, c->bad_size, c->wasted_size, c->unchecked_size, c->flash_size); \
- BUG(); \
- } \
-} while(0)
-
static inline void paranoia_failed_dump(struct jffs3_eraseblock *jeb)
{
struct jffs3_raw_node_ref *ref;
@@ -237,47 +221,6 @@
printk("\n");
}
-
-#define ACCT_PARANOIA_CHECK(jeb) do { \
- uint32_t my_used_size = 0; \
- uint32_t my_unchecked_size = 0; \
- struct jffs3_raw_node_ref *ref2 = jeb->first_node; \
- while (ref2) { \
- if (unlikely(ref2->flash_offset < jeb->offset || \
- ref2->flash_offset > jeb->offset + c->sector_size)) { \
- printk(KERN_NOTICE "Node %08x shouldn't be in block at %08x!\n", \
- ref_offset(ref2), jeb->offset); \
- paranoia_failed_dump(jeb); \
- BUG(); \
- } \
- if (ref_flags(ref2) == REF_UNCHECKED) \
- my_unchecked_size += ref_totlen(c, jeb, ref2); \
- else if (!ref_obsolete(ref2)) \
- my_used_size += ref_totlen(c, jeb, ref2); \
- if (unlikely((!ref2->next_phys) != (ref2 == jeb->last_node))) { \
- if (!ref2->next_phys) \
- printk("ref for node at %p (phys %08x) has next_phys->%p (----), last_node->%p (phys %08x)\n", \
- ref2, ref_offset(ref2), ref2->next_phys, \
- jeb->last_node, ref_offset(jeb->last_node)); \
- else \
- printk("ref for node at %p (phys %08x) has next_phys->%p (%08x), last_node->%p (phys %08x)\n", \
- ref2, ref_offset(ref2), ref2->next_phys, ref_offset(ref2->next_phys), \
- jeb->last_node, ref_offset(jeb->last_node)); \
- paranoia_failed_dump(jeb); \
- BUG(); \
- } \
- ref2 = ref2->next_phys; \
- } \
- if (my_used_size != jeb->used_size) { \
- printk(KERN_NOTICE "Calculated used size %08x != stored used size %08x\n", my_used_size, jeb->used_size); \
- BUG(); \
- } \
- if (my_unchecked_size != jeb->unchecked_size) { \
- printk(KERN_NOTICE "Calculated unchecked size %08x != stored unchecked size %08x\n", my_unchecked_size, jeb->unchecked_size); \
- BUG(); \
- } \
- } while(0)
-
/* Calculate totlen from surrounding nodes or eraseblock */
static inline uint32_t __ref_totlen(struct jffs3_sb_info *c,
struct jffs3_eraseblock *jeb,
@@ -370,7 +313,6 @@
#define frag_erase(frag, list) rb_erase(&frag->rb, list);
/* nodelist.c */
-D2(void jffs3_print_frag_list(struct jffs3_inode_info *f));
void jffs3_add_fd_to_list(struct jffs3_sb_info *c, struct jffs3_full_dirent *new, struct jffs3_full_dirent **list);
int jffs3_get_inode_nodes(struct jffs3_sb_info *c, struct jffs3_inode_info *f,
struct jffs3_tmp_dnode_info **tnp, struct jffs3_full_dirent **fdp,
@@ -396,7 +338,6 @@
int jffs3_add_physical_node_ref(struct jffs3_sb_info *c, struct jffs3_raw_node_ref *new);
void jffs3_complete_reservation(struct jffs3_sb_info *c);
void jffs3_mark_node_obsolete(struct jffs3_sb_info *c, struct jffs3_raw_node_ref *raw);
-void jffs3_dump_block_lists(struct jffs3_sb_info *c);
/* write.c */
int jffs3_do_new_inode(struct jffs3_sb_info *c, struct jffs3_inode_info *f, uint32_t mode, struct jffs3_raw_inode *ri);
@@ -471,3 +412,6 @@
#endif
#endif /* __JFFS3_NODELIST_H__ */
+
+#include "debug.h"
+
More information about the linux-mtd-cvs
mailing list