mtd/fs/jffs2 debug.h, 1.16, 1.17 erase.c, 1.83, 1.84 malloc.c, 1.29, 1.30 nodelist.c, 1.112, 1.113 readinode.c, 1.141, 1.142 scan.c, 1.122, 1.123 summary.c, 1.1, 1.2

Artem Bityutskiy dedekind at infradead.org
Tue Sep 20 10:27:37 EDT 2005


Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv4916

Modified Files:
	debug.h erase.c malloc.c nodelist.c readinode.c scan.c 
	summary.c 
Log Message:
[JFFS2] refine debugging stuff. Make debugging print functions shorter and more
readable.


Index: debug.h
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/debug.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- debug.h	14 Sep 2005 16:57:32 -0000	1.16
+++ debug.h	20 Sep 2005 14:27:34 -0000	1.17
@@ -23,6 +23,11 @@
 /* Enable "paranoia" checks and dumps */
 #define JFFS2_DBG_PARANOIA_CHECKS
 #define JFFS2_DBG_DUMPS
+
+/* 
+ * By defining/undefining the below macros one may select debugging messages
+ * fro specific JFFS2 subsystems.
+ */
 #define JFFS2_DBG_READINODE_MESSAGES
 #define JFFS2_DBG_FRAGTREE_MESSAGES
 #define JFFS2_DBG_DENTLIST_MESSAGES
@@ -33,6 +38,7 @@
 
 #if CONFIG_JFFS2_FS_DEBUG == 2
 #define JFFS2_DBG_FRAGTREE2_MESSAGES
+#define JFFS2_DBG_MEMALLOC_MESSAGES
 #endif
 
 /* Sanity checks are supposed to be light-weight and enabled by default */
@@ -40,7 +46,7 @@
 
 /* 
  * Dx() are mainly used for debugging messages, they must go away and be
- * superseded by nicer JFFS2_DBG_XXX() macros...
+ * superseded by nicer dbg_xxx() macros...
  */
 #if CONFIG_JFFS2_FS_DEBUG > 0
 #define D1(x) x
@@ -105,56 +111,56 @@
  */
 /* Read inode debugging messages */
 #ifdef JFFS2_DBG_READINODE_MESSAGES
-#define JFFS2_DBG_READINODE(fmt, ...)	JFFS2_DEBUG(fmt, ##__VA_ARGS__)
+#define dbg_readinode(fmt, ...)	JFFS2_DEBUG(fmt, ##__VA_ARGS__)
 #else
-#define JFFS2_DBG_READINODE(fmt, ...)
+#define dbg_readinode(fmt, ...)
 #endif
 
 /* Fragtree build debugging messages */
 #ifdef JFFS2_DBG_FRAGTREE_MESSAGES
-#define JFFS2_DBG_FRAGTREE(fmt, ...)	JFFS2_DEBUG(fmt, ##__VA_ARGS__)
+#define dbg_fragtree(fmt, ...)	JFFS2_DEBUG(fmt, ##__VA_ARGS__)
 #else
-#define JFFS2_DBG_FRAGTREE(fmt, ...)
+#define dbg_fragtree(fmt, ...)
 #endif
 #ifdef JFFS2_DBG_FRAGTREE2_MESSAGES
-#define JFFS2_DBG_FRAGTREE2(fmt, ...)	JFFS2_DEBUG(fmt, ##__VA_ARGS__)
+#define dbg_fragtree2(fmt, ...)	JFFS2_DEBUG(fmt, ##__VA_ARGS__)
 #else
-#define JFFS2_DBG_FRAGTREE2(fmt, ...)
+#define dbg_fragtree2(fmt, ...)
 #endif
 
 /* Directory entry list manilulation debugging messages */
 #ifdef JFFS2_DBG_DENTLIST_MESSAGES
-#define JFFS2_DBG_DENTLIST(fmt, ...)	JFFS2_DEBUG(fmt, ##__VA_ARGS__)
+#define dbg_dentlist(fmt, ...)	JFFS2_DEBUG(fmt, ##__VA_ARGS__)
 #else
-#define JFFS2_DBG_DENTLIST(fmt, ...)
+#define dbg_dentlist(fmt, ...)
 #endif
 
 /* Print the messages about manipulating node_refs */
 #ifdef JFFS2_DBG_NODEREF_MESSAGES
-#define JFFS2_DBG_NODEREF(fmt, ...)	JFFS2_DEBUG(fmt, ##__VA_ARGS__)
+#define dbg_noderef(fmt, ...)	JFFS2_DEBUG(fmt, ##__VA_ARGS__)
 #else
-#define JFFS2_DBG_NODEREF(fmt, ...)
+#define dbg_noderef(fmt, ...)
 #endif
 
 /* Manipulations with the list of inodes (JFFS2 inocache) */
 #ifdef JFFS2_DBG_INOCACHE_MESSAGES
-#define JFFS2_DBG_INOCACHE(fmt, ...)	JFFS2_DEBUG(fmt, ##__VA_ARGS__)
+#define dbg_inocache(fmt, ...)	JFFS2_DEBUG(fmt, ##__VA_ARGS__)
 #else
-#define JFFS2_DBG_INOCACHE(fmt, ...)
+#define dbg_inocache(fmt, ...)
 #endif
 
 /* Summary debugging messages */
 #ifdef JFFS2_DBG_SUMMARY_MESSAGES
-#define JFFS2_DBG_SUMMARY(fmt, ...)	JFFS2_DEBUG(fmt, ##__VA_ARGS__)
+#define dbg_summary(fmt, ...)	JFFS2_DEBUG(fmt, ##__VA_ARGS__)
 #else
-#define JFFS2_DBG_SUMMARY(fmt, ...)
+#define dbg_summary(fmt, ...)
 #endif
 
 /* Watch the object allocations */
 #ifdef JFFS2_DBG_MEMALLOC_MESSAGES
-#define JFFS2_DBG_MEMALLOC(fmt, ...)	JFFS2_DEBUG(fmt, ##__VA_ARGS__)
+#define dbg_memalloc(fmt, ...)	JFFS2_DEBUG(fmt, ##__VA_ARGS__)
 #else
-#define JFFS2_DBG_MEMALLOC(fmt, ...)
+#define dbg_memalloc(fmt, ...)
 #endif
 
 

Index: erase.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/erase.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -r1.83 -r1.84
--- erase.c	22 Jul 2005 10:32:08 -0000	1.83
+++ erase.c	20 Sep 2005 14:27:34 -0000	1.84
@@ -337,6 +337,7 @@
 			if (*datum + 1) {
 				*bad_offset += i;
 				printk(KERN_WARNING "Newly-erased block contained word 0x%lx at offset 0x%08x\n", *datum, *bad_offset);
+				ret = -EIO;
 				goto fail;
 			}
 		}

