ext4: use ext4_kvzalloc()/ext4_kvmalloc() for s_group_desc and s_group_info
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
@@ -2331,7 +2331,7 @@ static int ext4_mb_init_backend(struct super_block *sb)
|
||||
/* An 8TB filesystem with 64-bit pointers requires a 4096 byte
|
||||
* kmalloc. A 128kb malloc should suffice for a 256TB filesystem.
|
||||
* So a two level scheme suffices for now. */
|
||||
sbi->s_group_info = kzalloc(array_size, GFP_KERNEL);
|
||||
sbi->s_group_info = ext4_kvzalloc(array_size, GFP_KERNEL);
|
||||
if (sbi->s_group_info == NULL) {
|
||||
printk(KERN_ERR "EXT4-fs: can't allocate buddy meta group\n");
|
||||
return -ENOMEM;
|
||||
@@ -2365,7 +2365,7 @@ err_freebuddy:
|
||||
kfree(sbi->s_group_info[i]);
|
||||
iput(sbi->s_buddy_cache);
|
||||
err_freesgi:
|
||||
kfree(sbi->s_group_info);
|
||||
ext4_kvfree(sbi->s_group_info);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
@@ -2559,7 +2559,7 @@ int ext4_mb_release(struct super_block *sb)
|
||||
EXT4_DESC_PER_BLOCK_BITS(sb);
|
||||
for (i = 0; i < num_meta_group_infos; i++)
|
||||
kfree(sbi->s_group_info[i]);
|
||||
kfree(sbi->s_group_info);
|
||||
ext4_kvfree(sbi->s_group_info);
|
||||
}
|
||||
kfree(sbi->s_mb_offsets);
|
||||
kfree(sbi->s_mb_maxs);
|
||||
|
Reference in New Issue
Block a user