Commit 737b7661 authored by Andrew Lunn's avatar Andrew Lunn Committed by Thomas Gleixner

[JFFS2] Fix up new debug code for eCos build

The debug code cleanup broke the eCos build.
Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent e0d60137
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* For licensing information, see the file 'LICENCE' in this directory. * For licensing information, see the file 'LICENCE' in this directory.
* *
* $Id: build.c,v 1.75 2005/07/22 10:32:07 dedekind Exp $ * $Id: build.c,v 1.76 2005/07/30 15:29:27 lunn Exp $
* *
*/ */
...@@ -317,9 +317,11 @@ int jffs2_do_mount_fs(struct jffs2_sb_info *c) ...@@ -317,9 +317,11 @@ int jffs2_do_mount_fs(struct jffs2_sb_info *c)
c->free_size = c->flash_size; c->free_size = c->flash_size;
c->nr_blocks = c->flash_size / c->sector_size; c->nr_blocks = c->flash_size / c->sector_size;
#ifndef __ECOS
if (c->mtd->flags & MTD_NO_VIRTBLOCKS) if (c->mtd->flags & MTD_NO_VIRTBLOCKS)
c->blocks = vmalloc(sizeof(struct jffs2_eraseblock) * c->nr_blocks); c->blocks = vmalloc(sizeof(struct jffs2_eraseblock) * c->nr_blocks);
else else
#endif
c->blocks = kmalloc(sizeof(struct jffs2_eraseblock) * c->nr_blocks, GFP_KERNEL); c->blocks = kmalloc(sizeof(struct jffs2_eraseblock) * c->nr_blocks, GFP_KERNEL);
if (!c->blocks) if (!c->blocks)
return -ENOMEM; return -ENOMEM;
...@@ -353,11 +355,13 @@ int jffs2_do_mount_fs(struct jffs2_sb_info *c) ...@@ -353,11 +355,13 @@ int jffs2_do_mount_fs(struct jffs2_sb_info *c)
D1(printk(KERN_DEBUG "build_fs failed\n")); D1(printk(KERN_DEBUG "build_fs failed\n"));
jffs2_free_ino_caches(c); jffs2_free_ino_caches(c);
jffs2_free_raw_node_refs(c); jffs2_free_raw_node_refs(c);
if (c->mtd->flags & MTD_NO_VIRTBLOCKS) { #ifndef __ECOS
vfree(c->blocks); if (c->mtd->flags & MTD_NO_VIRTBLOCKS)
} else { vfree(c->blocks);
kfree(c->blocks); else
} #endif
kfree(c->blocks);
return -EIO; return -EIO;
} }
......
...@@ -7,10 +7,11 @@ ...@@ -7,10 +7,11 @@
* *
* For licensing information, see the file 'LICENCE' in this directory. * For licensing information, see the file 'LICENCE' in this directory.
* *
* $Id: debug.c,v 1.7 2005/07/24 15:14:14 dedekind Exp $ * $Id: debug.c,v 1.8 2005/07/30 15:27:05 lunn Exp $
* *
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/types.h>
#include <linux/pagemap.h> #include <linux/pagemap.h>
#include <linux/crc32.h> #include <linux/crc32.h>
#include <linux/jffs2.h> #include <linux/jffs2.h>
......
...@@ -7,11 +7,12 @@ ...@@ -7,11 +7,12 @@
* *
* For licensing information, see the file 'LICENCE' in this directory. * For licensing information, see the file 'LICENCE' in this directory.
* *
* $Id: readinode.c,v 1.132 2005/07/28 14:46:40 dedekind Exp $ * $Id: readinode.c,v 1.133 2005/07/30 15:28:24 lunn Exp $
* *
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/crc32.h> #include <linux/crc32.h>
...@@ -249,7 +250,7 @@ read_dnode(struct jffs2_sb_info *c, ...@@ -249,7 +250,7 @@ read_dnode(struct jffs2_sb_info *c,
if (unlikely(je32_to_cpu(rd->offset) > je32_to_cpu(rd->isize)) || if (unlikely(je32_to_cpu(rd->offset) > je32_to_cpu(rd->isize)) ||
unlikely(PAD(je32_to_cpu(rd->csize) + sizeof(*rd)) != PAD(je32_to_cpu(rd->totlen)))) { unlikely(PAD(je32_to_cpu(rd->csize) + sizeof(*rd)) != PAD(je32_to_cpu(rd->totlen)))) {
JFFS2_WARNING("inode node header CRC is corrupted at %#08x\n", ref_offset(ref)); JFFS2_WARNING("inode node header CRC is corrupted at %#08x\n", ref_offset(ref));
__jffs2_dbg_dump_node(c, ref_offset(ref)); jffs2_dbg_dump_node(c, ref_offset(ref));
return 1; return 1;
} }
...@@ -384,7 +385,7 @@ read_unknown(struct jffs2_sb_info *c, ...@@ -384,7 +385,7 @@ read_unknown(struct jffs2_sb_info *c,
if (crc32(0, un, sizeof(struct jffs2_unknown_node) - 4) != je32_to_cpu(un->hdr_crc)) { if (crc32(0, un, sizeof(struct jffs2_unknown_node) - 4) != je32_to_cpu(un->hdr_crc)) {
/* Hmmm. This should have been caught at scan time. */ /* Hmmm. This should have been caught at scan time. */
JFFS2_NOTICE("node header CRC failed at %#08x. But it must have been OK earlier.\n", ref_offset(ref)); JFFS2_NOTICE("node header CRC failed at %#08x. But it must have been OK earlier.\n", ref_offset(ref));
__jffs2_dbg_dump_node(c, ref_offset(ref)); jffs2_dbg_dump_node(c, ref_offset(ref));
return 1; return 1;
} else { } else {
switch(je16_to_cpu(un->nodetype) & JFFS2_COMPAT_MASK) { switch(je16_to_cpu(un->nodetype) & JFFS2_COMPAT_MASK) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment