aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_scan.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@infradead.org>2006-01-11 07:16:10 -0500
committerJames Bottomley <jejb@mulgrave.(none)>2006-01-12 12:53:11 -0500
commit0b9506723826c68b50fa33e345700ddcac1bed36 (patch)
treeda3e432ef4517c47ebdc088c6322d0ac51193127 /drivers/scsi/scsi_scan.c
parentdacee84b070c4e705a5b6446f1f0a6a6e2f8d7a4 (diff)
[SCSI] turn most scsi semaphores into mutexes
the scsi layer is using semaphores in a mutex way, this patch converts these into using mutexes instead Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_scan.c')
-rw-r--r--drivers/scsi/scsi_scan.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 05ebb9cef961..edcd80b749c1 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -1289,14 +1289,14 @@ struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel,
1289 return ERR_PTR(-ENOMEM); 1289 return ERR_PTR(-ENOMEM);
1290 1290
1291 get_device(&starget->dev); 1291 get_device(&starget->dev);
1292 down(&shost->scan_mutex); 1292 mutex_lock(&shost->scan_mutex);
1293 if (scsi_host_scan_allowed(shost)) { 1293 if (scsi_host_scan_allowed(shost)) {
1294 res = scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1, 1294 res = scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1,
1295 hostdata); 1295 hostdata);
1296 if (res != SCSI_SCAN_LUN_PRESENT) 1296 if (res != SCSI_SCAN_LUN_PRESENT)
1297 sdev = ERR_PTR(-ENODEV); 1297 sdev = ERR_PTR(-ENODEV);
1298 } 1298 }
1299 up(&shost->scan_mutex); 1299 mutex_unlock(&shost->scan_mutex);
1300 scsi_target_reap(starget); 1300 scsi_target_reap(starget);
1301 put_device(&starget->dev); 1301 put_device(&starget->dev);
1302 1302
@@ -1404,10 +1404,10 @@ void scsi_scan_target(struct device *parent, unsigned int channel,
1404{ 1404{
1405 struct Scsi_Host *shost = dev_to_shost(parent); 1405 struct Scsi_Host *shost = dev_to_shost(parent);
1406 1406
1407 down(&shost->scan_mutex); 1407 mutex_lock(&shost->scan_mutex);
1408 if (scsi_host_scan_allowed(shost)) 1408 if (scsi_host_scan_allowed(shost))
1409 __scsi_scan_target(parent, channel, id, lun, rescan); 1409 __scsi_scan_target(parent, channel, id, lun, rescan);
1410 up(&shost->scan_mutex); 1410 mutex_unlock(&shost->scan_mutex);
1411} 1411}
1412EXPORT_SYMBOL(scsi_scan_target); 1412EXPORT_SYMBOL(scsi_scan_target);
1413 1413
@@ -1454,7 +1454,7 @@ int scsi_scan_host_selected(struct Scsi_Host *shost, unsigned int channel,
1454 ((lun != SCAN_WILD_CARD) && (lun > shost->max_lun))) 1454 ((lun != SCAN_WILD_CARD) && (lun > shost->max_lun)))
1455 return -EINVAL; 1455 return -EINVAL;
1456 1456
1457 down(&shost->scan_mutex); 1457 mutex_lock(&shost->scan_mutex);
1458 if (scsi_host_scan_allowed(shost)) { 1458 if (scsi_host_scan_allowed(shost)) {
1459 if (channel == SCAN_WILD_CARD) 1459 if (channel == SCAN_WILD_CARD)
1460 for (channel = 0; channel <= shost->max_channel; 1460 for (channel = 0; channel <= shost->max_channel;
@@ -1464,7 +1464,7 @@ int scsi_scan_host_selected(struct Scsi_Host *shost, unsigned int channel,
1464 else 1464 else
1465 scsi_scan_channel(shost, channel, id, lun, rescan); 1465 scsi_scan_channel(shost, channel, id, lun, rescan);
1466 } 1466 }
1467 up(&shost->scan_mutex); 1467 mutex_unlock(&shost->scan_mutex);
1468 1468
1469 return 0; 1469 return 0;
1470} 1470}
@@ -1522,7 +1522,7 @@ struct scsi_device *scsi_get_host_dev(struct Scsi_Host *shost)
1522 struct scsi_device *sdev = NULL; 1522 struct scsi_device *sdev = NULL;
1523 struct scsi_target *starget; 1523 struct scsi_target *starget;
1524 1524
1525 down(&shost->scan_mutex); 1525 mutex_lock(&shost->scan_mutex);
1526 if (!scsi_host_scan_allowed(shost)) 1526 if (!scsi_host_scan_allowed(shost))
1527 goto out; 1527 goto out;
1528 starget = scsi_alloc_target(&shost->shost_gendev, 0, shost->this_id); 1528 starget = scsi_alloc_target(&shost->shost_gendev, 0, shost->this_id);
@@ -1536,7 +1536,7 @@ struct scsi_device *scsi_get_host_dev(struct Scsi_Host *shost)
1536 } 1536 }
1537 put_device(&starget->dev); 1537 put_device(&starget->dev);
1538 out: 1538 out:
1539 up(&shost->scan_mutex); 1539 mutex_unlock(&shost->scan_mutex);
1540 return sdev; 1540 return sdev;
1541} 1541}
1542EXPORT_SYMBOL(scsi_get_host_dev); 1542EXPORT_SYMBOL(scsi_get_host_dev);