jffs2: use vzalloc
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
parent
309b5e4e41
commit
7ddbead6e6
@ -336,14 +336,13 @@ int jffs2_do_mount_fs(struct jffs2_sb_info *c)
|
|||||||
size = sizeof(struct jffs2_eraseblock) * c->nr_blocks;
|
size = sizeof(struct jffs2_eraseblock) * c->nr_blocks;
|
||||||
#ifndef __ECOS
|
#ifndef __ECOS
|
||||||
if (jffs2_blocks_use_vmalloc(c))
|
if (jffs2_blocks_use_vmalloc(c))
|
||||||
c->blocks = vmalloc(size);
|
c->blocks = vzalloc(size);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
c->blocks = kmalloc(size, GFP_KERNEL);
|
c->blocks = kzalloc(size, GFP_KERNEL);
|
||||||
if (!c->blocks)
|
if (!c->blocks)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
memset(c->blocks, 0, size);
|
|
||||||
for (i=0; i<c->nr_blocks; i++) {
|
for (i=0; i<c->nr_blocks; i++) {
|
||||||
INIT_LIST_HEAD(&c->blocks[i].list);
|
INIT_LIST_HEAD(&c->blocks[i].list);
|
||||||
c->blocks[i].offset = i * c->sector_size;
|
c->blocks[i].offset = i * c->sector_size;
|
||||||
|
Loading…
Reference in New Issue
Block a user