mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 02:31:27 +00:00
scst: Do not suspend SCSI command processing when adding a device
Since the only global data structure that is modified by the code that adds a device (scst_dev_list) is consistently protected by scst_mutex, suspending command processing when adding a device is not necessary. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8025 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -2547,7 +2547,6 @@ out:
|
||||
return res;
|
||||
}
|
||||
|
||||
/* scst_mutex supposed to be held and activities suspended */
|
||||
static int scst_cm_dev_register(struct scst_device *dev, uint64_t lun)
|
||||
{
|
||||
int res, i;
|
||||
@@ -2556,7 +2555,6 @@ static int scst_cm_dev_register(struct scst_device *dev, uint64_t lun)
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
scst_assert_activity_suspended();
|
||||
lockdep_assert_held(&scst_mutex);
|
||||
|
||||
TRACE_DBG("dev %s, LUN %ld", dev->virt_name, (unsigned long)lun);
|
||||
@@ -2709,14 +2707,12 @@ out_unblock:
|
||||
goto out_resume;
|
||||
}
|
||||
|
||||
/* scst_mutex supposed to be held and activities suspended */
|
||||
int scst_cm_on_dev_register(struct scst_device *dev)
|
||||
{
|
||||
int res = 0;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
scst_assert_activity_suspended();
|
||||
lockdep_assert_held(&scst_mutex);
|
||||
|
||||
if (!scst_auto_cm_assignment || !dev->handler->auto_cm_assignment_possible)
|
||||
|
||||
@@ -4181,15 +4181,15 @@ static int scst_dif_none_type1(struct scst_cmd *cmd);
|
||||
#define scst_dif_none_type1 scst_dif_none
|
||||
#endif
|
||||
|
||||
/* Called under scst_mutex and suspended activity */
|
||||
int scst_alloc_device(gfp_t gfp_mask, int nodeid,
|
||||
struct scst_device **out_dev)
|
||||
int scst_alloc_device(gfp_t gfp_mask, int nodeid, struct scst_device **out_dev)
|
||||
{
|
||||
struct scst_device *dev;
|
||||
int res = 0;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
lockdep_assert_held(&scst_mutex);
|
||||
|
||||
dev = kmem_cache_alloc_node(scst_dev_cachep, gfp_mask, nodeid);
|
||||
if (dev == NULL) {
|
||||
PRINT_ERROR("%s", "Allocation of scst_device failed");
|
||||
|
||||
@@ -1347,10 +1347,6 @@ int scst_register_virtual_device_node(struct scst_dev_type *dev_handler,
|
||||
if (res != 0)
|
||||
goto out;
|
||||
|
||||
res = scst_suspend_activity(SCST_SUSPEND_TIMEOUT_USER);
|
||||
if (res != 0)
|
||||
goto out;
|
||||
|
||||
res = mutex_lock_interruptible(&scst_mutex);
|
||||
if (res != 0)
|
||||
goto out_resume;
|
||||
@@ -1419,7 +1415,6 @@ int scst_register_virtual_device_node(struct scst_dev_type *dev_handler,
|
||||
goto out_unreg;
|
||||
|
||||
mutex_unlock(&scst_mutex);
|
||||
scst_resume_activity();
|
||||
|
||||
res = dev->virt_id;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user