target/iscsi: Rename iscsi_cmd.i_list to iscsi_cmd.i_conn_node
authorAndy Grover <agrover@redhat.com>
Tue, 3 Apr 2012 22:51:01 +0000 (15:51 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Sun, 15 Apr 2012 00:40:33 +0000 (17:40 -0700)
The name change makes it clear this list_head is so the cmd can be an
item in the connection's conn_cmd_list.

Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/iscsi/iscsi_target.c
drivers/target/iscsi/iscsi_target_core.h
drivers/target/iscsi/iscsi_target_erl1.c
drivers/target/iscsi/iscsi_target_erl2.c
drivers/target/iscsi/iscsi_target_tmr.c
drivers/target/iscsi/iscsi_target_util.c

index 8b1d5e62ed40a82d48caf1515d7c91279d07778f..e635e263eb9df9025fa368232bb884ecef34d15b 100644 (file)
@@ -622,7 +622,7 @@ int iscsit_add_reject(
        }
 
        spin_lock_bh(&conn->cmd_lock);
-       list_add_tail(&cmd->i_list, &conn->conn_cmd_list);
+       list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list);
        spin_unlock_bh(&conn->cmd_lock);
 
        cmd->i_state = ISTATE_SEND_REJECT;
@@ -669,7 +669,7 @@ int iscsit_add_reject_from_cmd(
 
        if (add_to_conn) {
                spin_lock_bh(&conn->cmd_lock);
-               list_add_tail(&cmd->i_list, &conn->conn_cmd_list);
+               list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list);
                spin_unlock_bh(&conn->cmd_lock);
        }
 
@@ -744,7 +744,7 @@ static void iscsit_ack_from_expstatsn(struct iscsi_conn *conn, u32 exp_statsn)
        conn->exp_statsn = exp_statsn;
 
        spin_lock_bh(&conn->cmd_lock);
