[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>
Этот коммит содержится в:

коммит произвёл
James Bottomley

родитель
dacee84b07
Коммит
0b95067238
@@ -1289,14 +1289,14 @@ struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel,
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
get_device(&starget->dev);
|
||||
down(&shost->scan_mutex);
|
||||
mutex_lock(&shost->scan_mutex);
|
||||
if (scsi_host_scan_allowed(shost)) {
|
||||
res = scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1,
|
||||
hostdata);
|
||||
if (res != SCSI_SCAN_LUN_PRESENT)
|
||||
sdev = ERR_PTR(-ENODEV);
|
||||
}
|
||||
up(&shost->scan_mutex);
|
||||
mutex_unlock(&shost->scan_mutex);
|
||||
scsi_target_reap(starget);
|
||||
put_device(&starget->dev);
|
||||
|
||||
@@ -1404,10 +1404,10 @@ void scsi_scan_target(struct device *parent, unsigned int channel,
|
||||
{
|
||||
struct Scsi_Host *shost = dev_to_shost(parent);
|
||||
|
||||
down(&shost->scan_mutex);
|
||||
mutex_lock(&shost->scan_mutex);
|
||||
if (scsi_host_scan_allowed(shost))
|
||||
__scsi_scan_target(parent, channel, id, lun, rescan);
|
||||
up(&shost->scan_mutex);
|
||||
mutex_unlock(&shost->scan_mutex);
|
||||
}
|
||||
EXPORT_SYMBOL(scsi_scan_target);
|
||||
|
||||
@@ -1454,7 +1454,7 @@ int scsi_scan_host_selected(struct Scsi_Host *shost, unsigned int channel,
|
||||
((lun != SCAN_WILD_CARD) && (lun > shost->max_lun)))
|
||||
return -EINVAL;
|
||||
|
||||
down(&shost->scan_mutex);
|
||||
mutex_lock(&shost->scan_mutex);
|
||||
if (scsi_host_scan_allowed(shost)) {
|
||||
if (channel == SCAN_WILD_CARD)
|
||||
for (channel = 0; channel <= shost->max_channel;
|
||||
@@ -1464,7 +1464,7 @@ int scsi_scan_host_selected(struct Scsi_Host *shost, unsigned int channel,
|
||||
else
|
||||
scsi_scan_channel(shost, channel, id, lun, rescan);
|
||||
}
|
||||
up(&shost->scan_mutex);
|
||||
mutex_unlock(&shost->scan_mutex);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1522,7 +1522,7 @@ struct scsi_device *scsi_get_host_dev(struct Scsi_Host *shost)
|
||||
struct scsi_device *sdev = NULL;
|
||||
struct scsi_target *starget;
|
||||
|
||||
down(&shost->scan_mutex);
|
||||
mutex_lock(&shost->scan_mutex);
|
||||
if (!scsi_host_scan_allowed(shost))
|
||||
goto out;
|
||||
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)
|
||||
}
|
||||
put_device(&starget->dev);
|
||||
out:
|
||||
up(&shost->scan_mutex);
|
||||
mutex_unlock(&shost->scan_mutex);
|
||||
return sdev;
|
||||
}
|
||||
EXPORT_SYMBOL(scsi_get_host_dev);
|
||||
|
Ссылка в новой задаче
Block a user