[REVERT] 2.5.21 s390/block/xpram.c

From: Martin Dalecki (dalecki@evision-ventures.com)
Date: Mon Jun 10 2002 - 06:59:58 EST


During the course of the patch-2.5.21 I noticed the
following attached chunk, which resurrect hardsects array in the
affected code. This is of course entierly bogous.
Please revert this chunk, since it's most propably just
a merge error on behalf of the Big Blue.

Oh well oh well...

diff -Nru a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c
--- a/drivers/s390/block/xpram.c Sat Jun 8 22:31:51 2002
+++ b/drivers/s390/block/xpram.c Sat Jun 8 22:31:51 2002
@@ -158,6 +158,7 @@
 /* The following items are obtained through kmalloc() in init_module() */
 
 Xpram_Dev *xpram_devices = NULL;
+int *xpram_hardsects = NULL;
 int *xpram_offsets = NULL; /* partition offsets */
 
 #define MIN(x,y) ((x) < (y) ? (x) : (y))
@@ -938,7 +939,6 @@
 
         q = BLK_DEFAULT_QUEUE(major);
         blk_init_queue (q, xpram_request);
- blk_queue_hardsect_size(q, xpram_hardsect);
 
         /* we want to have XPRAM_UNUSED blocks security buffer between devices */
         mem_usable=xpram_mem_avail-(XPRAM_UNUSED*(xpram_devs-1));
@@ -978,6 +978,16 @@
                 PRINT_DEBUG(" device(%d) offset = %d kB, size = %d kB\n",i, xpram_offsets[i], xpram_sizes[i]);
 #endif
 
+ xpram_hardsects = kmalloc(xpram_devs * sizeof(int), GFP_KERNEL);
+ if (!xpram_hardsects) {
+ PRINT_ERR("Not enough memory for xpram_hardsects\n");
+ PRINT_ERR("Giving up xpram\n");
+ goto fail_malloc_hardsects;
+ }
+ for (i=0; i < xpram_devs; i++) /* all the same hardsect */
+ xpram_hardsects[i] = xpram_hardsect;
+ hardsect_size[major]=xpram_hardsects;
+
         /*
          * allocate the devices -- we can't have them static, as the number
          * can be specified at load time
@@ -1030,6 +1040,7 @@
                   goto fail_devfs_register;
                 }
 #endif /* WHY? */
+
         }
 
         return 0; /* succeed */
@@ -1042,7 +1053,10 @@
         }
         kfree(xpram_devices);
         kfree (xpram_offsets);
+ fail_malloc_hardsects:
  fail_malloc_devices:
+ kfree(xpram_hardsects);
+ hardsect_size[major] = NULL;
  fail_malloc:
         /* ??? unregister_chrdev(major, "xpram"); */
         unregister_blkdev(major, "xpram");
@@ -1072,6 +1086,7 @@
         int i;
 
         /* first of all, reset all the data structures */
+ kfree(hardsect_size[major]);
         kfree(xpram_offsets);
         blk_clear(major);
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jun 15 2002 - 22:00:17 EST