-       list_for_each_entry(cmd, &conn->conn_cmd_list, i_list) {
+       list_for_each_entry(cmd, &conn->conn_cmd_list, i_conn_node) {
                spin_lock(&cmd->istate_lock);
                if ((cmd->i_state == ISTATE_SENT_STATUS) &&
                    (cmd->stat_sn < exp_statsn)) {
@@ -1045,7 +1045,7 @@ done:
 
 attach_cmd:
        spin_lock_bh(&conn->cmd_lock);
-       list_add_tail(&cmd->i_list, &conn->conn_cmd_list);
+       list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list);
        spin_unlock_bh(&conn->cmd_lock);
        /*
         * Check if we need to delay processing because of ALUA
@@ -1617,7 +1617,7 @@ static int iscsit_handle_nop_out(
                 * Initiator is expecting a NopIN ping reply,
                 */
                spin_lock_bh(&conn->cmd_lock);
-               list_add_tail(&cmd->i_list, &conn->conn_cmd_list);
+               list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list);
                spin_unlock_bh(&conn->cmd_lock);
 
                iscsit_ack_from_expstatsn(conn, hdr->exp_statsn);
@@ -1804,7 +1804,7 @@ static int iscsit_handle_task_mgt_cmd(
                se_tmr->call_transport = 1;
 attach:
        spin_lock_bh(&conn->cmd_lock);
-       list_add_tail(&cmd->i_list, &conn->conn_cmd_list);
+       list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list);
        spin_unlock_bh(&conn->cmd_lock);
 
        if (!(hdr->opcode & ISCSI_OP_IMMEDIATE)) {
@@ -1980,7 +1980,7 @@ static int iscsit_handle_text_cmd(
        cmd->data_direction     = DMA_NONE;
 
        spin_lock_bh(&conn->cmd_lock);
-       list_add_tail(&cmd->i_list, &conn->conn_cmd_list);
+       list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list);
        spin_unlock_bh(&conn->cmd_lock);
 
        iscsit_ack_from_expstatsn(conn, hdr->exp_statsn);
@@ -2168,7 +2168,7 @@ static int iscsit_handle_logout_cmd(
                logout_remove = 1;
 
        spin_lock_bh(&conn->cmd_lock);
-       list_add_tail(&cmd->i_list, &conn->conn_cmd_list);
+       list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list);
        spin_unlock_bh(&conn->cmd_lock);
 
        if (reason_code != ISCSI_LOGOUT_REASON_RECOVERY)
@@ -2381,7 +2381,7 @@ static void iscsit_build_conn_drop_async_message(struct iscsi_conn *conn)
        cmd->i_state = ISTATE_SEND_ASYNCMSG;
 
        spin_lock_bh(&conn_p->cmd_lock);
-       list_add_tail(&cmd->i_list, &conn_p->conn_cmd_list);
+       list_add_tail(&cmd->i_conn_node, &conn_p->conn_cmd_list);
        spin_unlock_bh(&conn_p->cmd_lock);
 
        iscsit_add_cmd_to_response_queue(cmd, conn_p, cmd->i_state);
@@ -3552,7 +3552,7 @@ get_immediate:
                                        iscsit_stop_dataout_timer(cmd);
 
                                spin_lock_bh(&conn->cmd_lock);
-                               list_del(&cmd->i_list);
+                               list_del(&cmd->i_conn_node);
                                spin_unlock_bh(&conn->cmd_lock);
 
                                iscsit_free_cmd(cmd);
@@ -3952,9 +3952,9 @@ static void iscsit_release_commands_from_conn(struct iscsi_conn *conn)
         * has been reset -> returned sleeping pre-handler state.
         */
        spin_lock_bh(&conn->cmd_lock);
-       list_for_each_entry_safe(cmd, cmd_tmp, &conn->conn_cmd_list, i_list) {
+       list_for_each_entry_safe(cmd, cmd_tmp, &conn->conn_cmd_list, i_conn_node) {
 
-               list_del(&cmd->i_list);
+               list_del(&cmd->i_conn_node);
                spin_unlock_bh(&conn->cmd_lock);
 
                iscsit_increment_maxcmdsn(cmd, sess);
@@ -3972,7 +3972,7 @@ static void iscsit_stop_timers_for_cmds(
        struct iscsi_cmd *cmd;
 
        spin_lock_bh(&conn->cmd_lock);
-       list_for_each_entry(cmd, &conn->conn_cmd_list, i_list) {
+       list_for_each_entry(cmd, &conn->conn_cmd_list, i_conn_node) {
                if (cmd->data_direction == DMA_TO_DEVICE)
                        iscsit_stop_dataout_timer(cmd);
        }
index 2aaee7efa683e92712d3404db1e560c82b375f40..cf784ccbd52f63a19dd193c8843a1dae10b9fb2f 100644 (file)
@@ -464,7 +464,7 @@ struct iscsi_cmd {
        /* Session the command is part of,  used for connection recovery */
        struct iscsi_session    *sess;
        /* list_head for connection list */
-       struct list_head        i_list;
+       struct list_head        i_conn_node;
        /* The TCM I/O descriptor that is accessed via container_of() */
        struct se_cmd           se_cmd;
        /* Sense buffer that will be mapped into outgoing status */
index 006f605edb08c01de8f6796d34521ec848d6424b..f6d1a23875a0ccbb9610d8c2b7a3a17b9493b7de 100644 (file)
@@ -526,7 +526,7 @@ int iscsit_handle_status_snack(
                found_cmd = 0;
 
                spin_lock_bh(&conn->cmd_lock);
-               list_for_each_entry(cmd, &conn->conn_cmd_list, i_list) {
+               list_for_each_entry(cmd, &conn->conn_cmd_list, i_conn_node) {
                        if (cmd->stat_sn == begrun) {
                                found_cmd = 1;
                                break;
index 1af1f21af21fd01735eab9cec3f2369246e69bd4..65aac14fd8312d12bd57bdc8ad9b59bff8a9a452 100644 (file)
@@ -138,9 +138,9 @@ void iscsit_free_connection_recovery_entires(struct iscsi_session *sess)
 
                spin_lock(&cr->conn_recovery_cmd_lock);
                list_for_each_entry_safe(cmd, cmd_tmp,
-                               &cr->conn_recovery_cmd_list, i_list) {
+                               &cr->conn_recovery_cmd_list, i_conn_node) {
 
-                       list_del(&cmd->i_list);
+                       list_del(&cmd->i_conn_node);
                        cmd->conn = NULL;
                        spin_unlock(&cr->conn_recovery_cmd_lock);
                        iscsit_free_cmd(cmd);
@@ -160,9 +160,9 @@ void iscsit_free_connection_recovery_entires(struct iscsi_session *sess)
 
                spin_lock(&cr->conn_recovery_cmd_lock);
                list_for_each_entry_safe(cmd, cmd_tmp,
-                               &cr->conn_recovery_cmd_list, i_list) {
+                               &cr->conn_recovery_cmd_list, i_conn_node) {
 
-                       list_del(&cmd->i_list);
+                       list_del(&cmd->i_conn_node);
                        cmd->conn = NULL;
                        spin_unlock(&cr->conn_recovery_cmd_lock);
                        iscsit_free_cmd(cmd);
@@ -220,7 +220,7 @@ int iscsit_remove_cmd_from_connection_recovery(
        }
        cr = cmd->cr;
 
-       list_del(&cmd->i_list);
+       list_del(&cmd->i_conn_node);
        return --cr->cmd_count;
 }
 
@@ -234,7 +234,7 @@ void iscsit_discard_cr_cmds_by_expstatsn(
 
        spin_lock(&cr->conn_recovery_cmd_lock);
        list_for_each_entry_safe(cmd, cmd_tmp,
-                       &cr->conn_recovery_cmd_list, i_list) {
+                       &cr->conn_recovery_cmd_list, i_conn_node) {
 
                if (((cmd->deferred_i_state != ISTATE_SENT_STATUS) &&
                     (cmd->deferred_i_state != ISTATE_REMOVE)) ||
@@ -297,11 +297,11 @@ int iscsit_discard_unacknowledged_ooo_cmdsns_for_conn(struct iscsi_conn *conn)
        mutex_unlock(&sess->cmdsn_mutex);
 
        spin_lock_bh(&conn->cmd_lock);
-       list_for_each_entry_safe(cmd, cmd_tmp, &conn->conn_cmd_list, i_list) {
+       list_for_each_entry_safe(cmd, cmd_tmp, &conn->conn_cmd_list, i_conn_node) {
                if (!(cmd->cmd_flags & ICF_OOO_CMDSN))
                        continue;
 
-               list_del(&cmd->i_list);
+               list_del(&cmd->i_conn_node);
 
                spin_unlock_bh(&conn->cmd_lock);
                iscsit_free_cmd(cmd);
@@ -339,14 +339,14 @@ int iscsit_prepare_cmds_for_realligance(struct iscsi_conn *conn)
        /*
         * Only perform connection recovery on ISCSI_OP_SCSI_CMD or
         * ISCSI_OP_NOOP_OUT opcodes.  For all other opcodes call
-        * list_del(&cmd->i_list); to release the command to the
+        * list_del(&cmd->i_conn_node); to release the command to the
         * session pool and remove it from the connection's list.
         *
         * Also stop the DataOUT timer, which will be restarted after
         * sending the TMR response.
         */
        spin_lock_bh(&conn->cmd_lock);
-       list_for_each_entry_safe(cmd, cmd_tmp, &conn->conn_cmd_list, i_list) {
+       list_for_each_entry_safe(cmd, cmd_tmp, &conn->conn_cmd_list, i_conn_node) {
 
                if ((cmd->iscsi_opcode != ISCSI_OP_SCSI_CMD) &&
                    (cmd->iscsi_opcode != ISCSI_OP_NOOP_OUT)) {
@@ -355,7 +355,7 @@ int iscsit_prepare_cmds_for_realligance(struct iscsi_conn *conn)
                                " CID: %hu\n", cmd->iscsi_opcode,
                                cmd->init_task_tag, cmd->cmd_sn, conn->cid);
 
-                       list_del(&cmd->i_list);
+                       list_del(&cmd->i_conn_node);
                        spin_unlock_bh(&conn->cmd_lock);
                        iscsit_free_cmd(cmd);
                        spin_lock_bh(&conn->cmd_lock);
@@ -375,7 +375,7 @@ int iscsit_prepare_cmds_for_realligance(struct iscsi_conn *conn)
                 */
                if (!(cmd->cmd_flags & ICF_OOO_CMDSN) && !cmd->immediate_cmd &&
                     (cmd->cmd_sn >= conn->sess->exp_cmd_sn)) {
-                       list_del(&cmd->i_list);
+                       list_del(&cmd->i_conn_node);
                        spin_unlock_bh(&conn->cmd_lock);
                        iscsit_free_cmd(cmd);
                        spin_lock_bh(&conn->cmd_lock);
@@ -397,7 +397,7 @@ int iscsit_prepare_cmds_for_realligance(struct iscsi_conn *conn)
 
                cmd->sess = conn->sess;
 
-               list_del(&cmd->i_list);
+               list_del(&cmd->i_conn_node);
                spin_unlock_bh(&conn->cmd_lock);
 
                iscsit_free_all_datain_reqs(cmd);
@@ -407,7 +407,7 @@ int iscsit_prepare_cmds_for_realligance(struct iscsi_conn *conn)
                 * Add the struct iscsi_cmd to the connection recovery cmd list
                 */
                spin_lock(&cr->conn_recovery_cmd_lock);
-               list_add_tail(&cmd->i_list, &cr->conn_recovery_cmd_list);
+               list_add_tail(&cmd->i_conn_node, &cr->conn_recovery_cmd_list);
                spin_unlock(&cr->conn_recovery_cmd_lock);
 
                spin_lock_bh(&conn->cmd_lock);
index e01da9d2b37e327bf6e91283d003b4ab57b18690..1fcdf99be76f40ca75f6035d283aecd05b488d36 100644 (file)
@@ -216,7 +216,7 @@ static int iscsit_task_reassign_complete_nop_out(
        iscsit_task_reassign_remove_cmd(cmd, cr, conn->sess);
 
        spin_lock_bh(&conn->cmd_lock);
-       list_add_tail(&cmd->i_list, &conn->conn_cmd_list);
+       list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list);
        spin_unlock_bh(&conn->cmd_lock);
 
        cmd->i_state = ISTATE_SEND_NOPIN;
@@ -385,7 +385,7 @@ static int iscsit_task_reassign_complete_scsi_cmnd(
        iscsit_task_reassign_remove_cmd(cmd, cr, conn->sess);
 
        spin_lock_bh(&conn->cmd_lock);
-       list_add_tail(&cmd->i_list, &conn->conn_cmd_list);
+       list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list);
        spin_unlock_bh(&conn->cmd_lock);
 
        if (se_cmd->se_cmd_flags & SCF_SENT_CHECK_CONDITION) {
index 4eba86d2bd8232091bbe1888a39254516569fa84..89cb91e2ffe8701c011e6014b7b623bfe1953fba 100644 (file)
@@ -163,7 +163,7 @@ struct iscsi_cmd *iscsit_allocate_cmd(struct iscsi_conn *conn, gfp_t gfp_mask)
        }
 
        cmd->conn       = conn;
-       INIT_LIST_HEAD(&cmd->i_list);
+       INIT_LIST_HEAD(&cmd->i_conn_node);
        INIT_LIST_HEAD(&cmd->datain_list);
        INIT_LIST_HEAD(&cmd->cmd_r2t_list);
        init_completion(&cmd->reject_comp);
@@ -524,7 +524,7 @@ struct iscsi_cmd *iscsit_find_cmd_from_itt(
        struct iscsi_cmd *cmd;
 
        spin_lock_bh(&conn->cmd_lock);
-       list_for_each_entry(cmd, &conn->conn_cmd_list, i_list) {
+       list_for_each_entry(cmd, &conn->conn_cmd_list, i_conn_node) {
                if (cmd->init_task_tag == init_task_tag) {
                        spin_unlock_bh(&conn->cmd_lock);
                        return cmd;
@@ -545,7 +545,7 @@ struct iscsi_cmd *iscsit_find_cmd_from_itt_or_dump(
        struct iscsi_cmd *cmd;
 
        spin_lock_bh(&conn->cmd_lock);
-       list_for_each_entry(cmd, &conn->conn_cmd_list, i_list) {
+       list_for_each_entry(cmd, &conn->conn_cmd_list, i_conn_node) {
                if (cmd->init_task_tag == init_task_tag) {
                        spin_unlock_bh(&conn->cmd_lock);
                        return cmd;
@@ -568,7 +568,7 @@ struct iscsi_cmd *iscsit_find_cmd_from_ttt(
        struct iscsi_cmd *cmd = NULL;
 
        spin_lock_bh(&conn->cmd_lock);
-       list_for_each_entry(cmd, &conn->conn_cmd_list, i_list) {
+       list_for_each_entry(cmd, &conn->conn_cmd_list, i_conn_node) {
                if (cmd->targ_xfer_tag == targ_xfer_tag) {
                        spin_unlock_bh(&conn->cmd_lock);
                        return cmd;
@@ -596,7 +596,7 @@ int iscsit_find_cmd_for_recovery(
        spin_lock(&sess->cr_i_lock);
        list_for_each_entry(cr, &sess->cr_inactive_list, cr_list) {
                spin_lock(&cr->conn_recovery_cmd_lock);
-               list_for_each_entry(cmd, &cr->conn_recovery_cmd_list, i_list) {
+               list_for_each_entry(cmd, &cr->conn_recovery_cmd_list, i_conn_node) {
                        if (cmd->init_task_tag == init_task_tag) {
                                spin_unlock(&cr->conn_recovery_cmd_lock);
                                spin_unlock(&sess->cr_i_lock);
@@ -616,7 +616,7 @@ int iscsit_find_cmd_for_recovery(
        spin_lock(&sess->cr_a_lock);
        list_for_each_entry(cr, &sess->cr_active_list, cr_list) {
                spin_lock(&cr->conn_recovery_cmd_lock);
-               list_for_each_entry(cmd, &cr->conn_recovery_cmd_list, i_list) {
+               list_for_each_entry(cmd, &cr->conn_recovery_cmd_list, i_conn_node) {
                        if (cmd->init_task_tag == init_task_tag) {
                                spin_unlock(&cr->conn_recovery_cmd_lock);
                                spin_unlock(&sess->cr_a_lock);
@@ -1038,7 +1038,7 @@ static int iscsit_add_nopin(struct iscsi_conn *conn, int want_response)
        spin_unlock_bh(&conn->sess->ttt_lock);
 
        spin_lock_bh(&conn->cmd_lock);
-       list_add_tail(&cmd->i_list, &conn->conn_cmd_list);
+       list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list);
        spin_unlock_bh(&conn->cmd_lock);
 
        if (want_response)