aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/os-linux.h
diff options
context:
space:
mode:
authorAndrew Victor <andrew@sanpeople.com>2005-02-09 04:17:45 -0500
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-05-23 06:28:03 -0400
commit8f15fd55f9bf266139b10850947e19c4e3f4e9b7 (patch)
tree3df936efbffbbd6c20dd75f51780ac37458285ff /fs/jffs2/os-linux.h
parent3be36675d41a30ed3b192f92684f1417aa0f8bfe (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/os-linux.h')
-rw-r--r--fs/jffs2/os-linux.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h
index 0412416d1f2d..af27b84007a1 100644
--- a/fs/jffs2/os-linux.h
+++ b/fs/jffs2/os-linux.h
@@ -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: os-linux.h,v 1.52 2005/02/09 09:09:01 pavlov Exp $ 10 * $Id: os-linux.h,v 1.53 2005/02/09 09:17:41 pavlov Exp $
11 * 11 *
12 */ 12 */
13 13
@@ -97,12 +97,16 @@ static inline void jffs2_init_inode_info(struct jffs2_inode_info *f)
97#endif 97#endif
98} 98}
99 99
100#ifdef CONFIG_JFFS2_FS_DATAFLASH
101#define SECTOR_ADDR(x) ( ((unsigned long)(x) / (unsigned long)(c->sector_size)) * c->sector_size )
102#else
100#define SECTOR_ADDR(x) ( ((unsigned long)(x) & ~(c->sector_size-1)) ) 103#define SECTOR_ADDR(x) ( ((unsigned long)(x) & ~(c->sector_size-1)) )
104#endif
101 105
102#define jffs2_is_readonly(c) (OFNI_BS_2SFFJ(c)->s_flags & MS_RDONLY) 106#define jffs2_is_readonly(c) (OFNI_BS_2SFFJ(c)->s_flags & MS_RDONLY)
103#define jffs2_is_writebuffered(c) (c->wbuf != NULL) 107#define jffs2_is_writebuffered(c) (c->wbuf != NULL)
104 108
105#if (!defined CONFIG_JFFS2_FS_NAND && !defined CONFIG_JFFS2_FS_NOR_ECC) 109#if (!defined CONFIG_JFFS2_FS_NAND && !defined CONFIG_JFFS2_FS_NOR_ECC && !defined CONFIG_JFFS2_FS_DATAFLASH)
106#define jffs2_can_mark_obsolete(c) (1) 110#define jffs2_can_mark_obsolete(c) (1)
107#define jffs2_cleanmarker_oob(c) (0) 111#define jffs2_cleanmarker_oob(c) (0)
108#define jffs2_write_nand_cleanmarker(c,jeb) (-EIO) 112#define jffs2_write_nand_cleanmarker(c,jeb) (-EIO)
@@ -119,6 +123,7 @@ static inline void jffs2_init_inode_info(struct jffs2_inode_info *f)
119#define jffs2_wbuf_timeout NULL 123#define jffs2_wbuf_timeout NULL
120#define jffs2_wbuf_process NULL 124#define jffs2_wbuf_process NULL
121#define jffs2_nor_ecc(c) (0) 125#define jffs2_nor_ecc(c) (0)
126#define jffs2_dataflash(c) (0)
122#define jffs2_nor_ecc_flash_setup(c) (0) 127#define jffs2_nor_ecc_flash_setup(c) (0)
123#define jffs2_nor_ecc_flash_cleanup(c) do {} while (0) 128#define jffs2_nor_ecc_flash_cleanup(c) do {} while (0)
124 129
@@ -154,6 +159,15 @@ void jffs2_nor_ecc_flash_cleanup(struct jffs2_sb_info *c);
154#define jffs2_nor_ecc_flash_setup(c) (0) 159#define jffs2_nor_ecc_flash_setup(c) (0)
155#define jffs2_nor_ecc_flash_cleanup(c) do {} while (0) 160#define jffs2_nor_ecc_flash_cleanup(c) do {} while (0)
156#endif /* NOR ECC */ 161#endif /* NOR ECC */
162#ifdef CONFIG_JFFS2_FS_DATAFLASH
163#define jffs2_dataflash(c) (c->mtd->type == MTD_DATAFLASH)
164int jffs2_dataflash_setup(struct jffs2_sb_info *c);
165void jffs2_dataflash_cleanup(struct jffs2_sb_info *c);
166#else
167#define jffs2_dataflash(c) (0)
168#define jffs2_dataflash_setup(c) (0)
169#define jffs2_dataflash_cleanup(c) do {} while (0)
170#endif /* DATAFLASH */
157#endif /* NAND */ 171#endif /* NAND */
158 172
159/* erase.c */ 173/* erase.c */