diff options
author | Andrew Victor <andrew@sanpeople.com> | 2005-02-09 04:24:26 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@mtd.linutronix.de> | 2005-05-23 06:29:43 -0400 |
commit | 2f82ce1eb637c06dfc60f095cd1891ae0ba4894c (patch) | |
tree | 425727d05f70fdd55d5cf715c7acbeca6aeeeb18 /fs/jffs2/scan.c | |
parent | 8f15fd55f9bf266139b10850947e19c4e3f4e9b7 (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/scan.c')
-rw-r--r-- | fs/jffs2/scan.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c index e8c43746c82e..bc6c99980026 100644 --- a/fs/jffs2/scan.c +++ b/fs/jffs2/scan.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: scan.c,v 1.117 2005/02/09 09:17:41 pavlov Exp $ | 10 | * $Id: scan.c,v 1.118 2005/02/09 09:23:53 pavlov Exp $ |
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
@@ -68,7 +68,7 @@ static int jffs2_scan_dirent_node(struct jffs2_sb_info *c, struct jffs2_eraseblo | |||
68 | static inline int min_free(struct jffs2_sb_info *c) | 68 | static inline int min_free(struct jffs2_sb_info *c) |
69 | { | 69 | { |
70 | uint32_t min = 2 * sizeof(struct jffs2_raw_inode); | 70 | uint32_t min = 2 * sizeof(struct jffs2_raw_inode); |
71 | #if defined CONFIG_JFFS2_FS_NAND || defined CONFIG_JFFS2_FS_NOR_ECC || defined CONFIG_JFFS2_FS_DATAFLASH | 71 | #ifdef CONFIG_JFFS2_FS_WRITEBUFFER |
72 | if (!jffs2_can_mark_obsolete(c) && min < c->wbuf_pagesize) | 72 | if (!jffs2_can_mark_obsolete(c) && min < c->wbuf_pagesize) |
73 | return c->wbuf_pagesize; | 73 | return c->wbuf_pagesize; |
74 | #endif | 74 | #endif |
@@ -228,7 +228,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c) | |||
228 | c->dirty_size -= c->nextblock->dirty_size; | 228 | c->dirty_size -= c->nextblock->dirty_size; |
229 | c->nextblock->dirty_size = 0; | 229 | c->nextblock->dirty_size = 0; |
230 | } | 230 | } |
231 | #if defined CONFIG_JFFS2_FS_NAND || defined CONFIG_JFFS2_FS_NOR_ECC || defined CONFIG_JFFS2_FS_DATAFLASH | 231 | #ifdef CONFIG_JFFS2_FS_WRITEBUFFER |
232 | if (!jffs2_can_mark_obsolete(c) && c->nextblock && (c->nextblock->free_size & (c->wbuf_pagesize-1))) { | 232 | if (!jffs2_can_mark_obsolete(c) && c->nextblock && (c->nextblock->free_size & (c->wbuf_pagesize-1))) { |
233 | /* If we're going to start writing into a block which already | 233 | /* If we're going to start writing into a block which already |
234 | contains data, and the end of the data isn't page-aligned, | 234 | contains data, and the end of the data isn't page-aligned, |
@@ -294,7 +294,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo | |||
294 | uint32_t hdr_crc, buf_ofs, buf_len; | 294 | uint32_t hdr_crc, buf_ofs, buf_len; |
295 | int err; | 295 | int err; |
296 | int noise = 0; | 296 | int noise = 0; |
297 | #ifdef CONFIG_JFFS2_FS_NAND | 297 | #ifdef CONFIG_JFFS2_FS_WRITEBUFFER |
298 | int cleanmarkerfound = 0; | 298 | int cleanmarkerfound = 0; |
299 | #endif | 299 | #endif |
300 | 300 | ||
@@ -303,7 +303,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo | |||
303 | 303 | ||
304 | D1(printk(KERN_DEBUG "jffs2_scan_eraseblock(): Scanning block at 0x%x\n", ofs)); | 304 | D1(printk(KERN_DEBUG "jffs2_scan_eraseblock(): Scanning block at 0x%x\n", ofs)); |
305 | 305 | ||
306 | #ifdef CONFIG_JFFS2_FS_NAND | 306 | #ifdef CONFIG_JFFS2_FS_WRITEBUFFER |
307 | if (jffs2_cleanmarker_oob(c)) { | 307 | if (jffs2_cleanmarker_oob(c)) { |
308 | int ret = jffs2_check_nand_cleanmarker(c, jeb); | 308 | int ret = jffs2_check_nand_cleanmarker(c, jeb); |
309 | D2(printk(KERN_NOTICE "jffs_check_nand_cleanmarker returned %d\n",ret)); | 309 | D2(printk(KERN_NOTICE "jffs_check_nand_cleanmarker returned %d\n",ret)); |
@@ -338,7 +338,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo | |||
338 | ofs += 4; | 338 | ofs += 4; |
339 | 339 | ||
340 | if (ofs == EMPTY_SCAN_SIZE(c->sector_size)) { | 340 | if (ofs == EMPTY_SCAN_SIZE(c->sector_size)) { |
341 | #ifdef CONFIG_JFFS2_FS_NAND | 341 | #ifdef CONFIG_JFFS2_FS_WRITEBUFFER |
342 | if (jffs2_cleanmarker_oob(c)) { | 342 | if (jffs2_cleanmarker_oob(c)) { |
343 | /* scan oob, take care of cleanmarker */ | 343 | /* scan oob, take care of cleanmarker */ |
344 | int ret = jffs2_check_oob_empty(c, jeb, cleanmarkerfound); | 344 | int ret = jffs2_check_oob_empty(c, jeb, cleanmarkerfound); |