Commit ea3bedb6 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by James Bottomley

[PATCH] 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.
parent 8159b141
......@@ -34,19 +34,6 @@ CONFIG_BLK_DEV_SD
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
......
......@@ -2,10 +2,6 @@ comment 'SCSI support type (disk, tape, CD-ROM)'
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
......
......@@ -620,13 +620,9 @@ extern void scsi_host_failed_inc_and_test(struct Scsi_Host *);
* 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
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment