mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-22 05:01:27 +00:00
scst: Do not suspend command processing when deleting a device
Now that freeing a device only happens after all commands associated with the device have finished it is safe to not suspend command processing when deleting a device. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8067 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -1182,25 +1182,12 @@ static void scst_unregister_device(struct scsi_device *scsidp)
|
|||||||
{
|
{
|
||||||
struct scst_device *dev;
|
struct scst_device *dev;
|
||||||
struct scst_acg_dev *acg_dev, *aa;
|
struct scst_acg_dev *acg_dev, *aa;
|
||||||
bool activity_suspended = false;
|
|
||||||
|
|
||||||
TRACE_ENTRY();
|
TRACE_ENTRY();
|
||||||
|
|
||||||
mutex_lock(&scst_mutex);
|
mutex_lock(&scst_mutex);
|
||||||
|
|
||||||
dev = __scst_lookup_device(scsidp);
|
dev = __scst_lookup_device(scsidp);
|
||||||
|
|
||||||
if (dev &&
|
|
||||||
(!list_empty(&dev->dev_tgt_dev_list) ||
|
|
||||||
!list_empty(&dev->dev_acg_dev_list))) {
|
|
||||||
mutex_unlock(&scst_mutex);
|
|
||||||
|
|
||||||
scst_suspend_activity(SCST_SUSPEND_TIMEOUT_UNLIMITED);
|
|
||||||
activity_suspended = true;
|
|
||||||
mutex_lock(&scst_mutex);
|
|
||||||
dev = __scst_lookup_device(scsidp);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dev == NULL) {
|
if (dev == NULL) {
|
||||||
PRINT_ERROR("SCST device for SCSI device %d:%d:%d:%lld not found",
|
PRINT_ERROR("SCST device for SCSI device %d:%d:%d:%lld not found",
|
||||||
scsidp->host->host_no, scsidp->channel, scsidp->id,
|
scsidp->host->host_no, scsidp->channel, scsidp->id,
|
||||||
@@ -1225,9 +1212,6 @@ static void scst_unregister_device(struct scsi_device *scsidp)
|
|||||||
|
|
||||||
mutex_unlock(&scst_mutex);
|
mutex_unlock(&scst_mutex);
|
||||||
|
|
||||||
if (activity_suspended)
|
|
||||||
scst_resume_activity();
|
|
||||||
|
|
||||||
scst_dev_sysfs_del(dev);
|
scst_dev_sysfs_del(dev);
|
||||||
|
|
||||||
PRINT_INFO("Detached from scsi%d, channel %d, id %d, lun %lld, type %d",
|
PRINT_INFO("Detached from scsi%d, channel %d, id %d, lun %lld, type %d",
|
||||||
@@ -1242,8 +1226,6 @@ out:
|
|||||||
|
|
||||||
out_unlock:
|
out_unlock:
|
||||||
mutex_unlock(&scst_mutex);
|
mutex_unlock(&scst_mutex);
|
||||||
if (activity_suspended)
|
|
||||||
scst_resume_activity();
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user