diff options
author | michael <trimarchi@gandalf.sssup.it> | 2008-04-18 16:44:17 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2008-04-22 07:35:50 -0400 |
commit | cca15841710da39490abc17f56b55703e3140955 (patch) | |
tree | 7f91f721d9ad57e188b73db78c011f19f74b284d | |
parent | 0bc88c59cc2f031a38ad5902d5764497549217c5 (diff) |
[JFFS2] add write verify on dataflash.
Add the write verification buffer to the dataflash. The mtd_dataflash has
the CONFIG_DATAFLASH_WRITE_VERIFY so is better a change to Kconfig.
Signed-off-by: Michael Trimarchi <trimarchimichael@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
-rw-r--r-- | fs/jffs2/wbuf.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c index d1d4f27464ba..ba49f19cff85 100644 --- a/fs/jffs2/wbuf.c +++ b/fs/jffs2/wbuf.c | |||
@@ -1236,12 +1236,24 @@ int jffs2_dataflash_setup(struct jffs2_sb_info *c) { | |||
1236 | if (!c->wbuf) | 1236 | if (!c->wbuf) |
1237 | return -ENOMEM; | 1237 | return -ENOMEM; |
1238 | 1238 | ||
1239 | #ifdef CONFIG_JFFS2_FS_WBUF_VERIFY | ||
1240 | c->wbuf_verify = kmalloc(c->wbuf_pagesize, GFP_KERNEL); | ||
1241 | if (!c->wbuf_verify) { | ||
1242 | kfree(c->oobbuf); | ||
1243 | kfree(c->wbuf); | ||
1244 | return -ENOMEM; | ||
1245 | } | ||
1246 | #endif | ||
1247 | |||
1239 | printk(KERN_INFO "JFFS2 write-buffering enabled buffer (%d) erasesize (%d)\n", c->wbuf_pagesize, c->sector_size); | 1248 | printk(KERN_INFO "JFFS2 write-buffering enabled buffer (%d) erasesize (%d)\n", c->wbuf_pagesize, c->sector_size); |
1240 | 1249 | ||
1241 | return 0; | 1250 | return 0; |
1242 | } | 1251 | } |
1243 | 1252 | ||
1244 | void jffs2_dataflash_cleanup(struct jffs2_sb_info *c) { | 1253 | void jffs2_dataflash_cleanup(struct jffs2_sb_info *c) { |
1254 | #ifdef CONFIG_JFFS2_FS_WBUF_VERIFY | ||
1255 | kfree(c->wbuf_verify); | ||
1256 | #endif | ||
1245 | kfree(c->wbuf); | 1257 | kfree(c->wbuf); |
1246 | } | 1258 | } |
1247 | 1259 | ||