提交 d9ed6947 编写于 作者: R Roland Dreier 提交者: Nicholas Bellinger

target: Clean up logic in transport_put_cmd()

No need to have a goto where a return is clearer.
Signed-off-by: NRoland Dreier <roland@purestorage.com>
Signed-off-by: NNicholas Bellinger <nab@risingtidesystems.com>
上级 06e97b48
...@@ -1966,9 +1966,10 @@ static void transport_put_cmd(struct se_cmd *cmd) ...@@ -1966,9 +1966,10 @@ static void transport_put_cmd(struct se_cmd *cmd)
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&cmd->t_state_lock, flags); spin_lock_irqsave(&cmd->t_state_lock, flags);
if (atomic_read(&cmd->t_fe_count)) { if (atomic_read(&cmd->t_fe_count) &&
if (!atomic_dec_and_test(&cmd->t_fe_count)) !atomic_dec_and_test(&cmd->t_fe_count)) {
goto out_busy; spin_unlock_irqrestore(&cmd->t_state_lock, flags);
return;
} }
if (cmd->transport_state & CMD_T_DEV_ACTIVE) { if (cmd->transport_state & CMD_T_DEV_ACTIVE) {
...@@ -1980,8 +1981,6 @@ static void transport_put_cmd(struct se_cmd *cmd) ...@@ -1980,8 +1981,6 @@ static void transport_put_cmd(struct se_cmd *cmd)
transport_free_pages(cmd); transport_free_pages(cmd);
transport_release_cmd(cmd); transport_release_cmd(cmd);
return; return;
out_busy:
spin_unlock_irqrestore(&cmd->t_state_lock, flags);
} }
void *transport_kmap_data_sg(struct se_cmd *cmd) void *transport_kmap_data_sg(struct se_cmd *cmd)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册