]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
storvsc: in responce to a scan event, scan the host
authorK. Y. Srinivasan <kys@microsoft.com>
Tue, 16 Dec 2014 21:21:42 +0000 (13:21 -0800)
committerChristoph Hellwig <hch@lst.de>
Fri, 9 Jan 2015 14:44:25 +0000 (15:44 +0100)
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>
drivers/scsi/storvsc_drv.c

index 14ee98edeed15357384fc4423c849c5cdbe4c578..ab0bb98239b0d921bf01aae5e62b34589d5e4556 100644 (file)
@@ -410,21 +410,16 @@ done:
        kfree(wrk);
 }
 
-static void storvsc_bus_scan(struct work_struct *work)
+static void storvsc_host_scan(struct work_struct *work)
 {
        struct storvsc_scan_work *wrk;
-       int id, order_id;
+       struct Scsi_Host *host;
 
        wrk = container_of(work, struct storvsc_scan_work, work);
-       for (id = 0; id < wrk->host->max_id; ++id) {
-               if (wrk->host->reverse_ordering)
-                       order_id = wrk->host->max_id - id - 1;
-               else
-                       order_id = id;
-
-               scsi_scan_target(&wrk->host->shost_gendev, 0,
-                               order_id, SCAN_WILD_CARD, 1);
-       }
+       host = wrk->host;
+
+       scsi_scan_host(host);
+
        kfree(wrk);
 }
 
@@ -1173,7 +1168,7 @@ static void storvsc_on_receive(struct hv_device *device,
                if (!work)
                        return;
 
-               INIT_WORK(&work->work, storvsc_bus_scan);
+               INIT_WORK(&work->work, storvsc_host_scan);
                work->host = stor_device->host;
                schedule_work(&work->work);
                break;