diff options
Diffstat (limited to 'fs/jffs2/wbuf.c')
-rw-r--r-- | fs/jffs2/wbuf.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c index 251ac3d86f99..8c06d3a2b17d 100644 --- a/fs/jffs2/wbuf.c +++ b/fs/jffs2/wbuf.c | |||
@@ -9,7 +9,7 @@ | |||
9 | * | 9 | * |
10 | * For licensing information, see the file 'LICENCE' in this directory. | 10 | * For licensing information, see the file 'LICENCE' in this directory. |
11 | * | 11 | * |
12 | * $Id: wbuf.c,v 1.96 2005/07/22 10:32:08 dedekind Exp $ | 12 | * $Id: wbuf.c,v 1.97 2005/08/06 04:51:30 nico Exp $ |
13 | * | 13 | * |
14 | */ | 14 | */ |
15 | 15 | ||
@@ -1235,3 +1235,23 @@ int jffs2_nor_ecc_flash_setup(struct jffs2_sb_info *c) { | |||
1235 | void jffs2_nor_ecc_flash_cleanup(struct jffs2_sb_info *c) { | 1235 | void jffs2_nor_ecc_flash_cleanup(struct jffs2_sb_info *c) { |
1236 | kfree(c->wbuf); | 1236 | kfree(c->wbuf); |
1237 | } | 1237 | } |
1238 | |||
1239 | int jffs2_nor_wbuf_flash_setup(struct jffs2_sb_info *c) { | ||
1240 | /* Cleanmarker currently occupies a whole programming region */ | ||
1241 | c->cleanmarker_size = MTD_PROGREGION_SIZE(c->mtd); | ||
1242 | |||
1243 | /* Initialize write buffer */ | ||
1244 | init_rwsem(&c->wbuf_sem); | ||
1245 | c->wbuf_pagesize = MTD_PROGREGION_SIZE(c->mtd); | ||
1246 | c->wbuf_ofs = 0xFFFFFFFF; | ||
1247 | |||
1248 | c->wbuf = kmalloc(c->wbuf_pagesize, GFP_KERNEL); | ||
1249 | if (!c->wbuf) | ||
1250 | return -ENOMEM; | ||
1251 | |||
1252 | return 0; | ||
1253 | } | ||
1254 | |||
1255 | void jffs2_nor_wbuf_flash_cleanup(struct jffs2_sb_info *c) { | ||
1256 | kfree(c->wbuf); | ||
1257 | } | ||