Commit 065ca1e42ffd74dd03cf60f61cead35934c91ed5
Committed by
Nicholas Bellinger
1 parent
d28b11692e
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
target/iscsi: Move init_se_cmd closer to lookup_cmd_lun
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>
Showing 1 changed file with 11 additions and 11 deletions Side-by-side Diff
drivers/target/iscsi/iscsi_target.c
... | ... | @@ -988,17 +988,6 @@ |
988 | 988 | sam_task_attr = MSG_SIMPLE_TAG; |
989 | 989 | } |
990 | 990 | |
991 | - /* | |
992 | - * Initialize struct se_cmd descriptor from target_core_mod infrastructure | |
993 | - */ | |
994 | - transport_init_se_cmd(&cmd->se_cmd, &lio_target_fabric_configfs->tf_ops, | |
995 | - conn->sess->se_sess, cmd->data_length, cmd->data_direction, | |
996 | - sam_task_attr, &cmd->sense_buffer[0]); | |
997 | - | |
998 | - pr_debug("Got SCSI Command, ITT: 0x%08x, CmdSN: 0x%08x," | |
999 | - " ExpXferLen: %u, Length: %u, CID: %hu\n", hdr->itt, | |
1000 | - hdr->cmdsn, hdr->data_length, payload_length, conn->cid); | |
1001 | - | |
1002 | 991 | cmd->iscsi_opcode = ISCSI_OP_SCSI_CMD; |
1003 | 992 | cmd->i_state = ISTATE_NEW_CMD; |
1004 | 993 | cmd->immediate_cmd = ((hdr->opcode & ISCSI_OP_IMMEDIATE) ? 1 : 0); |
... | ... | @@ -1032,6 +1021,17 @@ |
1032 | 1021 | |
1033 | 1022 | iscsit_attach_datain_req(cmd, dr); |
1034 | 1023 | } |
1024 | + | |
1025 | + /* | |
1026 | + * Initialize struct se_cmd descriptor from target_core_mod infrastructure | |
1027 | + */ | |
1028 | + transport_init_se_cmd(&cmd->se_cmd, &lio_target_fabric_configfs->tf_ops, | |
1029 | + conn->sess->se_sess, cmd->data_length, cmd->data_direction, | |
1030 | + sam_task_attr, &cmd->sense_buffer[0]); | |
1031 | + | |
1032 | + pr_debug("Got SCSI Command, ITT: 0x%08x, CmdSN: 0x%08x," | |
1033 | + " ExpXferLen: %u, Length: %u, CID: %hu\n", hdr->itt, | |
1034 | + hdr->cmdsn, hdr->data_length, payload_length, conn->cid); | |
1035 | 1035 | |
1036 | 1036 | /* |
1037 | 1037 | * The CDB is going to an se_device_t. |