diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2008-07-24 12:49:59 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-07-24 12:49:59 -0400 |
commit | ec05e868ac80cc8fc7de6e5cf773b232198e49af (patch) | |
tree | 3c57bd99439e1e9559a0ddf755e2a8be1bcb4676 | |
parent | 12219aea6b944e36795267be31d43f9c484841be (diff) |
ext4: improve ext4_fill_flex_info() a bit
- use kzalloc() instead of kmalloc() + memset()
- improve a printk info
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r-- | fs/ext4/super.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 511997ef6f0e..e34fc2d6dbf5 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -1506,14 +1506,13 @@ static int ext4_fill_flex_info(struct super_block *sb) | |||
1506 | 1506 | ||
1507 | flex_group_count = (sbi->s_groups_count + groups_per_flex - 1) / | 1507 | flex_group_count = (sbi->s_groups_count + groups_per_flex - 1) / |
1508 | groups_per_flex; | 1508 | groups_per_flex; |
1509 | sbi->s_flex_groups = kmalloc(flex_group_count * | 1509 | sbi->s_flex_groups = kzalloc(flex_group_count * |
1510 | sizeof(struct flex_groups), GFP_KERNEL); | 1510 | sizeof(struct flex_groups), GFP_KERNEL); |
1511 | if (sbi->s_flex_groups == NULL) { | 1511 | if (sbi->s_flex_groups == NULL) { |
1512 | printk(KERN_ERR "EXT4-fs: not enough memory\n"); | 1512 | printk(KERN_ERR "EXT4-fs: not enough memory for " |
1513 | "%lu flex groups\n", flex_group_count); | ||
1513 | goto failed; | 1514 | goto failed; |
1514 | } | 1515 | } |
1515 | memset(sbi->s_flex_groups, 0, flex_group_count * | ||
1516 | sizeof(struct flex_groups)); | ||
1517 | 1516 | ||
1518 | gdp = ext4_get_group_desc(sb, 1, &bh); | 1517 | gdp = ext4_get_group_desc(sb, 1, &bh); |
1519 | block_bitmap = ext4_block_bitmap(sb, gdp) - 1; | 1518 | block_bitmap = ext4_block_bitmap(sb, gdp) - 1; |