Whamcloud - gitweb
LU-2762 ldiskfs: use upstream ext4_kvzalloc
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / rhel6.3 / ext4-use-vzalloc-in-ext4_fill_flex_info.patch
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()
5 Git-commit: 94de56ab
6 Patch-mainline: v2.6.38-rc1
7
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>
11 ---
12  fs/ext4/super.c |   15 +++++++--------
13  1 file changed, 7 insertions(+), 8 deletions(-)
14
15 --- a/fs/ext4/super.c
16 +++ b/fs/ext4/super.c
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);
24 -       }
25 -       if (sbi->s_flex_groups == NULL) {
26 -               ext4_msg(sb, KERN_ERR, "not enough memory for "
27 -                               "%u flex groups", flex_group_count);
28 -               goto failed;
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",
33 +                                flex_group_count);
34 +                       goto failed;
35 +               }
36         }
37
38         for (i = 0; i < sbi->s_groups_count; i++) {