aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/tcm_fc
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2012-01-19 16:39:19 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2012-02-25 17:37:47 -0500
commit06fb6313d975c144850a3381ffa792c752d5473d (patch)
treebc3ba0622b0c013f01960071aa0ee1df5c7a1c85 /drivers/target/tcm_fc
parent5ebddd48ffc5b54f96a8041704de3890ee629d8f (diff)
tcm_fc: Call lookup_tmr_lun() for all TM types
Don't see a reason to differentiate, so drop the fabric specific switch statement in ft_send_tm() ahead of conversion to use target_submit_tmr(). 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.c36
1 files changed, 11 insertions, 25 deletions
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c
index d4c95cc2ae54..3926f4a66cb6 100644
--- a/drivers/target/tcm_fc/tfc_cmd.c
+++ b/drivers/target/tcm_fc/tfc_cmd.c
@@ -399,33 +399,19 @@ static void ft_send_tm(struct ft_cmd *cmd)
399 return; 399 return;
400 } 400 }
401 401
402 switch (fcp->fc_tm_flags) { 402 rc = transport_lookup_tmr_lun(&cmd->se_cmd, scsilun_to_int(&fcp->fc_lun));
403 case FCP_TMF_LUN_RESET: 403 if (rc < 0) {
404 if (transport_lookup_tmr_lun(&cmd->se_cmd, scsilun_to_int(&fcp->fc_lun)) < 0) { 404 pr_debug("Failed to get LUN for TMR func %d, "
405 /* 405 "se_cmd %p, unpacked_lun %d\n",
406 * Make sure to clean up newly allocated TMR request 406 tm_func, &cmd->se_cmd, scsilun_to_int(&fcp->fc_lun));
407 * since "unable to handle TMR request because failed 407 ft_dump_cmd(cmd, __func__);
408 * to get to LUN" 408 sess = cmd->sess;
409 */ 409 transport_send_check_condition_and_sense(&cmd->se_cmd,
410 pr_debug("Failed to get LUN for TMR func %d, " 410 cmd->se_cmd.scsi_sense_reason, 0);
411 "se_cmd %p, unpacked_lun %d\n", 411 ft_sess_put(sess);
412 tm_func, &cmd->se_cmd, scsilun_to_int(&fcp->fc_lun));
413 ft_dump_cmd(cmd, __func__);
414 sess = cmd->sess;
415 transport_send_check_condition_and_sense(&cmd->se_cmd,
416 cmd->se_cmd.scsi_sense_reason, 0);
417 ft_sess_put(sess);
418 return;
419 }
420 break;
421 case FCP_TMF_TGT_RESET:
422 case FCP_TMF_CLR_TASK_SET:
423 case FCP_TMF_ABT_TASK_SET:
424 case FCP_TMF_CLR_ACA:
425 break;
426 default:
427 return; 412 return;
428 } 413 }
414
429 transport_generic_handle_tmr(&cmd->se_cmd); 415 transport_generic_handle_tmr(&cmd->se_cmd);
430} 416}
431 417