Merge of r946:

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/branches/1.0.1.x@956 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2009-07-14 16:59:42 +00:00
parent fc087e2be8
commit 60c6d77ae3
2 changed files with 16 additions and 7 deletions

View File

@@ -3413,6 +3413,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;
@@ -3446,7 +3447,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++) {
@@ -3519,8 +3525,6 @@ out_unlock:
}
local_bh_enable();
mutex_unlock(&scst_mutex);
spin_lock_bh(&cmd->tgt_dev->tgt_dev_lock);
}

View File

@@ -1448,7 +1448,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];
@@ -1510,7 +1513,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];
@@ -1537,7 +1543,6 @@ out_compl:
spin_unlock_bh(&tgt_dev->tgt_dev_lock);
}
}
mutex_unlock(&scst_mutex);
out_done:
/* Report the result */
@@ -1702,7 +1707,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;