Removes unneeded mutex_lock(&scst_mutex), which can't be done on atomic or SIRQ context

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@946 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2009-07-10 11:56:51 +00:00
parent 63b86adb27
commit 87f2720490
2 changed files with 16 additions and 7 deletions
+7 -3
View File
@@ -3532,6 +3532,7 @@ void scst_process_reset(struct scst_device *dev,
return;
}
/* No locks, no IRQ or IRQ-disabled context allowed */
int scst_set_pending_UA(struct scst_cmd *cmd)
{
int res = 0, i;
@@ -3565,7 +3566,12 @@ again:
spin_unlock_bh(&cmd->tgt_dev->tgt_dev_lock);
mutex_lock(&scst_mutex);
/*
* cmd won't allow to suspend activities, so we can access
* sess->sess_tgt_dev_list_hash without any additional
* protection.
*/
local_bh_disable();
for (i = 0; i < TGT_DEV_HASH_SIZE; i++) {
@@ -3638,8 +3644,6 @@ out_unlock:
}
local_bh_enable();
mutex_unlock(&scst_mutex);
spin_lock_bh(&cmd->tgt_dev->tgt_dev_lock);
}
+9 -4
View File
@@ -1450,7 +1450,10 @@ static int scst_report_luns_local(struct scst_cmd *cmd)
memset(buffer, 0, buffer_size);
offs = 8;
/* sess->sess_tgt_dev_list_hash is protected by suspended activity */
/*
* cmd won't allow to suspend activities, so we can access
* sess->sess_tgt_dev_list_hash without any additional protection.
*/
for (i = 0; i < TGT_DEV_HASH_SIZE; i++) {
struct list_head *sess_tgt_dev_list_head =
&cmd->sess->sess_tgt_dev_list_hash[i];
@@ -1512,7 +1515,10 @@ out_compl:
/* Clear left sense_reported_luns_data_changed UA, if any. */
mutex_lock(&scst_mutex); /* protect sess_tgt_dev_list_hash */
/*
* cmd won't allow to suspend activities, so we can access
* sess->sess_tgt_dev_list_hash without any additional protection.
*/
for (i = 0; i < TGT_DEV_HASH_SIZE; i++) {
struct list_head *sess_tgt_dev_list_head =
&cmd->sess->sess_tgt_dev_list_hash[i];
@@ -1539,7 +1545,6 @@ out_compl:
spin_unlock_bh(&tgt_dev->tgt_dev_lock);
}
}
mutex_unlock(&scst_mutex);
out_done:
/* Report the result */
@@ -1802,7 +1807,7 @@ out_done:
goto out;
}
/* No locks, no IRQ or IRQ-safe context allowed */
/* No locks, no IRQ or IRQ-disabled context allowed */
int scst_check_local_events(struct scst_cmd *cmd)
{
int res, rc;