diff options
author | Artem B. Bityutskiy <dedekind@infradead.org> | 2005-09-30 09:59:17 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@mtd.linutronix.de> | 2005-11-06 17:01:48 -0500 |
commit | daba5cc4bcd025a9b4fd02a9117c71bfd400d811 (patch) | |
tree | da74b64b3bbd4ae215ced6d2d54abe7fdf83818e /fs/jffs2/scan.c | |
parent | 83a368380e172c1b2e9fd6ec2a62e457684adf0c (diff) |
[JFFS2] Fix dataflash support
- assume wbuf may be of size which is not power of 2
- don't make strange assumption about not padding wbuf for DataFlash
- use wbuf = DataFlash page and eraseblock >= 8 Dataflash pages
From: Peter Menzebach <pm-mtd@mw-itcon.de>
Acked-by: Artem B. Bityutskiy <dedekind@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs/jffs2/scan.c')
-rw-r--r-- | fs/jffs2/scan.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c index 8df7456472b8..805a166469d2 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.124 2005/09/21 13:05:22 dedekind Exp $ | 10 | * $Id: scan.c,v 1.125 2005/09/30 13:59:13 dedekind Exp $ |
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
@@ -233,12 +233,12 @@ int jffs2_scan_medium(struct jffs2_sb_info *c) | |||
233 | c->nextblock->dirty_size = 0; | 233 | c->nextblock->dirty_size = 0; |
234 | } | 234 | } |
235 | #ifdef CONFIG_JFFS2_FS_WRITEBUFFER | 235 | #ifdef CONFIG_JFFS2_FS_WRITEBUFFER |
236 | if (!jffs2_can_mark_obsolete(c) && c->nextblock && (c->nextblock->free_size & (c->wbuf_pagesize-1))) { | 236 | if (!jffs2_can_mark_obsolete(c) && c->nextblock && (c->nextblock->free_size % c->wbuf_pagesize)) { |
237 | /* If we're going to start writing into a block which already | 237 | /* If we're going to start writing into a block which already |
238 | contains data, and the end of the data isn't page-aligned, | 238 | contains data, and the end of the data isn't page-aligned, |
239 | skip a little and align it. */ | 239 | skip a little and align it. */ |
240 | 240 | ||
241 | uint32_t skip = c->nextblock->free_size & (c->wbuf_pagesize-1); | 241 | uint32_t skip = c->nextblock->free_size % c->wbuf_pagesize; |
242 | 242 | ||
243 | D1(printk(KERN_DEBUG "jffs2_scan_medium(): Skipping %d bytes in nextblock to ensure page alignment\n", | 243 | D1(printk(KERN_DEBUG "jffs2_scan_medium(): Skipping %d bytes in nextblock to ensure page alignment\n", |
244 | skip)); | 244 | skip)); |