提交 ed2ae6f6 编写于 作者: J Joe Perches 提交者: Jan Kara

fs/udf: Use vzalloc

Signed-off-by: NJoe Perches <joe@perches.com>
Signed-off-by: NJan Kara <jack@suse.cz>
上级 3c0eee3f
...@@ -959,9 +959,9 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index) ...@@ -959,9 +959,9 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index)
(sizeof(struct buffer_head *) * nr_groups); (sizeof(struct buffer_head *) * nr_groups);
if (size <= PAGE_SIZE) if (size <= PAGE_SIZE)
bitmap = kmalloc(size, GFP_KERNEL); bitmap = kzalloc(size, GFP_KERNEL);
else else
bitmap = vmalloc(size); /* TODO: get rid of vmalloc */ bitmap = vzalloc(size); /* TODO: get rid of vzalloc */
if (bitmap == NULL) { if (bitmap == NULL) {
udf_error(sb, __func__, udf_error(sb, __func__,
...@@ -970,7 +970,6 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index) ...@@ -970,7 +970,6 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index)
return NULL; return NULL;
} }
memset(bitmap, 0x00, size);
bitmap->s_block_bitmap = (struct buffer_head **)(bitmap + 1); bitmap->s_block_bitmap = (struct buffer_head **)(bitmap + 1);
bitmap->s_nr_groups = nr_groups; bitmap->s_nr_groups = nr_groups;
return bitmap; return bitmap;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册