diff options
author | Andrew Victor <andrew@sanpeople.com> | 2005-02-09 04:17:45 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@mtd.linutronix.de> | 2005-05-23 06:28:03 -0400 |
commit | 8f15fd55f9bf266139b10850947e19c4e3f4e9b7 (patch) | |
tree | 3df936efbffbbd6c20dd75f51780ac37458285ff /fs/jffs2/fs.c | |
parent | 3be36675d41a30ed3b192f92684f1417aa0f8bfe (diff) |
[JFFS2] Add support for JFFS2-on-Dataflash devices.
For Dataflash, can_mark_obsolete = false and the NAND write buffering
code (wbuf.c) is used.
Since the DataFlash chip will automatically erase pages when writing,
the cleanmarkers are not needed - so cleanmarker_oob = false and
cleanmarker_size = 0
DataFlash page-sizes are not a power of two (they're multiples of 528
bytes). The SECTOR_ADDR macro (added in the previous core patch) is
replaced with a (slower) div/mod version if CONFIG_JFFS2_FS_DATAFLASH is
selected.
Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs/jffs2/fs.c')
-rw-r--r-- | fs/jffs2/fs.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index 30ab233fe42..5b7c960a047 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.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: fs.c,v 1.51 2004/11/28 12:19:37 dedekind Exp $ | 10 | * $Id: fs.c,v 1.52 2005/02/09 09:17:40 pavlov Exp $ |
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
@@ -456,6 +456,12 @@ int jffs2_do_fill_super(struct super_block *sb, void *data, int silent) | |||
456 | return -EINVAL; | 456 | return -EINVAL; |
457 | } | 457 | } |
458 | #endif | 458 | #endif |
459 | #ifndef CONFIG_JFFS2_FS_DATAFLASH | ||
460 | if (c->mtd->type == MTD_DATAFLASH) { | ||
461 | printk(KERN_ERR "jffs2: Cannot operate on DataFlash unless jffs2 DataFlash support is compiled in.\n"); | ||
462 | return -EINVAL; | ||
463 | } | ||
464 | #endif | ||
459 | 465 | ||
460 | c->flash_size = c->mtd->size; | 466 | c->flash_size = c->mtd->size; |
461 | 467 | ||
@@ -661,6 +667,14 @@ static int jffs2_flash_setup(struct jffs2_sb_info *c) { | |||
661 | if (ret) | 667 | if (ret) |
662 | return ret; | 668 | return ret; |
663 | } | 669 | } |
670 | |||
671 | /* and Dataflash */ | ||
672 | if (jffs2_dataflash(c)) { | ||
673 | ret = jffs2_dataflash_setup(c); | ||
674 | if (ret) | ||
675 | return ret; | ||
676 | } | ||
677 | |||
664 | return ret; | 678 | return ret; |
665 | } | 679 | } |
666 | 680 | ||
@@ -674,4 +688,9 @@ void jffs2_flash_cleanup(struct jffs2_sb_info *c) { | |||
674 | if (jffs2_nor_ecc(c)) { | 688 | if (jffs2_nor_ecc(c)) { |
675 | jffs2_nor_ecc_flash_cleanup(c); | 689 | jffs2_nor_ecc_flash_cleanup(c); |
676 | } | 690 | } |
691 | |||
692 | /* and DataFlash */ | ||
693 | if (jffs2_dataflash(c)) { | ||
694 | jffs2_dataflash_cleanup(c); | ||
695 | } | ||
677 | } | 696 | } |