aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_scan.c')
-rw-r--r--drivers/scsi/scsi_scan.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 18486b51668d..66505bb79410 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -32,6 +32,7 @@
32#include <linux/delay.h> 32#include <linux/delay.h>
33#include <linux/kthread.h> 33#include <linux/kthread.h>
34#include <linux/spinlock.h> 34#include <linux/spinlock.h>
35#include <linux/async.h>
35 36
36#include <scsi/scsi.h> 37#include <scsi/scsi.h>
37#include <scsi/scsi_cmnd.h> 38#include <scsi/scsi_cmnd.h>
@@ -179,6 +180,8 @@ int scsi_complete_async_scans(void)
179 spin_unlock(&async_scan_lock); 180 spin_unlock(&async_scan_lock);
180 181
181 kfree(data); 182 kfree(data);
183 /* Synchronize async operations globally */
184 async_synchronize_full();
182 return 0; 185 return 0;
183} 186}
184 187
@@ -411,8 +414,7 @@ static struct scsi_target *scsi_alloc_target(struct device *parent,
411 device_initialize(dev); 414 device_initialize(dev);
412 starget->reap_ref = 1; 415 starget->reap_ref = 1;
413 dev->parent = get_device(parent); 416 dev->parent = get_device(parent);
414 sprintf(dev->bus_id, "target%d:%d:%d", 417 dev_set_name(dev, "target%d:%d:%d", shost->host_no, channel, id);
415 shost->host_no, channel, id);
416#ifndef CONFIG_SYSFS_DEPRECATED 418#ifndef CONFIG_SYSFS_DEPRECATED
417 dev->bus = &scsi_bus_type; 419 dev->bus = &scsi_bus_type;
418#endif 420#endif
@@ -1021,7 +1023,7 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget,
1021 if (rescan || !scsi_device_created(sdev)) { 1023 if (rescan || !scsi_device_created(sdev)) {
1022 SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO 1024 SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO
1023 "scsi scan: device exists on %s\n", 1025 "scsi scan: device exists on %s\n",
1024 sdev->sdev_gendev.bus_id)); 1026 dev_name(&sdev->sdev_gendev)));
1025 if (sdevp) 1027 if (sdevp)
1026 *sdevp = sdev; 1028 *sdevp = sdev;
1027 else 1029 else
@@ -1160,7 +1162,7 @@ static void scsi_sequential_lun_scan(struct scsi_target *starget,
1160 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 1162 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
1161 1163
1162 SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO "scsi scan: Sequential scan of" 1164 SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO "scsi scan: Sequential scan of"
1163 "%s\n", starget->dev.bus_id)); 1165 "%s\n", dev_name(&starget->dev)));
1164 1166
1165 max_dev_lun = min(max_scsi_luns, shost->max_lun); 1167 max_dev_lun = min(max_scsi_luns, shost->max_lun);
1166 /* 1168 /*