Re: [PATCH 6/6] target: push session reinstatement out of transport_generic_free_cmd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2011-09-13 at 23:09 +0200, Christoph Hellwig wrote:
> Push session reinstatement out of transport_generic_free_cmd into the only
> caller that actually needs it.  Clean up transport_generic_free_cmd a bit,
> and remove the useless comment.  I'd love to add a more useful kerneldoc
> comment for it, but as this point I'm still a bit confused in where it
> stands in the command release stack.
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> 

After taking another look at the 'session_reinstatement' bit, I think
it's legacy cruft for iscsi-target, and it's safe to drop it entirely.

Along with your original series, i'm including the following patch.

Thanks,

commit a10d32e2a2d86557de9ed88a78f5b537fac3bc9f
Author: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
Date:   Sat Oct 8 13:59:52 2011 -0700

    target: Remove session_reinstatement parameter from ->transport_wait_for_tasks
    
    This patch removes the unnecessary session_reinstatement parameter from
    se_cmd->transport_wait_for_tasks(), logic in transport_generic_wait_for_tasks,
    and usage within iscsi-target code.
    
    Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>

diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 7dc2cfe..354a833 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -3960,7 +3960,7 @@ static void iscsit_release_commands_from_conn(struct iscsi_conn *conn)
                         * iscsit_get_lun_for_cmd() in iscsit_handle_scsi_cmd().
                         */
                        if (cmd->tmr_req && se_cmd->transport_wait_for_tasks)
-                               se_cmd->transport_wait_for_tasks(se_cmd, 1, 1);
+                               se_cmd->transport_wait_for_tasks(se_cmd, 1);
                        else if (cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD)
                                transport_release_cmd(se_cmd);
                        else
@@ -3976,7 +3976,7 @@ static void iscsit_release_commands_from_conn(struct iscsi_conn *conn)
                se_cmd = &cmd->se_cmd;
 
                if (se_cmd->transport_wait_for_tasks)
-                       se_cmd->transport_wait_for_tasks(se_cmd, 1, 1);
+                       se_cmd->transport_wait_for_tasks(se_cmd, 1);
 
                spin_lock_bh(&conn->cmd_lock);
        }
diff --git a/drivers/target/iscsi/iscsi_target_erl2.c b/drivers/target/iscsi/iscsi_target_erl2.c
index 91a4d17..000356b 100644
--- a/drivers/target/iscsi/iscsi_target_erl2.c
+++ b/drivers/target/iscsi/iscsi_target_erl2.c
@@ -148,7 +148,7 @@ void iscsit_free_connection_recovery_entires(struct iscsi_session *sess)
                                iscsit_release_cmd(cmd);
                        else
                                cmd->se_cmd.transport_wait_for_tasks(
-                                               &cmd->se_cmd, 1, 1);
+                                               &cmd->se_cmd, 1);
                        spin_lock(&cr->conn_recovery_cmd_lock);
                }
                spin_unlock(&cr->conn_recovery_cmd_lock);
@@ -175,7 +175,7 @@ void iscsit_free_connection_recovery_entires(struct iscsi_session *sess)
                                iscsit_release_cmd(cmd);
                        else
                                cmd->se_cmd.transport_wait_for_tasks(
-                                               &cmd->se_cmd, 1, 1);
+                                               &cmd->se_cmd, 1);
                        spin_lock(&cr->conn_recovery_cmd_lock);
                }
                spin_unlock(&cr->conn_recovery_cmd_lock);
@@ -265,7 +265,7 @@ void iscsit_discard_cr_cmds_by_expstatsn(
                        iscsit_release_cmd(cmd);
                else
                        cmd->se_cmd.transport_wait_for_tasks(
-                                       &cmd->se_cmd, 1, 0);
+                                       &cmd->se_cmd, 1);
                spin_lock(&cr->conn_recovery_cmd_lock);
        }
        spin_unlock(&cr->conn_recovery_cmd_lock);
@@ -324,7 +324,7 @@ int iscsit_discard_unacknowledged_ooo_cmdsns_for_conn(struct iscsi_conn *conn)
                        iscsit_release_cmd(cmd);
                else
                        cmd->se_cmd.transport_wait_for_tasks(
-                                       &cmd->se_cmd, 1, 1);
+                                       &cmd->se_cmd, 1);
                spin_lock_bh(&conn->cmd_lock);
        }
        spin_unlock_bh(&conn->cmd_lock);
