aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/os-linux.h
diff options
context:
space:
mode:
authorAndrew Victor <andrew@sanpeople.com>2005-02-09 04:24:26 -0500
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-05-23 06:29:43 -0400
commit2f82ce1eb637c06dfc60f095cd1891ae0ba4894c (patch)
tree425727d05f70fdd55d5cf715c7acbeca6aeeeb18 /fs/jffs2/os-linux.h
parent8f15fd55f9bf266139b10850947e19c4e3f4e9b7 (diff)
[JFFS2] Use a single config option for write buffer support
This patch replaces the current CONFIG_JFFS2_FS_NAND, CONFIG_JFFS2_FS_NOR_ECC and CONFIG_JFFS2_FS_DATAFLASH with a single configuration option - CONFIG_JFFS2_FS_WRITEBUFFER. The only functional change of this patch is that the slower div/mod calculations for SECTOR_ADDR(), PAGE_DIV() and PAGE_MOD() are now always used when CONFIG_JFFS2_FS_WRITEBUFFER is enabled. 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.h28
1 files changed, 8 insertions, 20 deletions
diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h
index af27b84007a1..8989cd685e46 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.53 2005/02/09 09:17:41 pavlov Exp $ 10 * $Id: os-linux.h,v 1.54 2005/02/09 09:23:53 pavlov Exp $
11 * 11 *
12 */ 12 */
13 13
@@ -97,16 +97,12 @@ 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
103#define SECTOR_ADDR(x) ( ((unsigned long)(x) & ~(c->sector_size-1)) )
104#endif
105 100
106#define jffs2_is_readonly(c) (OFNI_BS_2SFFJ(c)->s_flags & MS_RDONLY) 101#define jffs2_is_readonly(c) (OFNI_BS_2SFFJ(c)->s_flags & MS_RDONLY)
107#define jffs2_is_writebuffered(c) (c->wbuf != NULL) 102#define jffs2_is_writebuffered(c) (c->wbuf != NULL)
108 103
109#if (!defined CONFIG_JFFS2_FS_NAND && !defined CONFIG_JFFS2_FS_NOR_ECC && !defined CONFIG_JFFS2_FS_DATAFLASH) 104#ifndef CONFIG_JFFS2_FS_WRITEBUFFER
105#define SECTOR_ADDR(x) ( ((unsigned long)(x) & ~(c->sector_size-1)) )
110#define jffs2_can_mark_obsolete(c) (1) 106#define jffs2_can_mark_obsolete(c) (1)
111#define jffs2_cleanmarker_oob(c) (0) 107#define jffs2_cleanmarker_oob(c) (0)
112#define jffs2_write_nand_cleanmarker(c,jeb) (-EIO) 108#define jffs2_write_nand_cleanmarker(c,jeb) (-EIO)
@@ -129,6 +125,7 @@ static inline void jffs2_init_inode_info(struct jffs2_inode_info *f)
129 125
130#else /* NAND and/or ECC'd NOR support present */ 126#else /* NAND and/or ECC'd NOR support present */
131 127
128#define SECTOR_ADDR(x) ( ((unsigned long)(x) / (unsigned long)(c->sector_size)) * c->sector_size )
132#define jffs2_can_mark_obsolete(c) ((c->mtd->type == MTD_NORFLASH && !(c->mtd->flags & MTD_ECC)) || c->mtd->type == MTD_RAM) 129#define jffs2_can_mark_obsolete(c) ((c->mtd->type == MTD_NORFLASH && !(c->mtd->flags & MTD_ECC)) || c->mtd->type == MTD_RAM)
133#define jffs2_cleanmarker_oob(c) (c->mtd->type == MTD_NANDFLASH) 130#define jffs2_cleanmarker_oob(c) (c->mtd->type == MTD_NANDFLASH)
134 131
@@ -150,25 +147,16 @@ int jffs2_flush_wbuf_gc(struct jffs2_sb_info *c, uint32_t ino);
150int jffs2_flush_wbuf_pad(struct jffs2_sb_info *c); 147int jffs2_flush_wbuf_pad(struct jffs2_sb_info *c);
151int jffs2_nand_flash_setup(struct jffs2_sb_info *c); 148int jffs2_nand_flash_setup(struct jffs2_sb_info *c);
152void jffs2_nand_flash_cleanup(struct jffs2_sb_info *c); 149void jffs2_nand_flash_cleanup(struct jffs2_sb_info *c);
153#ifdef CONFIG_JFFS2_FS_NOR_ECC 150
154#define jffs2_nor_ecc(c) (c->mtd->type == MTD_NORFLASH && (c->mtd->flags & MTD_ECC)) 151#define jffs2_nor_ecc(c) (c->mtd->type == MTD_NORFLASH && (c->mtd->flags & MTD_ECC))
155int jffs2_nor_ecc_flash_setup(struct jffs2_sb_info *c); 152int jffs2_nor_ecc_flash_setup(struct jffs2_sb_info *c);
156void jffs2_nor_ecc_flash_cleanup(struct jffs2_sb_info *c); 153void jffs2_nor_ecc_flash_cleanup(struct jffs2_sb_info *c);
157#else 154
158#define jffs2_nor_ecc(c) (0)
159#define jffs2_nor_ecc_flash_setup(c) (0)
160#define jffs2_nor_ecc_flash_cleanup(c) do {} while (0)
161#endif /* NOR ECC */
162#ifdef CONFIG_JFFS2_FS_DATAFLASH
163#define jffs2_dataflash(c) (c->mtd->type == MTD_DATAFLASH) 155#define jffs2_dataflash(c) (c->mtd->type == MTD_DATAFLASH)
164int jffs2_dataflash_setup(struct jffs2_sb_info *c); 156int jffs2_dataflash_setup(struct jffs2_sb_info *c);
165void jffs2_dataflash_cleanup(struct jffs2_sb_info *c); 157void jffs2_dataflash_cleanup(struct jffs2_sb_info *c);
166#else 158
167#define jffs2_dataflash(c) (0) 159#endif /* WRITEBUFFER */
168#define jffs2_dataflash_setup(c) (0)
169#define jffs2_dataflash_cleanup(c) do {} while (0)
170#endif /* DATAFLASH */
171#endif /* NAND */
172 160
173/* erase.c */ 161/* erase.c */
174static inline void jffs2_erase_pending_trigger(struct jffs2_sb_info *c) 162static inline void jffs2_erase_pending_trigger(struct jffs2_sb_info *c)