[S390] cio: Memory allocation for idset changed.
authorMichael Ernst <mernst@de.ibm.com>
Fri, 1 Aug 2008 14:39:14 +0000 (16:39 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 1 Aug 2008 14:39:31 +0000 (16:39 +0200)
Memory allocation for the quite huge idset changed from
kzalloc to vmalloc.

Signed-off-by: Michael Ernst <mernst@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/cio/idset.c

index ef7bc0a..cf8f24a 100644 (file)
@@ -5,7 +5,7 @@
  *    Author(s): Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
  */
 
-#include <linux/slab.h>
+#include <linux/vmalloc.h>
 #include <linux/bitops.h>
 #include "idset.h"
 #include "css.h"
@@ -25,18 +25,18 @@ static struct idset *idset_new(int num_ssid, int num_id)
 {
        struct idset *set;
 
-       set = kzalloc(sizeof(struct idset) + bitmap_size(num_ssid, num_id),
-                     GFP_KERNEL);
+       set = vmalloc(sizeof(struct idset) + bitmap_size(num_ssid, num_id));
        if (set) {
                set->num_ssid = num_ssid;
                set->num_id = num_id;
+               memset(set->bitmap, 0, bitmap_size(num_ssid, num_id));
        }
        return set;
 }
 
 void idset_free(struct idset *set)
 {
-       kfree(set);
+       vfree(set);
 }
 
 void idset_clear(struct idset *set)