Skip to content

Commit

Permalink
fs/udf: Use vzalloc
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jan Kara <jack@suse.cz>
  • Loading branch information
Joe Perches authored and Jan Kara committed Jan 6, 2011
1 parent 3c0eee3 commit ed2ae6f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fs/udf/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -959,9 +959,9 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index)
(sizeof(struct buffer_head *) * nr_groups);

if (size <= PAGE_SIZE)
bitmap = kmalloc(size, GFP_KERNEL);
bitmap = kzalloc(size, GFP_KERNEL);
else
bitmap = vmalloc(size); /* TODO: get rid of vmalloc */
bitmap = vzalloc(size); /* TODO: get rid of vzalloc */

if (bitmap == NULL) {
udf_error(sb, __func__,
Expand All @@ -970,7 +970,6 @@ static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index)
return NULL;
}

memset(bitmap, 0x00, size);
bitmap->s_block_bitmap = (struct buffer_head **)(bitmap + 1);
bitmap->s_nr_groups = nr_groups;
return bitmap;
Expand Down

0 comments on commit ed2ae6f

Please sign in to comment.