diff options
Diffstat (limited to 'fs/jffs2/wbuf.c')
-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 | ||