mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
target/iscsi: Remove unneeded locking from iscsi_target_tx_thread
When processing immediate queue, we're switching on a local variable so it's not necessary to lock around it. However, we are modifying cmd->i_state in two spots, so lock around those parts only. Signed-off-by: Andy Grover <agrover@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
This commit is contained in:
parent
c6037cc546
commit
4580cf3848
@ -3516,15 +3516,11 @@ restart:
|
|||||||
state = qr->state;
|
state = qr->state;
|
||||||
kmem_cache_free(lio_qr_cache, qr);
|
kmem_cache_free(lio_qr_cache, qr);
|
||||||
|
|
||||||
spin_lock_bh(&cmd->istate_lock);
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case ISTATE_SEND_R2T:
|
case ISTATE_SEND_R2T:
|
||||||
spin_unlock_bh(&cmd->istate_lock);
|
|
||||||
ret = iscsit_send_r2t(cmd, conn);
|
ret = iscsit_send_r2t(cmd, conn);
|
||||||
break;
|
break;
|
||||||
case ISTATE_REMOVE:
|
case ISTATE_REMOVE:
|
||||||
spin_unlock_bh(&cmd->istate_lock);
|
|
||||||
|
|
||||||
if (cmd->data_direction == DMA_TO_DEVICE)
|
if (cmd->data_direction == DMA_TO_DEVICE)
|
||||||
iscsit_stop_dataout_timer(cmd);
|
iscsit_stop_dataout_timer(cmd);
|
||||||
|
|
||||||
@ -3535,13 +3531,11 @@ restart:
|
|||||||
iscsit_free_cmd(cmd);
|
iscsit_free_cmd(cmd);
|
||||||
continue;
|
continue;
|
||||||
case ISTATE_SEND_NOPIN_WANT_RESPONSE:
|
case ISTATE_SEND_NOPIN_WANT_RESPONSE:
|
||||||
spin_unlock_bh(&cmd->istate_lock);
|
|
||||||
iscsit_mod_nopin_response_timer(conn);
|
iscsit_mod_nopin_response_timer(conn);
|
||||||
ret = iscsit_send_unsolicited_nopin(cmd,
|
ret = iscsit_send_unsolicited_nopin(cmd,
|
||||||
conn, 1);
|
conn, 1);
|
||||||
break;
|
break;
|
||||||
case ISTATE_SEND_NOPIN_NO_RESPONSE:
|
case ISTATE_SEND_NOPIN_NO_RESPONSE:
|
||||||
spin_unlock_bh(&cmd->istate_lock);
|
|
||||||
ret = iscsit_send_unsolicited_nopin(cmd,
|
ret = iscsit_send_unsolicited_nopin(cmd,
|
||||||
conn, 0);
|
conn, 0);
|
||||||
break;
|
break;
|
||||||
@ -3550,7 +3544,6 @@ restart:
|
|||||||
" 0x%08x, i_state: %d on CID: %hu\n",
|
" 0x%08x, i_state: %d on CID: %hu\n",
|
||||||
cmd->iscsi_opcode, cmd->init_task_tag, state,
|
cmd->iscsi_opcode, cmd->init_task_tag, state,
|
||||||
conn->cid);
|
conn->cid);
|
||||||
spin_unlock_bh(&cmd->istate_lock);
|
|
||||||
goto transport_err;
|
goto transport_err;
|
||||||
}
|
}
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@ -3561,19 +3554,19 @@ restart:
|
|||||||
goto transport_err;
|
goto transport_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_lock_bh(&cmd->istate_lock);
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case ISTATE_SEND_R2T:
|
case ISTATE_SEND_R2T:
|
||||||
spin_unlock_bh(&cmd->istate_lock);
|
|
||||||
spin_lock_bh(&cmd->dataout_timeout_lock);
|
spin_lock_bh(&cmd->dataout_timeout_lock);
|
||||||
iscsit_start_dataout_timer(cmd, conn);
|
iscsit_start_dataout_timer(cmd, conn);
|
||||||
spin_unlock_bh(&cmd->dataout_timeout_lock);
|
spin_unlock_bh(&cmd->dataout_timeout_lock);
|
||||||
break;
|
break;
|
||||||
case ISTATE_SEND_NOPIN_WANT_RESPONSE:
|
case ISTATE_SEND_NOPIN_WANT_RESPONSE:
|
||||||
|
spin_lock_bh(&cmd->istate_lock);
|
||||||
cmd->i_state = ISTATE_SENT_NOPIN_WANT_RESPONSE;
|
cmd->i_state = ISTATE_SENT_NOPIN_WANT_RESPONSE;
|
||||||
spin_unlock_bh(&cmd->istate_lock);
|
spin_unlock_bh(&cmd->istate_lock);
|
||||||
break;
|
break;
|
||||||
case ISTATE_SEND_NOPIN_NO_RESPONSE:
|
case ISTATE_SEND_NOPIN_NO_RESPONSE:
|
||||||
|
spin_lock_bh(&cmd->istate_lock);
|
||||||
cmd->i_state = ISTATE_SENT_STATUS;
|
cmd->i_state = ISTATE_SENT_STATUS;
|
||||||
spin_unlock_bh(&cmd->istate_lock);
|
spin_unlock_bh(&cmd->istate_lock);
|
||||||
break;
|
break;
|
||||||
@ -3582,7 +3575,6 @@ restart:
|
|||||||
" 0x%08x, i_state: %d on CID: %hu\n",
|
" 0x%08x, i_state: %d on CID: %hu\n",
|
||||||
cmd->iscsi_opcode, cmd->init_task_tag,
|
cmd->iscsi_opcode, cmd->init_task_tag,
|
||||||
state, conn->cid);
|
state, conn->cid);
|
||||||
spin_unlock_bh(&cmd->istate_lock);
|
|
||||||
goto transport_err;
|
goto transport_err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user