1 From 94de56ab2062be59d80e2efb7c0dc60ecf616075 Mon Sep 17 00:00:00 2001
2 From: Joe Perches <joe@perches.com>
3 Date: Sun, 19 Dec 2010 22:21:02 -0500
4 Subject: ext4: Use vzalloc in ext4_fill_flex_info()
6 Patch-mainline: v2.6.38-rc1
8 Signed-off-by: Joe Perches <joe@perches.com>
9 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 Acked-by: Jeff Mahoney <jeffm@suse.com>
12 fs/ext4/super.c | 15 +++++++--------
13 1 file changed, 7 insertions(+), 8 deletions(-)
17 @@ -1817,14 +1817,13 @@ static int ext4_fill_flex_info(struct su
18 size = flex_group_count * sizeof(struct flex_groups);
19 sbi->s_flex_groups = kzalloc(size, GFP_KERNEL);
20 if (sbi->s_flex_groups == NULL) {
21 - sbi->s_flex_groups = vmalloc(size);
22 - if (sbi->s_flex_groups)
23 - memset(sbi->s_flex_groups, 0, size);
25 - if (sbi->s_flex_groups == NULL) {
26 - ext4_msg(sb, KERN_ERR, "not enough memory for "
27 - "%u flex groups", flex_group_count);
29 + sbi->s_flex_groups = vzalloc(size);
30 + if (sbi->s_flex_groups == NULL) {
31 + ext4_msg(sb, KERN_ERR,
32 + "not enough memory for %u flex groups",
38 for (i = 0; i < sbi->s_groups_count; i++) {