summaryrefslogtreecommitdiff
path: root/fs/jffs2
diff options
context:
space:
mode:
authormichael <trimarchi@gandalf.sssup.it>2008-04-19 00:44:17 +0400
committerDavid Woodhouse <dwmw2@infradead.org>2008-04-22 15:35:50 +0400
commitcca15841710da39490abc17f56b55703e3140955 (patch)
tree7f91f721d9ad57e188b73db78c011f19f74b284d /fs/jffs2
parent0bc88c59cc2f031a38ad5902d5764497549217c5 (diff)
downloadlinux-cca15841710da39490abc17f56b55703e3140955.tar.xz
[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>
Diffstat (limited to 'fs/jffs2')
-rw-r--r--fs/jffs2/wbuf.c12
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) {
if (!c->wbuf)
return -ENOMEM;
+#ifdef CONFIG_JFFS2_FS_WBUF_VERIFY
+ c->wbuf_verify = kmalloc(c->wbuf_pagesize, GFP_KERNEL);
+ if (!c->wbuf_verify) {
+ kfree(c->oobbuf);
+ kfree(c->wbuf);
+ return -ENOMEM;
+ }
+#endif
+
printk(KERN_INFO "JFFS2 write-buffering enabled buffer (%d) erasesize (%d)\n", c->wbuf_pagesize, c->sector_size);
return 0;
}
void jffs2_dataflash_cleanup(struct jffs2_sb_info *c) {
+#ifdef CONFIG_JFFS2_FS_WBUF_VERIFY
+ kfree(c->wbuf_verify);
+#endif
kfree(c->wbuf);
}