Skip to contentSkip to conversation

get rid of global arrays in sd

PATCH New Christoph Hellwig 1 participant 1 message Oct 28, 2002 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 get rid of global arrays in sd

Okay, this is the final version of the sd patch to remove sd_dsk_arr. Instead of keeping a big global array we allocate one structure for each disk dynamically in sd_attach. We can use the higher level private data to access it almost everywhere, for the few other places we keep a linked list of all disks (these are walked only in slow-patheß).

This patch also allows to get rid of the sd_init midlayer method and the CONFIG_SD_EXTRA_DEVS option - sd has no more static limit to the number of disk except of the number of assigned majors.

drivers/scsi/Config.help +0 -13
@@ -34,19 +34,6 @@
   is located on a SCSI disk. In this case, do not compile the driver
   for your SCSI host adapter (below) as a module either.
 
-CONFIG_SD_EXTRA_DEVS
-  This controls the amount of additional space allocated in tables for
-  drivers that are loaded as modules after the kernel is booted.  In
-  the event that the SCSI core itself was loaded as a module, this
-  value is the number of additional disks that can be loaded after the
-  first host driver is loaded.
-
-  Admittedly this isn't pretty, but there are tons of race conditions
-  involved with resizing the internal arrays on the fly.  Someday this
-  flag will go away, and everything will work automatically.
-
-  If you don't understand what's going on, go with the default.
-
 CONFIG_CHR_DEV_ST
   If you want to use a SCSI tape drive under Linux, say Y and read the
   SCSI-HOWTO, available from
drivers/scsi/Config.in +0 -4
@@ -2,10 +2,6 @@
 
 dep_tristate '  SCSI disk support' CONFIG_BLK_DEV_SD $CONFIG_SCSI
 
-if [ "$CONFIG_BLK_DEV_SD" != "n" ]; then
-   int  'Maximum number of SCSI disks that can be loaded as modules' CONFIG_SD_EXTRA_DEVS 40
-fi
-
 dep_tristate '  SCSI tape support' CONFIG_CHR_DEV_ST $CONFIG_SCSI
 
 dep_tristate '  SCSI OnStream SC-x0 tape support' CONFIG_CHR_DEV_OSST $CONFIG_SCSI
drivers/scsi/hosts.h +0 -4
@@ -620,13 +620,9 @@
  * The generics driver has been updated to resize as required.  So as the tape
  * driver. Two down, two more to go.
  */
-#ifndef CONFIG_SD_EXTRA_DEVS
-#define CONFIG_SD_EXTRA_DEVS 2
-#endif
 #ifndef CONFIG_SR_EXTRA_DEVS
 #define CONFIG_SR_EXTRA_DEVS 2
 #endif
-#define SD_EXTRA_DEVS CONFIG_SD_EXTRA_DEVS
 #define SR_EXTRA_DEVS CONFIG_SR_EXTRA_DEVS
 
 
drivers/scsi/sd.c +112 -253

532 lines not on this page · raw message

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html