diff options
Diffstat (limited to 'fs/jffs2/fs.c')
-rw-r--r-- | fs/jffs2/fs.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index 30ab233fe423..5687c3f42002 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c | |||
@@ -7,11 +7,10 @@ | |||
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: fs.c,v 1.51 2004/11/28 12:19:37 dedekind Exp $ | 10 | * $Id: fs.c,v 1.56 2005/07/06 12:13:09 dwmw2 Exp $ |
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/version.h> | ||
15 | #include <linux/config.h> | 14 | #include <linux/config.h> |
16 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
17 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
@@ -450,11 +449,15 @@ int jffs2_do_fill_super(struct super_block *sb, void *data, int silent) | |||
450 | 449 | ||
451 | c = JFFS2_SB_INFO(sb); | 450 | c = JFFS2_SB_INFO(sb); |
452 | 451 | ||
453 | #ifndef CONFIG_JFFS2_FS_NAND | 452 | #ifndef CONFIG_JFFS2_FS_WRITEBUFFER |
454 | if (c->mtd->type == MTD_NANDFLASH) { | 453 | if (c->mtd->type == MTD_NANDFLASH) { |
455 | printk(KERN_ERR "jffs2: Cannot operate on NAND flash unless jffs2 NAND support is compiled in.\n"); | 454 | printk(KERN_ERR "jffs2: Cannot operate on NAND flash unless jffs2 NAND support is compiled in.\n"); |
456 | return -EINVAL; | 455 | return -EINVAL; |
457 | } | 456 | } |
457 | if (c->mtd->type == MTD_DATAFLASH) { | ||
458 | printk(KERN_ERR "jffs2: Cannot operate on DataFlash unless jffs2 DataFlash support is compiled in.\n"); | ||
459 | return -EINVAL; | ||
460 | } | ||
458 | #endif | 461 | #endif |
459 | 462 | ||
460 | c->flash_size = c->mtd->size; | 463 | c->flash_size = c->mtd->size; |
@@ -522,9 +525,7 @@ int jffs2_do_fill_super(struct super_block *sb, void *data, int silent) | |||
522 | if (!sb->s_root) | 525 | if (!sb->s_root) |
523 | goto out_root_i; | 526 | goto out_root_i; |
524 | 527 | ||
525 | #if LINUX_VERSION_CODE >= 0x20403 | ||
526 | sb->s_maxbytes = 0xFFFFFFFF; | 528 | sb->s_maxbytes = 0xFFFFFFFF; |
527 | #endif | ||
528 | sb->s_blocksize = PAGE_CACHE_SIZE; | 529 | sb->s_blocksize = PAGE_CACHE_SIZE; |
529 | sb->s_blocksize_bits = PAGE_CACHE_SHIFT; | 530 | sb->s_blocksize_bits = PAGE_CACHE_SHIFT; |
530 | sb->s_magic = JFFS2_SUPER_MAGIC; | 531 | sb->s_magic = JFFS2_SUPER_MAGIC; |
@@ -661,6 +662,14 @@ static int jffs2_flash_setup(struct jffs2_sb_info *c) { | |||
661 | if (ret) | 662 | if (ret) |
662 | return ret; | 663 | return ret; |
663 | } | 664 | } |
665 | |||
666 | /* and Dataflash */ | ||
667 | if (jffs2_dataflash(c)) { | ||
668 | ret = jffs2_dataflash_setup(c); | ||
669 | if (ret) | ||
670 | return ret; | ||
671 | } | ||
672 | |||
664 | return ret; | 673 | return ret; |
665 | } | 674 | } |
666 | 675 | ||
@@ -674,4 +683,9 @@ void jffs2_flash_cleanup(struct jffs2_sb_info *c) { | |||
674 | if (jffs2_nor_ecc(c)) { | 683 | if (jffs2_nor_ecc(c)) { |
675 | jffs2_nor_ecc_flash_cleanup(c); | 684 | jffs2_nor_ecc_flash_cleanup(c); |
676 | } | 685 | } |
686 | |||
687 | /* and DataFlash */ | ||
688 | if (jffs2_dataflash(c)) { | ||
689 | jffs2_dataflash_cleanup(c); | ||
690 | } | ||
677 | } | 691 | } |