diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-03-22 22:42:27 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-04-22 15:16:31 -0500 |
commit | 643eb2d932c97a0583381629d632d486934cf7ee (patch) | |
tree | 514d860d8b6c22f50b8fdd7afd25047707321650 /include/scsi/scsi_device.h | |
parent | f7120a4f75168df3c02efacd10403a4ba0bcb29d (diff) | |
download | blackbird-op-linux-643eb2d932c97a0583381629d632d486934cf7ee.tar.gz blackbird-op-linux-643eb2d932c97a0583381629d632d486934cf7ee.zip |
[SCSI] rework scsi_target allocation
The current target allocation code registeres each possible target
with sysfs; it will be deleted again if no useable LUN on this target
was found. This results in a string of 'target add/target remove' uevents.
Based on a patch by Hannes Reinecke <hare@suse.de> this patch reworks
the target allocation code so that only uevents for existing targets
are sent. The sysfs registration is split off from the existing
scsi_target_alloc() into a in a new scsi_add_target() function, which
should be called whenever an existing target is found. Only then a
uevent is sent, so we'll be generating events for existing targets
only.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'include/scsi/scsi_device.h')
-rw-r--r-- | include/scsi/scsi_device.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index b8b19e2f57bb..f6a9fe0ef09c 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -181,7 +181,8 @@ struct scsi_device { sdev_printk(prefix, (scmd)->device, fmt, ##a) enum scsi_target_state { - STARGET_RUNNING = 1, + STARGET_CREATED = 1, + STARGET_RUNNING, STARGET_DEL, }; |