Index: malloc.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/malloc.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- malloc.c	27 Jul 2005 14:16:53 -0000	1.29
+++ malloc.c	20 Sep 2005 14:27:34 -0000	1.30
@@ -97,13 +97,13 @@
 {
 	struct jffs2_full_dirent *ret;
 	ret = kmalloc(sizeof(struct jffs2_full_dirent) + namesize, GFP_KERNEL);
-	JFFS2_DBG_MEMALLOC("%p\n", ret);
+	dbg_memalloc("%p\n", ret);
 	return ret;
 }
 
 void jffs2_free_full_dirent(struct jffs2_full_dirent *x)
 {
-	JFFS2_DBG_MEMALLOC("%p\n", x);
+	dbg_memalloc("%p\n", x);
 	kfree(x);
 }
 
@@ -111,13 +111,13 @@
 {
 	struct jffs2_full_dnode *ret;
 	ret = kmem_cache_alloc(full_dnode_slab, GFP_KERNEL);
-	JFFS2_DBG_MEMALLOC("%p\n", ret);
+	dbg_memalloc("%p\n", ret);
 	return ret;
 }
 
 void jffs2_free_full_dnode(struct jffs2_full_dnode *x)
 {
-	JFFS2_DBG_MEMALLOC("%p\n", x);
+	dbg_memalloc("%p\n", x);
 	kmem_cache_free(full_dnode_slab, x);
 }
 
@@ -125,13 +125,13 @@
 {
 	struct jffs2_raw_dirent *ret;
 	ret = kmem_cache_alloc(raw_dirent_slab, GFP_KERNEL);
-	JFFS2_DBG_MEMALLOC("%p\n", ret);
+	dbg_memalloc("%p\n", ret);
 	return ret;
 }
 
 void jffs2_free_raw_dirent(struct jffs2_raw_dirent *x)
 {
-	JFFS2_DBG_MEMALLOC("%p\n", x);
+	dbg_memalloc("%p\n", x);
 	kmem_cache_free(raw_dirent_slab, x);
 }
 
@@ -139,13 +139,13 @@
 {
 	struct jffs2_raw_inode *ret;
 	ret = kmem_cache_alloc(raw_inode_slab, GFP_KERNEL);
-	JFFS2_DBG_MEMALLOC("%p\n", ret);
+	dbg_memalloc("%p\n", ret);
 	return ret;
 }
 
 void jffs2_free_raw_inode(struct jffs2_raw_inode *x)
 {
-	JFFS2_DBG_MEMALLOC("%p\n", x);
+	dbg_memalloc("%p\n", x);
 	kmem_cache_free(raw_inode_slab, x);
 }
 
