[Pvfs2-developers] Patch for 2.4 kernels

Ti Leggett leggett at mcs.anl.gov
Mon Mar 5 11:05:06 EST 2007


This patch removes references to kzalloc. It's necessary for 2.4  
kernels (or at least SLES8 2.4 kernels).

--- src/kernel/linux-2.6/file.c.orig    2007-03-05 09:15:43.000000000  
-0600
+++ src/kernel/linux-2.6/file.c 2007-03-05 09:25:38.000000000 -0600
@@ -357,7 +357,7 @@
                  (unsigned long)(nr_segs * sizeof(*orig_iovec)));
          return -ENOMEM;
      }
-    new_iovec = kzalloc(max_new_nr_segs * sizeof(*new_iovec),
+    new_iovec = (struct iovec *) kmalloc(max_new_nr_segs * sizeof 
(struct iovec)
              PVFS2_BUFMAP_GFP_FLAGS);
      if (new_iovec == NULL)
      {
@@ -366,7 +366,7 @@
                  (unsigned long)(max_new_nr_segs * sizeof 
(*new_iovec)));
          return -ENOMEM;
      }
-    sizes = kzalloc(max_new_nr_segs * sizeof(*sizes),  
PVFS2_BUFMAP_GFP_FLAGS);
+    sizes = (long *) kmalloc(max_new_nr_segs * sizeof(long),  
PVFS2_BUFMAP_GFP_F
      if (sizes == NULL)
      {
          kfree(new_iovec);
@@ -914,7 +914,7 @@
                  (unsigned long)(nr_segs * sizeof(*orig_xtvec)));
          return -ENOMEM;
      }
-    new_xtvec = kzalloc(max_new_nr_segs * sizeof(*new_xtvec),
+    new_xtvec = (struct xtvec *) kmalloc(max_new_nr_segs * sizeof 
(struct xtvec)
              PVFS2_BUFMAP_GFP_FLAGS);
      if (new_xtvec == NULL)
      {
@@ -923,7 +923,7 @@
                  (unsigned long)(max_new_nr_segs * sizeof 
(*new_xtvec)));
          return -ENOMEM;
      }
-    sizes = kzalloc(max_new_nr_segs * sizeof(*sizes),  
PVFS2_BUFMAP_GFP_FLAGS);
+    sizes = (long *) kmalloc(max_new_nr_segs * sizeof(long),  
PVFS2_BUFMAP_GFP_F
      if (sizes == NULL)
      {
          kfree(new_xtvec);
--- src/kernel/linux-2.6/pvfs2-bufmap.c.orig    2007-03-05  
09:19:40.000000000 -0
+++ src/kernel/linux-2.6/pvfs2-bufmap.c 2007-03-05 09:32:27.000000000  
-0600
@@ -50,7 +50,7 @@
          goto out;
      }
      err = -ENOMEM;
-    buffer_index_array = kzalloc(ndescs * sizeof(*buffer_index_array),
+    buffer_index_array = kmalloc(ndescs * sizeof(*buffer_index_array),
                                   PVFS2_BUFMAP_GFP_FLAGS);
      if (buffer_index_array == NULL)
      {



More information about the Pvfs2-developers mailing list