aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/wbuf.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-04-27 14:16:19 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2007-04-27 14:16:19 -0400
commitd1da4e50e5d09f02c340927a4fcb7f54202fa033 (patch)
tree7f98317bdd45dbdb7644e9179891c5af6a3a8ef1 /fs/jffs2/wbuf.c
parent78ab67da1002d954ea4c3e2b441e2483c41f94e8 (diff)
parenta205752d1ad2d37d6597aaae5a56fc396a770868 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: drivers/mtd/Kconfig Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'fs/jffs2/wbuf.c')
-rw-r--r--fs/jffs2/wbuf.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c
index dafcd4102401..c556e85a565c 100644
--- a/fs/jffs2/wbuf.c
+++ b/fs/jffs2/wbuf.c
@@ -1209,3 +1209,27 @@ int jffs2_nor_wbuf_flash_setup(struct jffs2_sb_info *c) {
1209void jffs2_nor_wbuf_flash_cleanup(struct jffs2_sb_info *c) { 1209void jffs2_nor_wbuf_flash_cleanup(struct jffs2_sb_info *c) {
1210 kfree(c->wbuf); 1210 kfree(c->wbuf);
1211} 1211}
1212
1213int jffs2_ubivol_setup(struct jffs2_sb_info *c) {
1214 c->cleanmarker_size = 0;
1215
1216 if (c->mtd->writesize == 1)
1217 /* We do not need write-buffer */
1218 return 0;
1219
1220 init_rwsem(&c->wbuf_sem);
1221
1222 c->wbuf_pagesize = c->mtd->writesize;
1223 c->wbuf_ofs = 0xFFFFFFFF;
1224 c->wbuf = kmalloc(c->wbuf_pagesize, GFP_KERNEL);
1225 if (!c->wbuf)
1226 return -ENOMEM;
1227
1228 printk(KERN_INFO "JFFS2 write-buffering enabled buffer (%d) erasesize (%d)\n", c->wbuf_pagesize, c->sector_size);
1229
1230 return 0;
1231}
1232
1233void jffs2_ubivol_cleanup(struct jffs2_sb_info *c) {
1234 kfree(c->wbuf);
1235}