Let's be safe and alway do barrier

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2580 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2010-11-03 13:05:15 +00:00
parent b259ba00f4
commit 88c09a9bb0
4 changed files with 6 additions and 8 deletions

View File

@@ -3705,7 +3705,7 @@ static struct scst_cmd *scst_create_prepare_internal_cmd(
scst_sess_get(res->sess);
if (res->tgt_dev != NULL)
__scst_get(0);
__scst_get();
res->state = SCST_CMD_STATE_PARSE;

View File

@@ -1970,7 +1970,7 @@ out_unlock:
*/
void scst_get(void)
{
__scst_get(0);
__scst_get();
}
EXPORT_SYMBOL(scst_get);

View File

@@ -579,15 +579,13 @@ static inline void scst_check_unblock_dev(struct scst_cmd *cmd)
return;
}
static inline void __scst_get(int barrier)
static inline void __scst_get(void)
{
atomic_inc(&scst_cmd_count);
TRACE_DBG("Incrementing scst_cmd_count(new value %d)",
atomic_read(&scst_cmd_count));
/* See comment about smp_mb() in scst_suspend_activity() */
if (barrier)
smp_mb__after_atomic_inc();
smp_mb__after_atomic_inc();
}
static inline void __scst_put(void)

View File

@@ -3695,7 +3695,7 @@ static int scst_translate_lun(struct scst_cmd *cmd)
TRACE_ENTRY();
/* See comment about smp_mb() in scst_suspend_activity() */
__scst_get(1);
__scst_get();
if (likely(!test_bit(SCST_FLAG_SUSPENDED, &scst_flags))) {
struct list_head *head =
@@ -4273,7 +4273,7 @@ static int scst_mgmt_translate_lun(struct scst_mgmt_cmd *mcmd)
(long long unsigned int)mcmd->lun);
/* See comment about smp_mb() in scst_suspend_activity() */
__scst_get(1);
__scst_get();
if (unlikely(test_bit(SCST_FLAG_SUSPENDED, &scst_flags) &&
!test_bit(SCST_FLAG_SUSPENDING, &scst_flags))) {