@@ -383,7 +383,7 @@ int iscsit_prepare_cmds_for_realligance(struct iscsi_conn *conn)
                                iscsit_release_cmd(cmd);
                        else
                                cmd->se_cmd.transport_wait_for_tasks(
-                                               &cmd->se_cmd, 1, 0);
+                                               &cmd->se_cmd, 1);
                        spin_lock_bh(&conn->cmd_lock);
                        continue;
                }
@@ -409,7 +409,7 @@ int iscsit_prepare_cmds_for_realligance(struct iscsi_conn *conn)
                                iscsit_release_cmd(cmd);
                        else
                                cmd->se_cmd.transport_wait_for_tasks(
-                                               &cmd->se_cmd, 1, 1);
+                                               &cmd->se_cmd, 1);
                        spin_lock_bh(&conn->cmd_lock);
                        continue;
                }
@@ -436,8 +436,7 @@ int iscsit_prepare_cmds_for_realligance(struct iscsi_conn *conn)
 
                if ((cmd->se_cmd.se_cmd_flags & SCF_SE_LUN_CMD) &&
                     cmd->se_cmd.transport_wait_for_tasks)
-                       cmd->se_cmd.transport_wait_for_tasks(&cmd->se_cmd,
-                                       0, 0);
+                       cmd->se_cmd.transport_wait_for_tasks(&cmd->se_cmd, 0);
                /*
                 * Add the struct iscsi_cmd to the connection recovery cmd list
                 */
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index b6a3d8c..131b89c 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1641,7 +1641,7 @@ static int transport_check_alloc_task_attr(struct se_cmd *cmd)
        return 0;
 }
 
-static void transport_generic_wait_for_tasks(struct se_cmd *, int, int);
+static void transport_generic_wait_for_tasks(struct se_cmd *, int);
 
 /*     transport_generic_allocate_tasks():
  *
@@ -2507,7 +2507,7 @@ void transport_new_cmd_failure(struct se_cmd *se_cmd)
        spin_unlock_irqrestore(&se_cmd->t_state_lock, flags);
 }
 
-static void transport_nop_wait_for_tasks(struct se_cmd *, int, int);
+static void transport_nop_wait_for_tasks(struct se_cmd *, int);
 
 static inline u32 transport_get_sectors_6(
        unsigned char *cdb,
@@ -4345,7 +4345,7 @@ bool transport_generic_free_cmd(struct se_cmd *cmd, int wait_for_tasks)
                        transport_lun_remove_cmd(cmd);
 
                if (wait_for_tasks && cmd->transport_wait_for_tasks)
-                       cmd->transport_wait_for_tasks(cmd, 0, 0);
+                       cmd->transport_wait_for_tasks(cmd, 0);
 
                transport_free_dev_tasks(cmd);
 
@@ -4358,8 +4358,7 @@ EXPORT_SYMBOL(transport_generic_free_cmd);
 
 static void transport_nop_wait_for_tasks(
        struct se_cmd *cmd,
-       int remove_cmd,
-       int session_reinstatement)
+       int remove_cmd)
 {
        return;
 }
@@ -4540,8 +4539,7 @@ int transport_clear_lun_from_sessions(struct se_lun *lun)
  */
 static void transport_generic_wait_for_tasks(
        struct se_cmd *cmd,
-       int remove_cmd,
-       int session_reinstatement)
+       int remove_cmd)
 {
        unsigned long flags;
 
@@ -4617,13 +4615,7 @@ remove:
        if (!remove_cmd)
                return;
 
-       if (!transport_generic_free_cmd(cmd, 0) && session_reinstatement) {
-               unsigned long flags;
-
-               spin_lock_irqsave(&cmd->t_state_lock, flags);
-               transport_all_task_dev_remove_state(cmd);
-               spin_unlock_irqrestore(&cmd->t_state_lock, flags);
-       }
+       transport_generic_free_cmd(cmd, 0);
 }
 
 static int transport_get_sense_codes(
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 32e27ba..23f7720 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -480,7 +480,7 @@ struct se_cmd {
        struct target_core_fabric_ops *se_tfo;
        int (*transport_emulate_cdb)(struct se_cmd *);
        void (*transport_split_cdb)(unsigned long long, u32, unsigned char *);
-       void (*transport_wait_for_tasks)(struct se_cmd *, int, int);
+       void (*transport_wait_for_tasks)(struct se_cmd *, int);
        void (*transport_complete_callback)(struct se_cmd *);
        int (*transport_qf_callback)(struct se_cmd *);
 


--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux