fs/udf: Use vzalloc
authorJoe Perches <joe@perches.com>
Fri, 5 Nov 2010 03:08:04 +0000 (20:08 -0700)
committerJan Kara <jack@suse.cz>
Thu, 6 Jan 2011 16:03:53 +0000 (17:03 +0100)
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/udf/super.c

index 4a5c7c61836aaf6a1224740eefe607b886929c9e..f99ff5dbd741cd47130aa570475f5a67cc2acb99 100644 (file)
@@ -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__,
@@ -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;