Commit 5ebddd48 authored by Andy Grover's avatar Andy Grover Committed by Nicholas Bellinger

tcm_fc: Move core->fc code conversion earlier in ft_send_tm()

No dependencies on rest of code, let's get tm_func set asap.
Signed-off-by: default avatarAndy Grover <agrover@redhat.com>
Cc: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent c8e31f26
...@@ -353,17 +353,11 @@ static void ft_send_resp_code_and_free(struct ft_cmd *cmd, ...@@ -353,17 +353,11 @@ static void ft_send_resp_code_and_free(struct ft_cmd *cmd,
*/ */
static void ft_send_tm(struct ft_cmd *cmd) static void ft_send_tm(struct ft_cmd *cmd)
{ {
struct se_tmr_req *tmr;
struct fcp_cmnd *fcp; struct fcp_cmnd *fcp;
struct ft_sess *sess; struct ft_sess *sess;
int rc; int rc;
u8 tm_func; u8 tm_func;
transport_init_se_cmd(&cmd->se_cmd, &ft_configfs->tf_ops,
cmd->sess->se_sess, 0, DMA_NONE, 0,
&cmd->ft_sense_buffer[0]);
target_get_sess_cmd(cmd->sess->se_sess, &cmd->se_cmd, false);
fcp = fc_frame_payload_get(cmd->req_frame, sizeof(*fcp)); fcp = fc_frame_payload_get(cmd->req_frame, sizeof(*fcp));
switch (fcp->fc_tm_flags) { switch (fcp->fc_tm_flags) {
...@@ -392,6 +386,11 @@ static void ft_send_tm(struct ft_cmd *cmd) ...@@ -392,6 +386,11 @@ static void ft_send_tm(struct ft_cmd *cmd)
return; return;
} }
transport_init_se_cmd(&cmd->se_cmd, &ft_configfs->tf_ops,
cmd->sess->se_sess, 0, DMA_NONE, 0,
&cmd->ft_sense_buffer[0]);
target_get_sess_cmd(cmd->sess->se_sess, &cmd->se_cmd, false);
pr_debug("alloc tm cmd fn %d\n", tm_func); pr_debug("alloc tm cmd fn %d\n", tm_func);
rc = core_tmr_alloc_req(&cmd->se_cmd, cmd, tm_func, GFP_KERNEL); rc = core_tmr_alloc_req(&cmd->se_cmd, cmd, tm_func, GFP_KERNEL);
if (rc < 0) { if (rc < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment