aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jffs2/debug.c')
-rw-r--r--fs/jffs2/debug.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/fs/jffs2/debug.c b/fs/jffs2/debug.c
index 0947284f45dd..1fe17de713e8 100644
--- a/fs/jffs2/debug.c
+++ b/fs/jffs2/debug.c
@@ -7,7 +7,7 @@
7 * 7 *
8 * For licensing information, see the file 'LICENCE' in this directory. 8 * For licensing information, see the file 'LICENCE' in this directory.
9 * 9 *
10 * $Id: debug.c,v 1.11 2005/09/21 13:28:35 dedekind Exp $ 10 * $Id: debug.c,v 1.12 2005/11/07 11:14:39 gleixner Exp $
11 * 11 *
12 */ 12 */
13#include <linux/kernel.h> 13#include <linux/kernel.h>
@@ -67,7 +67,7 @@ __jffs2_dbg_fragtree_paranoia_check(struct jffs2_inode_info *f)
67 __jffs2_dbg_fragtree_paranoia_check_nolock(f); 67 __jffs2_dbg_fragtree_paranoia_check_nolock(f);
68 up(&f->sem); 68 up(&f->sem);
69} 69}
70 70
71void 71void
72__jffs2_dbg_fragtree_paranoia_check_nolock(struct jffs2_inode_info *f) 72__jffs2_dbg_fragtree_paranoia_check_nolock(struct jffs2_inode_info *f)
73{ 73{
@@ -165,7 +165,7 @@ __jffs2_dbg_acct_paranoia_check(struct jffs2_sb_info *c,
165 __jffs2_dbg_acct_paranoia_check_nolock(c, jeb); 165 __jffs2_dbg_acct_paranoia_check_nolock(c, jeb);
166 spin_unlock(&c->erase_completion_lock); 166 spin_unlock(&c->erase_completion_lock);
167} 167}
168 168
169void 169void
170__jffs2_dbg_acct_paranoia_check_nolock(struct jffs2_sb_info *c, 170__jffs2_dbg_acct_paranoia_check_nolock(struct jffs2_sb_info *c,
171 struct jffs2_eraseblock *jeb) 171 struct jffs2_eraseblock *jeb)
@@ -237,7 +237,7 @@ error:
237 __jffs2_dbg_dump_jeb_nolock(jeb); 237 __jffs2_dbg_dump_jeb_nolock(jeb);
238 __jffs2_dbg_dump_block_lists_nolock(c); 238 __jffs2_dbg_dump_block_lists_nolock(c);
239 BUG(); 239 BUG();
240 240
241} 241}
242#endif /* JFFS2_DBG_PARANOIA_CHECKS */ 242#endif /* JFFS2_DBG_PARANOIA_CHECKS */
243 243
@@ -321,7 +321,7 @@ void
321__jffs2_dbg_dump_block_lists_nolock(struct jffs2_sb_info *c) 321__jffs2_dbg_dump_block_lists_nolock(struct jffs2_sb_info *c)
322{ 322{
323 printk(JFFS2_DBG_MSG_PREFIX " dump JFFS2 blocks lists:\n"); 323 printk(JFFS2_DBG_MSG_PREFIX " dump JFFS2 blocks lists:\n");
324 324
325 printk(JFFS2_DBG "flash_size: %#08x\n", c->flash_size); 325 printk(JFFS2_DBG "flash_size: %#08x\n", c->flash_size);
326 printk(JFFS2_DBG "used_size: %#08x\n", c->used_size); 326 printk(JFFS2_DBG "used_size: %#08x\n", c->used_size);
327 printk(JFFS2_DBG "dirty_size: %#08x\n", c->dirty_size); 327 printk(JFFS2_DBG "dirty_size: %#08x\n", c->dirty_size);
@@ -577,15 +577,15 @@ __jffs2_dbg_dump_buffer(unsigned char *buf, int len, uint32_t offs)
577{ 577{
578 int skip; 578 int skip;
579 int i; 579 int i;
580 580
581 printk(JFFS2_DBG_MSG_PREFIX " dump from offset %#08x to offset %#08x (%x bytes).\n", 581 printk(JFFS2_DBG_MSG_PREFIX " dump from offset %#08x to offset %#08x (%x bytes).\n",
582 offs, offs + len, len); 582 offs, offs + len, len);
583 i = skip = offs % JFFS2_BUFDUMP_BYTES_PER_LINE; 583 i = skip = offs % JFFS2_BUFDUMP_BYTES_PER_LINE;
584 offs = offs & ~(JFFS2_BUFDUMP_BYTES_PER_LINE - 1); 584 offs = offs & ~(JFFS2_BUFDUMP_BYTES_PER_LINE - 1);
585 585
586 if (skip != 0) 586 if (skip != 0)
587 printk(JFFS2_DBG "%#08x: ", offs); 587 printk(JFFS2_DBG "%#08x: ", offs);
588 588
589 while (skip--) 589 while (skip--)
590 printk(" "); 590 printk(" ");
591 591
@@ -598,7 +598,7 @@ __jffs2_dbg_dump_buffer(unsigned char *buf, int len, uint32_t offs)
598 } 598 }
599 599
600 printk("%02x ", buf[i]); 600 printk("%02x ", buf[i]);
601 601
602 i += 1; 602 i += 1;
603 } 603 }
604 604
@@ -616,7 +616,7 @@ __jffs2_dbg_dump_node(struct jffs2_sb_info *c, uint32_t ofs)
616 size_t retlen; 616 size_t retlen;
617 uint32_t crc; 617 uint32_t crc;
618 int ret; 618 int ret;
619 619
620 printk(JFFS2_DBG_MSG_PREFIX " dump node at offset %#08x.\n", ofs); 620 printk(JFFS2_DBG_MSG_PREFIX " dump node at offset %#08x.\n", ofs);
621 621
622 ret = jffs2_flash_read(c, ofs, len, &retlen, (unsigned char *)&node); 622 ret = jffs2_flash_read(c, ofs, len, &retlen, (unsigned char *)&node);
@@ -630,13 +630,13 @@ __jffs2_dbg_dump_node(struct jffs2_sb_info *c, uint32_t ofs)
630 printk(JFFS2_DBG "nodetype:\t%#04x\n", je16_to_cpu(node.u.nodetype)); 630 printk(JFFS2_DBG "nodetype:\t%#04x\n", je16_to_cpu(node.u.nodetype));
631 printk(JFFS2_DBG "totlen:\t%#08x\n", je32_to_cpu(node.u.totlen)); 631 printk(JFFS2_DBG "totlen:\t%#08x\n", je32_to_cpu(node.u.totlen));
632 printk(JFFS2_DBG "hdr_crc:\t%#08x\n", je32_to_cpu(node.u.hdr_crc)); 632 printk(JFFS2_DBG "hdr_crc:\t%#08x\n", je32_to_cpu(node.u.hdr_crc));
633 633
634 crc = crc32(0, &node.u, sizeof(node.u) - 4); 634 crc = crc32(0, &node.u, sizeof(node.u) - 4);
635 if (crc != je32_to_cpu(node.u.hdr_crc)) { 635 if (crc != je32_to_cpu(node.u.hdr_crc)) {
636 JFFS2_ERROR("wrong common header CRC.\n"); 636 JFFS2_ERROR("wrong common header CRC.\n");
637 return; 637 return;
638 } 638 }
639 639
640 if (je16_to_cpu(node.u.magic) != JFFS2_MAGIC_BITMASK && 640 if (je16_to_cpu(node.u.magic) != JFFS2_MAGIC_BITMASK &&
641 je16_to_cpu(node.u.magic) != JFFS2_OLD_MAGIC_BITMASK) 641 je16_to_cpu(node.u.magic) != JFFS2_OLD_MAGIC_BITMASK)
642 { 642 {
@@ -668,7 +668,7 @@ __jffs2_dbg_dump_node(struct jffs2_sb_info *c, uint32_t ofs)
668 printk(JFFS2_DBG "data_crc:\t%#08x\n", je32_to_cpu(node.i.data_crc)); 668 printk(JFFS2_DBG "data_crc:\t%#08x\n", je32_to_cpu(node.i.data_crc));
669 printk(JFFS2_DBG "node_crc:\t%#08x\n", je32_to_cpu(node.i.node_crc)); 669 printk(JFFS2_DBG "node_crc:\t%#08x\n", je32_to_cpu(node.i.node_crc));
670 670
671 crc = crc32(0, &node.i, sizeof(node.i) - 8); 671 crc = crc32(0, &node.i, sizeof(node.i) - 8);
672 if (crc != je32_to_cpu(node.i.node_crc)) { 672 if (crc != je32_to_cpu(node.i.node_crc)) {
673 JFFS2_ERROR("wrong node header CRC.\n"); 673 JFFS2_ERROR("wrong node header CRC.\n");
674 return; 674 return;
@@ -686,11 +686,11 @@ __jffs2_dbg_dump_node(struct jffs2_sb_info *c, uint32_t ofs)
686 printk(JFFS2_DBG "type:\t%#02x\n", node.d.type); 686 printk(JFFS2_DBG "type:\t%#02x\n", node.d.type);
687 printk(JFFS2_DBG "node_crc:\t%#08x\n", je32_to_cpu(node.d.node_crc)); 687 printk(JFFS2_DBG "node_crc:\t%#08x\n", je32_to_cpu(node.d.node_crc));
688 printk(JFFS2_DBG "name_crc:\t%#08x\n", je32_to_cpu(node.d.name_crc)); 688 printk(JFFS2_DBG "name_crc:\t%#08x\n", je32_to_cpu(node.d.name_crc));
689 689
690 node.d.name[node.d.nsize] = '\0'; 690 node.d.name[node.d.nsize] = '\0';
691 printk(JFFS2_DBG "name:\t\"%s\"\n", node.d.name); 691 printk(JFFS2_DBG "name:\t\"%s\"\n", node.d.name);
692 692
693 crc = crc32(0, &node.d, sizeof(node.d) - 8); 693 crc = crc32(0, &node.d, sizeof(node.d) - 8);
694 if (crc != je32_to_cpu(node.d.node_crc)) { 694 if (crc != je32_to_cpu(node.d.node_crc)) {
695 JFFS2_ERROR("wrong node header CRC.\n"); 695 JFFS2_ERROR("wrong node header CRC.\n");
696 return; 696 return;