aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jffs2')
-rw-r--r--fs/jffs2/build.c16
-rw-r--r--fs/jffs2/debug.c3
-rw-r--r--fs/jffs2/readinode.c7
3 files changed, 16 insertions, 10 deletions
diff --git a/fs/jffs2/build.c b/fs/jffs2/build.c
index f08984a64a5a..8e2f1f4e8aa3 100644
--- a/fs/jffs2/build.c
+++ b/fs/jffs2/build.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: build.c,v 1.75 2005/07/22 10:32:07 dedekind Exp $ 10 * $Id: build.c,v 1.76 2005/07/30 15:29:27 lunn Exp $
11 * 11 *
12 */ 12 */
13 13
@@ -317,9 +317,11 @@ int jffs2_do_mount_fs(struct jffs2_sb_info *c)
317 317
318 c->free_size = c->flash_size; 318 c->free_size = c->flash_size;
319 c->nr_blocks = c->flash_size / c->sector_size; 319 c->nr_blocks = c->flash_size / c->sector_size;
320#ifndef __ECOS
320 if (c->mtd->flags & MTD_NO_VIRTBLOCKS) 321 if (c->mtd->flags & MTD_NO_VIRTBLOCKS)
321 c->blocks = vmalloc(sizeof(struct jffs2_eraseblock) * c->nr_blocks); 322 c->blocks = vmalloc(sizeof(struct jffs2_eraseblock) * c->nr_blocks);
322 else 323 else
324#endif
323 c->blocks = kmalloc(sizeof(struct jffs2_eraseblock) * c->nr_blocks, GFP_KERNEL); 325 c->blocks = kmalloc(sizeof(struct jffs2_eraseblock) * c->nr_blocks, GFP_KERNEL);
324 if (!c->blocks) 326 if (!c->blocks)
325 return -ENOMEM; 327 return -ENOMEM;
@@ -353,11 +355,13 @@ int jffs2_do_mount_fs(struct jffs2_sb_info *c)
353 D1(printk(KERN_DEBUG "build_fs failed\n")); 355 D1(printk(KERN_DEBUG "build_fs failed\n"));
354 jffs2_free_ino_caches(c); 356 jffs2_free_ino_caches(c);
355 jffs2_free_raw_node_refs(c); 357 jffs2_free_raw_node_refs(c);
356 if (c->mtd->flags & MTD_NO_VIRTBLOCKS) { 358#ifndef __ECOS
357 vfree(c->blocks); 359 if (c->mtd->flags & MTD_NO_VIRTBLOCKS)
358 } else { 360 vfree(c->blocks);
359 kfree(c->blocks); 361 else
360 } 362#endif
363 kfree(c->blocks);
364
361 return -EIO; 365 return -EIO;
362 } 366 }
363 367
diff --git a/fs/jffs2/debug.c b/fs/jffs2/debug.c
index fb88eb19711b..80ac9b6514bf 100644
--- a/fs/jffs2/debug.c
+++ b/fs/jffs2/debug.c
@@ -7,10 +7,11 @@
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.7 2005/07/24 15:14:14 dedekind Exp $ 10 * $Id: debug.c,v 1.8 2005/07/30 15:27:05 lunn Exp $
11 * 11 *
12 */ 12 */
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/types.h>
14#include <linux/pagemap.h> 15#include <linux/pagemap.h>
15#include <linux/crc32.h> 16#include <linux/crc32.h>
16#include <linux/jffs2.h> 17#include <linux/jffs2.h>
diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c
index 67732ba08c3e..8c6665d0e334 100644
--- a/fs/jffs2/readinode.c
+++ b/fs/jffs2/readinode.c
@@ -7,11 +7,12 @@
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: readinode.c,v 1.132 2005/07/28 14:46:40 dedekind Exp $ 10 * $Id: readinode.c,v 1.133 2005/07/30 15:28:24 lunn Exp $
11 * 11 *
12 */ 12 */
13 13
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/sched.h>
15#include <linux/slab.h> 16#include <linux/slab.h>
16#include <linux/fs.h> 17#include <linux/fs.h>
17#include <linux/crc32.h> 18#include <linux/crc32.h>
@@ -249,7 +250,7 @@ read_dnode(struct jffs2_sb_info *c,
249 if (unlikely(je32_to_cpu(rd->offset) > je32_to_cpu(rd->isize)) || 250 if (unlikely(je32_to_cpu(rd->offset) > je32_to_cpu(rd->isize)) ||
250 unlikely(PAD(je32_to_cpu(rd->csize) + sizeof(*rd)) != PAD(je32_to_cpu(rd->totlen)))) { 251 unlikely(PAD(je32_to_cpu(rd->csize) + sizeof(*rd)) != PAD(je32_to_cpu(rd->totlen)))) {
251 JFFS2_WARNING("inode node header CRC is corrupted at %#08x\n", ref_offset(ref)); 252 JFFS2_WARNING("inode node header CRC is corrupted at %#08x\n", ref_offset(ref));
252 __jffs2_dbg_dump_node(c, ref_offset(ref)); 253 jffs2_dbg_dump_node(c, ref_offset(ref));
253 return 1; 254 return 1;
254 } 255 }
255 256
@@ -384,7 +385,7 @@ read_unknown(struct jffs2_sb_info *c,
384 if (crc32(0, un, sizeof(struct jffs2_unknown_node) - 4) != je32_to_cpu(un->hdr_crc)) { 385 if (crc32(0, un, sizeof(struct jffs2_unknown_node) - 4) != je32_to_cpu(un->hdr_crc)) {
385 /* Hmmm. This should have been caught at scan time. */ 386 /* Hmmm. This should have been caught at scan time. */
386 JFFS2_NOTICE("node header CRC failed at %#08x. But it must have been OK earlier.\n", ref_offset(ref)); 387 JFFS2_NOTICE("node header CRC failed at %#08x. But it must have been OK earlier.\n", ref_offset(ref));
387 __jffs2_dbg_dump_node(c, ref_offset(ref)); 388 jffs2_dbg_dump_node(c, ref_offset(ref));
388 return 1; 389 return 1;
389 } else { 390 } else {
390 switch(je16_to_cpu(un->nodetype) & JFFS2_COMPAT_MASK) { 391 switch(je16_to_cpu(un->nodetype) & JFFS2_COMPAT_MASK) {