diff options
author | K. Y. Srinivasan <kys@microsoft.com> | 2014-12-16 16:21:42 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2015-01-09 09:44:25 -0500 |
commit | 2a09ed3d97ff8b5b377f86da9b9afd9ebd97b362 (patch) | |
tree | 347b76a531b20da79ba058cb6a7c66082de8f171 /drivers/scsi | |
parent | ead3700d893654d440edcb66fb3767a0c0db54cf (diff) |
storvsc: in responce to a scan event, scan the host
The virtual HBA that storvsc implements can support multiple channels and
targets. So, scan the host when the host notifies that a scan is needed.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/storvsc_drv.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 14ee98edeed1..ab0bb98239b0 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c | |||
@@ -410,21 +410,16 @@ done: | |||
410 | kfree(wrk); | 410 | kfree(wrk); |
411 | } | 411 | } |
412 | 412 | ||
413 | static void storvsc_bus_scan(struct work_struct *work) | 413 | static void storvsc_host_scan(struct work_struct *work) |
414 | { | 414 | { |
415 | struct storvsc_scan_work *wrk; | 415 | struct storvsc_scan_work *wrk; |
416 | int id, order_id; | 416 | struct Scsi_Host *host; |
417 | 417 | ||
418 | wrk = container_of(work, struct storvsc_scan_work, work); | 418 | wrk = container_of(work, struct storvsc_scan_work, work); |
419 | for (id = 0; id < wrk->host->max_id; ++id) { | 419 | host = wrk->host; |
420 | if (wrk->host->reverse_ordering) | 420 | |
421 | order_id = wrk->host->max_id - id - 1; | 421 | scsi_scan_host(host); |
422 | else | 422 | |
423 | order_id = id; | ||
424 | |||
425 | scsi_scan_target(&wrk->host->shost_gendev, 0, | ||
426 | order_id, SCAN_WILD_CARD, 1); | ||
427 | } | ||
428 | kfree(wrk); | 423 | kfree(wrk); |
429 | } | 424 | } |
430 | 425 | ||
@@ -1173,7 +1168,7 @@ static void storvsc_on_receive(struct hv_device *device, | |||
1173 | if (!work) | 1168 | if (!work) |
1174 | return; | 1169 | return; |
1175 | 1170 | ||
1176 | INIT_WORK(&work->work, storvsc_bus_scan); | 1171 | INIT_WORK(&work->work, storvsc_host_scan); |
1177 | work->host = stor_device->host; | 1172 | work->host = stor_device->host; |
1178 | schedule_work(&work->work); | 1173 | schedule_work(&work->work); |
1179 | break; | 1174 | break; |