Skip to content

Commit

Permalink
target/iscsi: Move init_se_cmd closer to lookup_cmd_lun
Browse files Browse the repository at this point in the history
if we can get calls to init_se_cmd, get_sess_cmd, lookup_cmd_lun,
core_alua_check_nonop_delay, and handle_cdb_direct next to each other,
then we can just call target_submit_cmd. This is a step towards that
goal.

Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
Andy Grover authored and Nicholas Bellinger committed Apr 15, 2012
1 parent d28b116 commit 065ca1e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions drivers/target/iscsi/iscsi_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -988,17 +988,6 @@ static int iscsit_handle_scsi_cmd(
sam_task_attr = MSG_SIMPLE_TAG;
}

/*
* Initialize struct se_cmd descriptor from target_core_mod infrastructure
*/
transport_init_se_cmd(&cmd->se_cmd, &lio_target_fabric_configfs->tf_ops,
conn->sess->se_sess, cmd->data_length, cmd->data_direction,
sam_task_attr, &cmd->sense_buffer[0]);

pr_debug("Got SCSI Command, ITT: 0x%08x, CmdSN: 0x%08x,"
" ExpXferLen: %u, Length: %u, CID: %hu\n", hdr->itt,
hdr->cmdsn, hdr->data_length, payload_length, conn->cid);

cmd->iscsi_opcode = ISCSI_OP_SCSI_CMD;
cmd->i_state = ISTATE_NEW_CMD;
cmd->immediate_cmd = ((hdr->opcode & ISCSI_OP_IMMEDIATE) ? 1 : 0);
Expand Down Expand Up @@ -1033,6 +1022,17 @@ static int iscsit_handle_scsi_cmd(
iscsit_attach_datain_req(cmd, dr);
}

/*
* Initialize struct se_cmd descriptor from target_core_mod infrastructure
*/
transport_init_se_cmd(&cmd->se_cmd, &lio_target_fabric_configfs->tf_ops,
conn->sess->se_sess, cmd->data_length, cmd->data_direction,
sam_task_attr, &cmd->sense_buffer[0]);

pr_debug("Got SCSI Command, ITT: 0x%08x, CmdSN: 0x%08x,"
" ExpXferLen: %u, Length: %u, CID: %hu\n", hdr->itt,
hdr->cmdsn, hdr->data_length, payload_length, conn->cid);

/*
* The CDB is going to an se_device_t.
*/
Expand Down

0 comments on commit 065ca1e

Please sign in to comment.