target: Clean up logic in transport_put_cmd()
authorRoland Dreier <roland@purestorage.com>
Fri, 16 Nov 2012 16:06:18 +0000 (08:06 -0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Wed, 28 Nov 2012 06:49:18 +0000 (22:49 -0800)
No need to have a goto where a return is clearer.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@risingtidesystems.com>
drivers/target/target_core_transport.c

index 4b062c81727d7d5c64629039bd075324bc9ae35a..7e7fa58b56ea906655bae8c4b1db6908a4214ca9 100644 (file)
@@ -1966,9 +1966,10 @@ static void transport_put_cmd(struct se_cmd *cmd)
        unsigned long flags;
 
        spin_lock_irqsave(&cmd->t_state_lock, flags);
-       if (atomic_read(&cmd->t_fe_count)) {
-               if (!atomic_dec_and_test(&cmd->t_fe_count))
-                       goto out_busy;
+       if (atomic_read(&cmd->t_fe_count) &&
+           !atomic_dec_and_test(&cmd->t_fe_count)) {
+               spin_unlock_irqrestore(&cmd->t_state_lock, flags);
+               return;
        }
 
        if (cmd->transport_state & CMD_T_DEV_ACTIVE) {
@@ -1980,8 +1981,6 @@ static void transport_put_cmd(struct se_cmd *cmd)
        transport_free_pages(cmd);
        transport_release_cmd(cmd);
        return;
-out_busy:
-       spin_unlock_irqrestore(&cmd->t_state_lock, flags);
 }
 
 void *transport_kmap_data_sg(struct se_cmd *cmd)