summaryrefslogtreecommitdiffstats
path: root/drivers/target/tcm_fc
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2012-01-19 22:39:18 +0100
committerNicholas Bellinger <nab@linux-iscsi.org>2012-02-25 23:37:47 +0100
commit5ebddd48ffc5b54f96a8041704de3890ee629d8f (patch)
tree4ce191729cc4f61d41683a6b84266e3c4c1453ec /drivers/target/tcm_fc
parenttarget: Add SCF_SCSI_TMR_CDB usage and drop se_tmr_req_cache (diff)
downloadlinux-5ebddd48ffc5b54f96a8041704de3890ee629d8f.tar.xz
linux-5ebddd48ffc5b54f96a8041704de3890ee629d8f.zip
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: Andy Grover <agrover@redhat.com> Cc: Kiran Patil <kiran.patil@intel.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/tcm_fc')
-rw-r--r--drivers/target/tcm_fc/tfc_cmd.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c
index bdf25593b81c..d4c95cc2ae54 100644
--- a/drivers/target/tcm_fc/tfc_cmd.c
+++ b/drivers/target/tcm_fc/tfc_cmd.c
@@ -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)
{
- struct se_tmr_req *tmr;
struct fcp_cmnd *fcp;
struct ft_sess *sess;
int rc;
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));
switch (fcp->fc_tm_flags) {
@@ -392,6 +386,11 @@ static void ft_send_tm(struct ft_cmd *cmd)
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);
rc = core_tmr_alloc_req(&cmd->se_cmd, cmd, tm_func, GFP_KERNEL);
if (rc < 0) {