aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/mballoc.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index cd258463e2a9..cf9972090ad9 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2571,13 +2571,11 @@ static int ext4_mb_init_backend(struct super_block *sb)
2571{ 2571{
2572 ext4_group_t ngroups = ext4_get_groups_count(sb); 2572 ext4_group_t ngroups = ext4_get_groups_count(sb);
2573 ext4_group_t i; 2573 ext4_group_t i;
2574 int metalen;
2575 struct ext4_sb_info *sbi = EXT4_SB(sb); 2574 struct ext4_sb_info *sbi = EXT4_SB(sb);
2576 struct ext4_super_block *es = sbi->s_es; 2575 struct ext4_super_block *es = sbi->s_es;
2577 int num_meta_group_infos; 2576 int num_meta_group_infos;
2578 int num_meta_group_infos_max; 2577 int num_meta_group_infos_max;
2579 int array_size; 2578 int array_size;
2580 struct ext4_group_info **meta_group_info;
2581 struct ext4_group_desc *desc; 2579 struct ext4_group_desc *desc;
2582 2580
2583 /* This is the number of blocks used by GDT */ 2581 /* This is the number of blocks used by GDT */
@@ -2622,22 +2620,6 @@ static int ext4_mb_init_backend(struct super_block *sb)
2622 goto err_freesgi; 2620 goto err_freesgi;
2623 } 2621 }
2624 EXT4_I(sbi->s_buddy_cache)->i_disksize = 0; 2622 EXT4_I(sbi->s_buddy_cache)->i_disksize = 0;
2625
2626 metalen = sizeof(*meta_group_info) << EXT4_DESC_PER_BLOCK_BITS(sb);
2627 for (i = 0; i < num_meta_group_infos; i++) {
2628 if ((i + 1) == num_meta_group_infos)
2629 metalen = sizeof(*meta_group_info) *
2630 (ngroups -
2631 (i << EXT4_DESC_PER_BLOCK_BITS(sb)));
2632 meta_group_info = kmalloc(metalen, GFP_KERNEL);
2633 if (meta_group_info == NULL) {
2634 printk(KERN_ERR "EXT4-fs: can't allocate mem for a "
2635 "buddy group\n");
2636 goto err_freemeta;
2637 }
2638 sbi->s_group_info[i] = meta_group_info;
2639 }
2640
2641 for (i = 0; i < ngroups; i++) { 2623 for (i = 0; i < ngroups; i++) {
2642 desc = ext4_get_group_desc(sb, i, NULL); 2624 desc = ext4_get_group_desc(sb, i, NULL);
2643 if (desc == NULL) { 2625 if (desc == NULL) {
@@ -2655,7 +2637,6 @@ err_freebuddy:
2655 while (i-- > 0) 2637 while (i-- > 0)
2656 kfree(ext4_get_group_info(sb, i)); 2638 kfree(ext4_get_group_info(sb, i));
2657 i = num_meta_group_infos; 2639 i = num_meta_group_infos;
2658err_freemeta:
2659 while (i-- > 0) 2640 while (i-- > 0)
2660 kfree(sbi->s_group_info[i]); 2641 kfree(sbi->s_group_info[i]);
2661 iput(sbi->s_buddy_cache); 2642 iput(sbi->s_buddy_cache);