SCSI: add asynchronous event notification API
Originally based on a patch by Kristen Carlson Accardi @ Intel. Copious input from James Bottomley. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
This commit is contained in:
@@ -236,6 +236,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
|
||||
struct scsi_device *sdev;
|
||||
int display_failure_msg = 1, ret;
|
||||
struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
|
||||
extern void scsi_evt_thread(struct work_struct *work);
|
||||
|
||||
sdev = kzalloc(sizeof(*sdev) + shost->transportt->device_size,
|
||||
GFP_ATOMIC);
|
||||
@@ -254,7 +255,9 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
|
||||
INIT_LIST_HEAD(&sdev->same_target_siblings);
|
||||
INIT_LIST_HEAD(&sdev->cmd_list);
|
||||
INIT_LIST_HEAD(&sdev->starved_entry);
|
||||
INIT_LIST_HEAD(&sdev->event_list);
|
||||
spin_lock_init(&sdev->list_lock);
|
||||
INIT_WORK(&sdev->event_work, scsi_evt_thread);
|
||||
|
||||
sdev->sdev_gendev.parent = get_device(&starget->dev);
|
||||
sdev->sdev_target = starget;
|
||||
|
Reference in New Issue
Block a user