@@ -153,14 +153,14 @@
 {
 	struct jffs2_tmp_dnode_info *ret;
 	ret = kmem_cache_alloc(tmp_dnode_info_slab, GFP_KERNEL);
-	JFFS2_DBG_MEMALLOC("%p\n",
+	dbg_memalloc("%p\n",
 		ret);
 	return ret;
 }
 
 void jffs2_free_tmp_dnode_info(struct jffs2_tmp_dnode_info *x)
 {
-	JFFS2_DBG_MEMALLOC("%p\n", x);
+	dbg_memalloc("%p\n", x);
 	kmem_cache_free(tmp_dnode_info_slab, x);
 }
 
@@ -168,13 +168,13 @@
 {
 	struct jffs2_raw_node_ref *ret;
 	ret = kmem_cache_alloc(raw_node_ref_slab, GFP_KERNEL);
-	JFFS2_DBG_MEMALLOC("%p\n", ret);
+	dbg_memalloc("%p\n", ret);
 	return ret;
 }
 
 void jffs2_free_raw_node_ref(struct jffs2_raw_node_ref *x)
 {
-	JFFS2_DBG_MEMALLOC("%p\n", x);
+	dbg_memalloc("%p\n", x);
 	kmem_cache_free(raw_node_ref_slab, x);
 }
 
@@ -182,13 +182,13 @@
 {
 	struct jffs2_node_frag *ret;
 	ret = kmem_cache_alloc(node_frag_slab, GFP_KERNEL);
-	JFFS2_DBG_MEMALLOC("%p\n", ret);
+	dbg_memalloc("%p\n", ret);
 	return ret;
 }
 
 void jffs2_free_node_frag(struct jffs2_node_frag *x)
 {
-	JFFS2_DBG_MEMALLOC("%p\n", x);
+	dbg_memalloc("%p\n", x);
 	kmem_cache_free(node_frag_slab, x);
 }
 
@@ -196,12 +196,12 @@
 {
 	struct jffs2_inode_cache *ret;
 	ret = kmem_cache_alloc(inode_cache_slab, GFP_KERNEL);
-	JFFS2_DBG_MEMALLOC("%p\n", ret);
+	dbg_memalloc("%p\n", ret);
 	return ret;
 }
 
 void jffs2_free_inode_cache(struct jffs2_inode_cache *x)
 {
-	JFFS2_DBG_MEMALLOC("%p\n", x);
+	dbg_memalloc("%p\n", x);
 	kmem_cache_free(inode_cache_slab, x);
 }

Index: nodelist.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/nodelist.c,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -r1.112 -r1.113
--- nodelist.c	22 Aug 2005 09:07:09 -0000	1.112
+++ nodelist.c	20 Sep 2005 14:27:34 -0000	1.113
@@ -25,18 +25,18 @@
 {
 	struct jffs2_full_dirent **prev = list;
 	
-	JFFS2_DBG_DENTLIST("add dirent \"%s\", ino #%u\n", new->name, new->ino);
+	dbg_dentlist("add dirent \"%s\", ino #%u\n", new->name, new->ino);
 
 	while ((*prev) && (*prev)->nhash <= new->nhash) {
 		if ((*prev)->nhash == new->nhash && !strcmp((*prev)->name, new->name)) {
 			/* Duplicate. Free one */
 			if (new->version < (*prev)->version) {
-				JFFS2_DBG_DENTLIST("Eep! Marking new dirent node is obsolete, old is \"%s\", ino #%u\n",
+				dbg_dentlist("Eep! Marking new dirent node is obsolete, old is \"%s\", ino #%u\n",
 					(*prev)->name, (*prev)->ino);
 				jffs2_mark_node_obsolete(c, new->raw);
 				jffs2_free_full_dirent(new);
 			} else {
-				JFFS2_DBG_DENTLIST("marking old dirent \"%s\", ino #%u bsolete\n",
+				dbg_dentlist("marking old dirent \"%s\", ino #%u bsolete\n",
 					(*prev)->name, (*prev)->ino);
 				new->next = (*prev)->next;
 				jffs2_mark_node_obsolete(c, ((*prev)->raw));
@@ -55,7 +55,7 @@
 {
 	struct jffs2_node_frag *frag = jffs2_lookup_node_frag(list, size);
 
-	JFFS2_DBG_FRAGTREE("truncating fragtree to 0x%08x bytes\n", size);
+	dbg_fragtree("truncating fragtree to 0x%08x bytes\n", size);
 
 	/* We know frag->ofs <= size. That's what lookup does for us */
 	if (frag && frag->ofs != size) {
@@ -81,7 +81,7 @@
 	 */
 	frag = frag_last(list);
 	if (frag->node && (frag->ofs & (PAGE_CACHE_SIZE - 1)) == 0) {
-		JFFS2_DBG_FRAGTREE2("marking the last fragment 0x%08x-0x%08x REF_PRISTINE.\n",
+		dbg_fragtree2("marking the last fragment 0x%08x-0x%08x REF_PRISTINE.\n",
 			frag->ofs, frag->ofs + frag->size); 
 		frag->node->raw->flash_offset = ref_offset(frag->node->raw) | REF_PRISTINE;
 	}
@@ -93,12 +93,12 @@
 		this->node->frags--;
 		if (!this->node->frags) {
 			/* The node has no valid frags left. It's totally obsoleted */
-			JFFS2_DBG_FRAGTREE2("marking old node @0x%08x (0x%04x-0x%04x) obsolete\n",
+			dbg_fragtree2("marking old node @0x%08x (0x%04x-0x%04x) obsolete\n",
 				ref_offset(this->node->raw), this->node->ofs, this->node->ofs+this->node->size);
 			jffs2_mark_node_obsolete(c, this->node->raw);
 			jffs2_free_full_dnode(this->node);
 		} else {
-			JFFS2_DBG_FRAGTREE2("marking old node @0x%08x (0x%04x-0x%04x) REF_NORMAL. frags is %d\n",
+			dbg_fragtree2("marking old node @0x%08x (0x%04x-0x%04x) REF_NORMAL. frags is %d\n",
 				ref_offset(this->node->raw), this->node->ofs, this->node->ofs+this->node->size, this->node->frags);
 			mark_ref_normal(this->node->raw);
 		}
@@ -112,7 +112,7 @@
 	struct rb_node *parent = &base->rb;
 	struct rb_node **link = &parent;
 
-	JFFS2_DBG_FRAGTREE2("insert frag (0x%04x-0x%04x)\n", newfrag->ofs, newfrag->ofs + newfrag->size);
+	dbg_fragtree2("insert frag (0x%04x-0x%04x)\n", newfrag->ofs, newfrag->ofs + newfrag->size);
 
 	while (*link) {
 		parent = *link;
@@ -172,11 +172,11 @@
 			/* By definition, the 'this' node has no right-hand child, 
 			   because there are no frags with offset greater than it.
 			   So that's where we want to put the hole */
-			JFFS2_DBG_FRAGTREE2("add hole frag %#04x-%#04x on the right of the new frag.\n",
+			dbg_fragtree2("add hole frag %#04x-%#04x on the right of the new frag.\n",
 				holefrag->ofs, holefrag->ofs + holefrag->size);
 			rb_link_node(&holefrag->rb, &this->rb, &this->rb.rb_right);
 		} else {
-			JFFS2_DBG_FRAGTREE2("Add hole frag %#04x-%#04x to the root of the tree.\n",
+			dbg_fragtree2("Add hole frag %#04x-%#04x to the root of the tree.\n",
 				holefrag->ofs, holefrag->ofs + holefrag->size);
 			rb_link_node(&holefrag->rb, NULL, &root->rb_node);
 		}
@@ -188,10 +188,10 @@
 		/* By definition, the 'this' node has no right-hand child, 
 		   because there are no frags with offset greater than it.
 		   So that's where we want to put new fragment */
-		JFFS2_DBG_FRAGTREE2("add the new node at the right\n");
+		dbg_fragtree2("add the new node at the right\n");
 		rb_link_node(&newfrag->rb, &this->rb, &this->rb.rb_right);			
 	} else {
-		JFFS2_DBG_FRAGTREE2("insert the new node at the root of the tree\n");
+		dbg_fragtree2("insert the new node at the root of the tree\n");
 		rb_link_node(&newfrag->rb, NULL, &root->rb_node);
 	}
 	rb_insert_color(&newfrag->rb, root);
@@ -209,11 +209,11 @@
 	this = jffs2_lookup_node_frag(root, newfrag->node->ofs);
 
 	if (this) {
-		JFFS2_DBG_FRAGTREE2("lookup gave frag 0x%04x-0x%04x; phys 0x%08x (*%p)\n",
+		dbg_fragtree2("lookup gave frag 0x%04x-0x%04x; phys 0x%08x (*%p)\n",
 			  this->ofs, this->ofs+this->size, this->node?(ref_offset(this->node->raw)):0xffffffff, this);
 		lastend = this->ofs + this->size;
 	} else {
-		JFFS2_DBG_FRAGTREE2("lookup gave no frag\n");
+		dbg_fragtree2("lookup gave no frag\n");
 		lastend = 0;
 	}
 			  
@@ -235,11 +235,11 @@
 	}
 
 	if (this->node)
-		JFFS2_DBG_FRAGTREE2("dealing with frag %u-%u, phys %#08x(%d).\n",
+		dbg_fragtree2("dealing with frag %u-%u, phys %#08x(%d).\n",
 		this->ofs, this->ofs + this->size,
 		ref_offset(this->node->raw), ref_flags(this->node->raw));
 	else
-		JFFS2_DBG_FRAGTREE2("dealing with hole frag %u-%u.\n",
+		dbg_fragtree2("dealing with hole frag %u-%u.\n",
 		this->ofs, this->ofs + this->size);
 
 	/* OK. 'this' is pointing at the first frag that newfrag->ofs at least partially obsoletes,
@@ -259,10 +259,10 @@
 			struct jffs2_node_frag *newfrag2;
 
 			if (this->node)
-				JFFS2_DBG_FRAGTREE2("split old frag 0x%04x-0x%04x, phys 0x%08x\n",
+				dbg_fragtree2("split old frag 0x%04x-0x%04x, phys 0x%08x\n",
 					this->ofs, this->ofs+this->size, ref_offset(this->node->raw));
 			else 
-				JFFS2_DBG_FRAGTREE2("split old hole frag 0x%04x-0x%04x\n",
+				dbg_fragtree2("split old hole frag 0x%04x-0x%04x\n",
 					this->ofs, this->ofs+this->size);
 			
 			/* New second frag pointing to this's node */
@@ -299,13 +299,13 @@
 	} else {
 		/* New frag starts at the same point as 'this' used to. Replace 
 		   it in the tree without doing a delete and insertion */
-		JFFS2_DBG_FRAGTREE2("inserting newfrag (*%p),%d-%d in before 'this' (*%p),%d-%d\n",
+		dbg_fragtree2("inserting newfrag (*%p),%d-%d in before 'this' (*%p),%d-%d\n",
 			  newfrag, newfrag->ofs, newfrag->ofs+newfrag->size, this, this->ofs, this->ofs+this->size);
 	
 		rb_replace_node(&this->rb, &newfrag->rb, root);
 		
 		if (newfrag->ofs + newfrag->size >= this->ofs+this->size) {
-			JFFS2_DBG_FRAGTREE2("obsoleting node frag %p (%x-%x)\n", this, this->ofs, this->ofs+this->size);
+			dbg_fragtree2("obsoleting node frag %p (%x-%x)\n", this, this->ofs, this->ofs+this->size);
 			jffs2_obsolete_node_frag(c, this);
 		} else {
 			this->ofs += newfrag->size;
@@ -321,7 +321,7 @@
 	*/
 	while ((this = frag_next(newfrag)) && newfrag->ofs + newfrag->size >= this->ofs + this->size) {
 		/* 'this' frag is obsoleted completely. */
-		JFFS2_DBG_FRAGTREE2("obsoleting node frag %p (%x-%x) and removing from tree\n",
+		dbg_fragtree2("obsoleting node frag %p (%x-%x) and removing from tree\n",
 			this, this->ofs, this->ofs+this->size);
 		rb_erase(&this->rb, root);
 		jffs2_obsolete_node_frag(c, this);
@@ -361,7 +361,7 @@
 		return -ENOMEM;
 	newfrag->node->frags = 1;
 
-	JFFS2_DBG_FRAGTREE("adding node %#04x-%#04x @0x%08x on flash, newfrag *%p\n",
+	dbg_fragtree("adding node %#04x-%#04x @0x%08x on flash, newfrag *%p\n",
 		  fn->ofs, fn->ofs+fn->size, ref_offset(fn->raw), newfrag);
 	
 	ret = jffs2_add_frag_to_fragtree(c, &f->fragtree, newfrag);
@@ -412,12 +412,12 @@
 
 	/* Calculate how many bytes were already checked */
 	ofs = ref_offset(ref) + sizeof(struct jffs2_raw_inode);
-	len = ofs & (c->wbuf_pagesize - 1);
+	len = ofs % c->wbuf_pagesize;
 	if (likely(len))
 		len = c->wbuf_pagesize - len;
 
 	if (len >= tn->csize) {
-		JFFS2_DBG_READINODE("no need to check node at %#08x, data length %u, data starts at %#08x - it has already been checked.\n",
+		dbg_readinode("no need to check node at %#08x, data length %u, data starts at %#08x - it has already been checked.\n",
 			ref_offset(ref), tn->csize, ofs);
 		goto adj_acc;
 	}
@@ -425,7 +425,7 @@
 	ofs += len;
 	len = tn->csize - len;
 	
-	JFFS2_DBG_READINODE("check node at %#08x, data length %u, partial CRC %#08x, correct CRC %#08x, data starts at %#08x, start checking from %#08x - %u bytes.\n",
+	dbg_readinode("check node at %#08x, data length %u, partial CRC %#08x, correct CRC %#08x, data starts at %#08x, start checking from %#08x - %u bytes.\n",
 		ref_offset(ref), tn->csize, tn->partial_crc, tn->data_crc, ofs - len, ofs, len);
 	
 #ifndef __ECOS
@@ -520,7 +520,7 @@
 	if (ref_flags(tn->fn->raw) != REF_UNCHECKED)
 		return 0;
 	
-	JFFS2_DBG_FRAGTREE2("check node %#04x-%#04x, phys offs %#08x.\n",
+	dbg_fragtree2("check node %#04x-%#04x, phys offs %#08x.\n",
 		tn->fn->ofs, tn->fn->ofs + tn->fn->size, ref_offset(tn->fn->raw));
 
 	ret = check_node_data(c, tn);
@@ -528,7 +528,7 @@
 		JFFS2_ERROR("check_node_data() returned error: %d.\n",
 			ret);
 	} else if (unlikely(ret > 0)) {
-		JFFS2_DBG_FRAGTREE2("CRC error, mark it obsolete.\n");
+		dbg_fragtree2("CRC error, mark it obsolete.\n");
 		jffs2_mark_node_obsolete(c, tn->fn->raw);
 	}
 
@@ -544,7 +544,7 @@
 static int split_hole(struct jffs2_sb_info *c, struct rb_root *root,
 		      struct jffs2_node_frag *newfrag, struct jffs2_node_frag *hole)
 {
-	JFFS2_DBG_FRAGTREE2("fragment %#04x-%#04x splits the hole %#04x-%#04x\n",
+	dbg_fragtree2("fragment %#04x-%#04x splits the hole %#04x-%#04x\n",
 		newfrag->ofs, newfrag->ofs + newfrag->size, hole->ofs, hole->ofs + hole->size);
 
 	if (hole->ofs == newfrag->ofs) {
@@ -558,7 +558,7 @@
 			 * the new node.
 			 */
 			
-			JFFS2_DBG_FRAGTREE2("insert fragment %#04x-%#04x and cut the left part of the hole\n",
+			dbg_fragtree2("insert fragment %#04x-%#04x and cut the left part of the hole\n",
 				newfrag->ofs, newfrag->ofs + newfrag->size);
 			rb_replace_node(&hole->rb, &newfrag->rb, root);
 			
@@ -576,7 +576,7 @@
 			 * Ah, the new fragment is of the same size as the hole.
 			 * Relace the hole by it.
 			 */
-			JFFS2_DBG_FRAGTREE2("insert fragment %#04x-%#04x and overwrite hole\n",
+			dbg_fragtree2("insert fragment %#04x-%#04x and overwrite hole\n",
 				newfrag->ofs, newfrag->ofs + newfrag->size);
 			rb_replace_node(&hole->rb, &newfrag->rb, root);
 			jffs2_free_node_frag(hole);
@@ -598,14 +598,14 @@
 		}
 
 		hole->size = newfrag->ofs - hole->ofs;
-		JFFS2_DBG_FRAGTREE2("left the hole %#04x-%#04x at the left and inserd fragment %#04x-%#04x\n",
+		dbg_fragtree2("left the hole %#04x-%#04x at the left and inserd fragment %#04x-%#04x\n",
 			hole->ofs, hole->ofs + hole->size, newfrag->ofs, newfrag->ofs + newfrag->size);
 
 		jffs2_fragtree_insert(newfrag, hole);
 		rb_insert_color(&newfrag->rb, root);
 		
 		if (newfrag2) {
-			JFFS2_DBG_FRAGTREE2("left the hole %#04x-%#04x at the right\n",
+			dbg_fragtree2("left the hole %#04x-%#04x at the right\n",
 				newfrag2->ofs, newfrag2->ofs + newfrag2->size);
 			jffs2_fragtree_insert(newfrag2, newfrag);
 			rb_insert_color(&newfrag2->rb, root);
@@ -640,12 +640,12 @@
 	int err, checked = 0;
 	int ref_flag;
 
-	JFFS2_DBG_FRAGTREE("insert fragment %#04x-%#04x, ver %u\n", fn_ofs, fn_ofs + fn_size, tn->version);
+	dbg_fragtree("insert fragment %#04x-%#04x, ver %u\n", fn_ofs, fn_ofs + fn_size, tn->version);
 
 	/* Skip all the nodes which are completed before this one starts */
 	this = jffs2_lookup_node_frag(root, fn_ofs);
 	if (this)
-		JFFS2_DBG_FRAGTREE2("'this' found %#04x-%#04x (%s)\n", this->ofs, this->ofs + this->size, this->node ? "data" : "hole");
+		dbg_fragtree2("'this' found %#04x-%#04x (%s)\n", this->ofs, this->ofs + this->size, this->node ? "data" : "hole");
 
 	if (this)
 		lastend = this->ofs + this->size;
@@ -745,7 +745,7 @@
 				 * The new node starts at the same offset as
 				 * the hole and supersieds the hole.
 				 */
-				JFFS2_DBG_FRAGTREE2("add the new fragment instead of hole %#04x-%#04x, refcnt %d\n",
+				dbg_fragtree2("add the new fragment instead of hole %#04x-%#04x, refcnt %d\n",
 					fn_ofs, fn_ofs + this->ofs + this->size - fn_ofs, fn->frags);
 
 				rb_replace_node(&this->rb, &newfrag->rb, root);
@@ -755,10 +755,10 @@
 				 * The hole becomes shorter as its right part
 				 * is supersieded by the new fragment.
 				 */
-				JFFS2_DBG_FRAGTREE2("reduce size of hole %#04x-%#04x to %#04x-%#04x\n",
+				dbg_fragtree2("reduce size of hole %#04x-%#04x to %#04x-%#04x\n",
 					this->ofs, this->ofs + this->size, this->ofs, this->ofs + this->size - newfrag->size);
 				
-				JFFS2_DBG_FRAGTREE2("add new fragment %#04x-%#04x, refcnt %d\n", fn_ofs,
+				dbg_fragtree2("add new fragment %#04x-%#04x, refcnt %d\n", fn_ofs,
 					fn_ofs + this->ofs + this->size - fn_ofs, fn->frags);
 	
 				this->size -= newfrag->size;
@@ -771,7 +771,7 @@
 			this = rb_entry(rb_next(&newfrag->rb),
 					struct jffs2_node_frag, rb);
 
-			JFFS2_DBG_FRAGTREE2("switch to the next 'this' fragment: %#04x-%#04x %s\n",
+			dbg_fragtree2("switch to the next 'this' fragment: %#04x-%#04x %s\n",
 				this->ofs, this->ofs + this->size, this->node ? "(data)" : "(hole)");
 		}
 
@@ -782,7 +782,7 @@
 		if (this->ofs + this->size >= fn_ofs + fn_size) {
 			/* The new node is obsolete, drop it */
 			if (fn->frags == 0) {
-				JFFS2_DBG_FRAGTREE2("%#04x-%#04x is obsolete, mark it obsolete\n", fn_ofs, fn_ofs + fn_size);
+				dbg_fragtree2("%#04x-%#04x is obsolete, mark it obsolete\n", fn_ofs, fn_ofs + fn_size);
 				ref_flag = REF_OBSOLETE;
 			}
 			goto out_ok;
@@ -790,13 +790,13 @@
 			struct jffs2_node_frag *new_this;
 			
 			/* 'This' node obsoletes the beginning of the new node */
-			JFFS2_DBG_FRAGTREE2("the beginning %#04x-%#04x is obsolete\n", fn_ofs, this->ofs + this->size);
+			dbg_fragtree2("the beginning %#04x-%#04x is obsolete\n", fn_ofs, this->ofs + this->size);
 
 			ref_flag = REF_NORMAL;
 			
 			fn_size -= this->ofs + this->size - fn_ofs;
 			fn_ofs = this->ofs + this->size;
-			JFFS2_DBG_FRAGTREE2("now considering %#04x-%#04x\n", fn_ofs, fn_ofs + fn_size);
+			dbg_fragtree2("now considering %#04x-%#04x\n", fn_ofs, fn_ofs + fn_size);
 			
 			new_this = rb_entry(rb_next(&this->rb), struct jffs2_node_frag, rb);
 			if (!new_this) {
@@ -816,14 +816,14 @@
 				if (unlikely(!newfrag))
 					return -ENOMEM;
 
-				JFFS2_DBG_FRAGTREE2("there are no more fragments, insert %#04x-%#04x\n",
+				dbg_fragtree2("there are no more fragments, insert %#04x-%#04x\n",
 					newfrag->ofs, newfrag->ofs + newfrag->size);
 				rb_link_node(&newfrag->rb, &this->rb, &this->rb.rb_right);			
 				rb_insert_color(&newfrag->rb, root);
 				goto out_ok;
 			} else {
 				this = new_this;
-				JFFS2_DBG_FRAGTREE2("switch to the next 'this' fragment: %#04x-%#04x %s\n",
+				dbg_fragtree2("switch to the next 'this' fragment: %#04x-%#04x %s\n",
 					this->ofs, this->ofs + this->size, this->node ? "(data)" : "(hole)");
 			}
 		}
@@ -833,13 +833,13 @@
 	BUG_ON(fn->size < PAGE_CACHE_SIZE && ref_flag == REF_PRISTINE);
 
 	if (ref_flag == REF_OBSOLETE) {
-		JFFS2_DBG_FRAGTREE2("the node is obsolete now\n");
+		dbg_fragtree2("the node is obsolete now\n");
 		/* jffs2_mark_node_obsolete() will adjust space accounting */
 		jffs2_mark_node_obsolete(c, fn->raw);
 		return 1;
 	}
 
-	JFFS2_DBG_FRAGTREE2("the node is \"%s\" now\n", ref_flag == REF_NORMAL ? "REF_NORMAL" : "REF_PRISTINE");
+	dbg_fragtree2("the node is \"%s\" now\n", ref_flag == REF_NORMAL ? "REF_NORMAL" : "REF_PRISTINE");
 
 	/* Space accounting was adjusted at check_node_data() */
 	spin_lock(&c->erase_completion_lock);
@@ -885,7 +885,7 @@
 	if (!new->ino)
 		new->ino = ++c->highest_ino;
 
-	JFFS2_DBG_INOCACHE("add %p (ino #%u)\n", new, new->ino);
+	dbg_inocache("add %p (ino #%u)\n", new, new->ino);
 
 	prev = &c->inocache_list[new->ino % INOCACHE_HASHSIZE];
 
@@ -902,7 +902,7 @@
 {
 	struct jffs2_inode_cache **prev;
 
-	JFFS2_DBG_INOCACHE("del %p (ino #%u)\n", old, old->ino);
+	dbg_inocache("del %p (ino #%u)\n", old, old->ino);
 	spin_lock(&c->inocache_lock);
 	
 	prev = &c->inocache_list[old->ino % INOCACHE_HASHSIZE];
@@ -965,7 +965,7 @@
 	struct jffs2_node_frag *prev = NULL;
 	struct jffs2_node_frag *frag = NULL;
 
-	JFFS2_DBG_FRAGTREE2("root %p, offset %d\n", fragtree, offset);
+	dbg_fragtree2("root %p, offset %d\n", fragtree, offset);
 
 	next = fragtree->rb_node;
 
@@ -988,10 +988,10 @@
 	   and return the closest smaller one */
 
 	if (prev)
-		JFFS2_DBG_FRAGTREE2("no match. Returning frag %#04x-%#04x, closest previous\n",
+		dbg_fragtree2("no match. Returning frag %#04x-%#04x, closest previous\n",
 			  prev->ofs, prev->ofs+prev->size);
 	else 
-		JFFS2_DBG_FRAGTREE2("returning NULL, empty fragtree\n");
+		dbg_fragtree2("returning NULL, empty fragtree\n");
 	
 	return prev;
 }
@@ -1006,7 +1006,7 @@
 	if (!root->rb_node)
 		return;
 
-	JFFS2_DBG_FRAGTREE("killing\n");
+	dbg_fragtree("killing\n");
 	
 	frag = (rb_entry(root->rb_node, struct jffs2_node_frag, rb));
 	while(frag) {

Index: readinode.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/readinode.c,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -r1.141 -r1.142
--- readinode.c	17 Aug 2005 14:57:39 -0000	1.141
+++ readinode.c	20 Sep 2005 14:27:34 -0000	1.142
@@ -97,7 +97,7 @@
 	while (ref && ref->next_in_ino) {
 		if (!ref_obsolete(ref))
 			return ref;
-		JFFS2_DBG_NODEREF("node at 0x%08x is obsoleted. Ignoring.\n", ref_offset(ref));
+		dbg_noderef("node at 0x%08x is obsoleted. Ignoring.\n", ref_offset(ref));
 		ref = ref->next_in_ino;
 	}
 	return NULL;
@@ -274,7 +274,7 @@
 			len = min_t(uint32_t, rdlen - sizeof(*rd), csize);
 			tn->partial_crc = crc32(0, buf, len);
 
-			JFFS2_DBG_READINODE("Calculates CRC (%#08x) for %d bytes, csize %d\n", tn->partial_crc, len, csize);
+			dbg_readinode("Calculates CRC (%#08x) for %d bytes, csize %d\n", tn->partial_crc, len, csize);
 
 			/* If we actually calculated the whole data CRC
 			 * and it is wrong, drop the node. */
@@ -293,7 +293,7 @@
 			 */
 			struct jffs2_eraseblock *jeb;
 
-			JFFS2_DBG_READINODE("the node has no data.\n");
+			dbg_readinode("the node has no data.\n");
 			jeb = &c->blocks[ref->flash_offset / c->sector_size];
 			len = ref_totlen(c, jeb, ref);
 
@@ -327,7 +327,7 @@
 	else // normal case...
 		tn->fn->size = je32_to_cpu(rd->dsize);
 
-	JFFS2_DBG_READINODE("dnode @%08x: ver %u, offset %#04x, dsize %#04x, csize %#04x\n",
+	dbg_readinode("dnode @%08x: ver %u, offset %#04x, dsize %#04x, csize %#04x\n",
 		  ref_offset(ref), je32_to_cpu(rd->version), je32_to_cpu(rd->offset), je32_to_cpu(rd->dsize), csize);
 	
 	jffs2_add_tn_to_tree(tn, tnp);
@@ -424,7 +424,7 @@
 		len = right_size - *rdlen;
 	}
 	
-	JFFS2_DBG_READINODE("read more %d bytes\n", len);
+	dbg_readinode("read more %d bytes\n", len);
 
 	err = jffs2_flash_read(c, offs, len, &retlen, bufstart);
 	if (err) {
@@ -461,7 +461,7 @@
 
 	*mctime_ver = 0;
 	
-	JFFS2_DBG_READINODE("ino #%u\n", f->inocache->ino);
+	dbg_readinode("ino #%u\n", f->inocache->ino);
 
 	if (jffs2_is_writebuffered(c)) {
 		/*
@@ -531,7 +531,7 @@
 			len = JFFS2_MIN_NODE_HEADER;
 		}
 
-		JFFS2_DBG_READINODE("read %d bytes at %#08x(%d).\n", len, ref_offset(ref), ref_flags(ref));
+		dbg_readinode("read %d bytes at %#08x(%d).\n", len, ref_offset(ref), ref_flags(ref));
 
 		/* FIXME: point() */
 		err = jffs2_flash_read(c, ref_offset(ref), len,
@@ -614,7 +614,7 @@
 	*fdp = ret_fd;
 	kfree(buf);
 
-	JFFS2_DBG_READINODE("nodes of inode #%u were read, the highest version is %u, latest_mctime %u, mctime_ver %u.\n",
+	dbg_readinode("nodes of inode #%u were read, the highest version is %u, latest_mctime %u, mctime_ver %u.\n",
 			f->inocache->ino, *highest_version, *latest_mctime, *mctime_ver);
 	return 0;
 
@@ -639,7 +639,7 @@
 	size_t retlen;
 	int ret;
 
-	JFFS2_DBG_READINODE("ino #%u nlink is %d\n", f->inocache->ino, f->inocache->nlink);
+	dbg_readinode("ino #%u nlink is %d\n", f->inocache->ino, f->inocache->nlink);
 
 	/* Grab all nodes relevant to this ino */
 	ret = jffs2_get_inode_nodes(c, f, &tn_list, &fd_list, &f->highest_version, &latest_mctime, &mctime_ver);
@@ -659,7 +659,7 @@
 		tn = rb_entry(rb, struct jffs2_tmp_dnode_info, rb);
 		fn = tn->fn;
 		ret = 1;
-		JFFS2_DBG_READINODE("consider node ver %u, phys offset "
+		dbg_readinode("consider node ver %u, phys offset "
 			"%#08x(%d), range %u-%u.\n", tn->version,
 			ref_offset(fn->raw), ref_flags(fn->raw),
 			fn->ofs, fn->ofs + fn->size);
@@ -703,7 +703,7 @@
 
 		jffs2_free_tmp_dnode_info(tn);
 		if (ret) {
-			JFFS2_DBG_READINODE("delete dnode %u-%u.\n",
+			dbg_readinode("delete dnode %u-%u.\n",
 				fn->ofs, fn->ofs + fn->size);
 			jffs2_free_full_dnode(fn);
 		}
@@ -803,7 +803,7 @@
 			}
 
 			f->target[je32_to_cpu(latest_node->csize)] = '\0';
-			JFFS2_DBG_READINODE("symlink's target '%s' cached\n", f->target);
+			dbg_readinode("symlink's target '%s' cached\n", f->target);
 		}
 		
 		/* fall through... */
@@ -851,7 +851,7 @@
 int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, 
 			uint32_t ino, struct jffs2_raw_inode *latest_node)
 {
-	JFFS2_DBG_READINODE("read inode #%u\n", ino);
+	dbg_readinode("read inode #%u\n", ino);
 
  retry_inocache:
 	spin_lock(&c->inocache_lock);
@@ -870,7 +870,7 @@
 			/* If it's in either of these states, we need
 			   to wait for whoever's got it to finish and
 			   put it back. */
-			JFFS2_DBG_READINODE("waiting for ino #%u in state %d\n", ino, f->inocache->state);
+			dbg_readinode("waiting for ino #%u in state %d\n", ino, f->inocache->state);
 			sleep_on_spinunlock(&c->inocache_wq, &c->inocache_lock);
 			goto retry_inocache;
 
@@ -897,7 +897,7 @@
 			JFFS2_ERROR("cannot allocate inocache for root inode\n");
 			return -ENOMEM;
 		}
-		JFFS2_DBG_READINODE("creating inocache for root inode\n");
+		dbg_readinode("creating inocache for root inode\n");
 		memset(f->inocache, 0, sizeof(struct jffs2_inode_cache));
 		f->inocache->ino = f->inocache->nlink = 1;
 		f->inocache->nodes = (struct jffs2_raw_node_ref *)f->inocache;

Index: scan.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/scan.c,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -r1.122 -r1.123
--- scan.c	7 Sep 2005 08:34:54 -0000	1.122
+++ scan.c	20 Sep 2005 14:27:34 -0000	1.123
@@ -429,7 +429,7 @@
 
 	noise = 10;
 
-	JFFS2_DBG_SUMMARY("no summary found in jeb 0x%08x. Apply original scan.\n",jeb->offset);
+	dbg_summary("no summary found in jeb 0x%08x. Apply original scan.\n",jeb->offset);
 
 scan_more:	
 	while(ofs < jeb->offset + c->sector_size) {
@@ -684,7 +684,7 @@
 
 	if (jffs2_sum_active()) {
 		if (PAD(s->sum_size + JFFS2_SUMMARY_FRAME_SIZE) > jeb->free_size) {
-			JFFS2_DBG_SUMMARY("There is not enough space for "
+			dbg_summary("There is not enough space for "
 				"summary information, disabling for this jeb!\n");
 			jffs2_sum_disable_collecting(s);
 		}

Index: summary.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/summary.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- summary.c	7 Sep 2005 08:34:54 -0000	1.1
+++ summary.c	20 Sep 2005 14:27:34 -0000	1.2
@@ -41,14 +41,14 @@
 		return -ENOMEM;
 	}
 
-	JFFS2_DBG_SUMMARY("returned succesfully\n");
+	dbg_summary("returned succesfully\n");
 
 	return 0;
 }
 
 void jffs2_sum_exit(struct jffs2_sb_info *c)
 {
-	JFFS2_DBG_SUMMARY("called\n");
+	dbg_summary("called\n");
 
 	jffs2_sum_disable_collecting(c->summary);
 
@@ -71,13 +71,13 @@
 		case JFFS2_NODETYPE_INODE:
 			s->sum_size += JFFS2_SUMMARY_INODE_SIZE;
 			s->sum_num++;
-			JFFS2_DBG_SUMMARY("inode (%u) added to summary\n",
+			dbg_summary("inode (%u) added to summary\n",
 						je32_to_cpu(item->i.inode));
 			break;
 		case JFFS2_NODETYPE_DIRENT:
 			s->sum_size += JFFS2_SUMMARY_DIRENT_SIZE(item->d.nsize);
 			s->sum_num++;
-			JFFS2_DBG_SUMMARY("dirent (%u) added to summary\n",
+			dbg_summary("dirent (%u) added to summary\n",
 						je32_to_cpu(item->d.ino));
 			break;
 		default:
@@ -93,7 +93,7 @@
 
 int jffs2_sum_add_padding_mem(struct jffs2_summary *s, uint32_t size)
 {
-	JFFS2_DBG_SUMMARY("called with %u\n", size);
+	dbg_summary("called with %u\n", size);
 	s->sum_padded += size;
 	return 0;
 }
@@ -147,7 +147,7 @@
 	union jffs2_sum_mem *temp;
 
 	if (!s->sum_list_head) {
-		JFFS2_DBG_SUMMARY("already empty\n");
+		dbg_summary("already empty\n");
 	}
 	while (s->sum_list_head) {
 		temp = s->sum_list_head;
@@ -161,14 +161,14 @@
 
 void jffs2_sum_reset_collected(struct jffs2_summary *s)
 {
-	JFFS2_DBG_SUMMARY("called\n");
+	dbg_summary("called\n");
 	jffs2_sum_clean_collected(s);
 	s->sum_size = 0;
 }
 
 void jffs2_sum_disable_collecting(struct jffs2_summary *s)
 {
-	JFFS2_DBG_SUMMARY("called\n");
+	dbg_summary("called\n");
 	jffs2_sum_clean_collected(s);
 	s->sum_size = JFFS2_SUMMARY_NOSUM_SIZE;
 }
@@ -182,7 +182,7 @@
 
 void jffs2_sum_move_collected(struct jffs2_sb_info *c, struct jffs2_summary *s)
 {
-	JFFS2_DBG_SUMMARY("oldsize=0x%x oldnum=%u => newsize=0x%x newnum=%u\n",
+	dbg_summary("oldsize=0x%x oldnum=%u => newsize=0x%x newnum=%u\n",
 				c->summary->sum_size, c->summary->sum_num,
 				s->sum_size, s->sum_num);
 
@@ -260,16 +260,16 @@
 		}
 
 		case JFFS2_NODETYPE_PADDING:
-			JFFS2_DBG_SUMMARY("node PADDING\n");
+			dbg_summary("node PADDING\n");
 			c->summary->sum_padded += je32_to_cpu(node->u.totlen);
 			break;
 
 		case JFFS2_NODETYPE_CLEANMARKER:
-			JFFS2_DBG_SUMMARY("node CLEANMARKER\n");
+			dbg_summary("node CLEANMARKER\n");
 			break;
 
 		case JFFS2_NODETYPE_SUMMARY:
-			JFFS2_DBG_SUMMARY("node SUMMARY\n");
+			dbg_summary("node SUMMARY\n");
 			break;
 
 		default:
@@ -302,7 +302,7 @@
 	sp = summary->sum;
 
 	for (i=0; i<je32_to_cpu(summary->sum_num); i++) {
-		JFFS2_DBG_SUMMARY("processing summary index %d\n", i);
+		dbg_summary("processing summary index %d\n", i);
 
 		switch (je16_to_cpu(((struct jffs2_sum_unknown_flash *)sp)->nodetype)) {
 			case JFFS2_NODETYPE_INODE: {
@@ -311,7 +311,7 @@
 
 				ino = je32_to_cpu(spi->inode);
 
-				JFFS2_DBG_SUMMARY("Inode at 0x%08x\n",
+				dbg_summary("Inode at 0x%08x\n",
 							jeb->offset + je32_to_cpu(spi->offset));
 
 				raw = jffs2_alloc_raw_node_ref();
@@ -353,7 +353,7 @@
 				struct jffs2_sum_dirent_flash *spd;
 				spd = sp;
 
-				JFFS2_DBG_SUMMARY("Dirent at 0x%08x\n",
+				dbg_summary("Dirent at 0x%08x\n",
 							jeb->offset + je32_to_cpu(spd->offset));
 
 				fd = jffs2_alloc_full_dirent(spd->nsize+1);
@@ -434,7 +434,7 @@
 	sumsize = c->sector_size - ofs;
 	ofs += jeb->offset;
 
-	JFFS2_DBG_SUMMARY("summary found for 0x%08x at 0x%08x (0x%x bytes)\n",
+	dbg_summary("summary found for 0x%08x at 0x%08x (0x%x bytes)\n",
 				jeb->offset, ofs, sumsize);
 
 	summary = kmalloc(sumsize, GFP_KERNEL);
@@ -457,40 +457,40 @@
 	crc = crc32(0, &crcnode, sizeof(crcnode)-4);
 
 	if (je32_to_cpu(summary->hdr_crc) != crc) {
-		JFFS2_DBG_SUMMARY("Summary node header is corrupt (bad CRC or "
+		dbg_summary("Summary node header is corrupt (bad CRC or "
 				"no summary at all)\n");
 		goto crc_err;
 	}
 
 	if (je32_to_cpu(summary->totlen) != sumsize) {
-		JFFS2_DBG_SUMMARY("Summary node is corrupt (wrong erasesize?)\n");
+		dbg_summary("Summary node is corrupt (wrong erasesize?)\n");
 		goto crc_err;
 	}
 
 	crc = crc32(0, summary, sizeof(struct jffs2_summary_node)-8);
 
 	if (je32_to_cpu(summary->node_crc) != crc) {
-		JFFS2_DBG_SUMMARY("Summary node is corrupt (bad CRC)\n");
+		dbg_summary("Summary node is corrupt (bad CRC)\n");
 		goto crc_err;
 	}
 
 	crc = crc32(0, summary->sum, sumsize - sizeof(struct jffs2_summary_node));
 
 	if (je32_to_cpu(summary->sum_crc) != crc) {
-		JFFS2_DBG_SUMMARY("Summary node data is corrupt (bad CRC)\n");
+		dbg_summary("Summary node data is corrupt (bad CRC)\n");
 		goto crc_err;
 	}
 
 	if ( je32_to_cpu(summary->cln_mkr) ) {
 
-		JFFS2_DBG_SUMMARY("Summary : CLEANMARKER node \n");
+		dbg_summary("Summary : CLEANMARKER node \n");
 
 		if (je32_to_cpu(summary->cln_mkr) != c->cleanmarker_size) {
-			JFFS2_DBG_SUMMARY("CLEANMARKER node has totlen 0x%x != normal 0x%x\n",
+			dbg_summary("CLEANMARKER node has totlen 0x%x != normal 0x%x\n",
 				je32_to_cpu(summary->cln_mkr), c->cleanmarker_size);
 			UNCHECKED_SPACE(PAD(je32_to_cpu(summary->cln_mkr)));
 		} else if (jeb->first_node) {
-			JFFS2_DBG_SUMMARY("CLEANMARKER node not first node in block "
+			dbg_summary("CLEANMARKER node not first node in block "
 					"(0x%08x)\n", jeb->offset);
 			UNCHECKED_SPACE(PAD(je32_to_cpu(summary->cln_mkr)));
 		} else {
@@ -644,7 +644,7 @@
 	vecs[1].iov_base = c->summary->sum_buf;
 	vecs[1].iov_len = datasize;
 
-	JFFS2_DBG_SUMMARY("JFFS2: writing out data to flash to pos : 0x%08x\n",
+	dbg_summary("JFFS2: writing out data to flash to pos : 0x%08x\n",
 			jeb->offset + c->sector_size - jeb->free_size);
 
 	spin_unlock(&c->erase_completion_lock);
@@ -674,7 +674,7 @@
 	int datasize, infosize, padsize, ret;
 	struct jffs2_eraseblock *jeb;
 
-	JFFS2_DBG_SUMMARY("called\n");
+	dbg_summary("called\n");
 
 	jeb = c->nextblock;
 





More information about the linux-mtd-cvs mailing list