diff options
| author | Andy Grover <agrover@redhat.com> | 2012-01-19 16:39:22 -0500 |
|---|---|---|
| committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-02-25 17:37:48 -0500 |
| commit | 59dcb5ec47965d8d22428db67cbea33a9ec4f347 (patch) | |
| tree | 17420f43636ec5dade33dcc312d210c6efc1ee12 /drivers/target/tcm_fc | |
| parent | ea98d7f9c7cc38de55f81a1c249112442b93c7c9 (diff) | |
tcm_fc: Convert ft_send_tm to use target_submit_tmr
Change ft_send_tm() make use of the new target_submit_tmr helper
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.c | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c index a08119f57039..ed69c0deb102 100644 --- a/drivers/target/tcm_fc/tfc_cmd.c +++ b/drivers/target/tcm_fc/tfc_cmd.c | |||
| @@ -354,8 +354,6 @@ static void ft_send_resp_code_and_free(struct ft_cmd *cmd, | |||
| 354 | static void ft_send_tm(struct ft_cmd *cmd) | 354 | static void ft_send_tm(struct ft_cmd *cmd) |
| 355 | { | 355 | { |
| 356 | struct fcp_cmnd *fcp; | 356 | struct fcp_cmnd *fcp; |
| 357 | struct ft_sess *sess; | ||
| 358 | int rc; | ||
| 359 | u8 tm_func; | 357 | u8 tm_func; |
| 360 | 358 | ||
| 361 | fcp = fc_frame_payload_get(cmd->req_frame, sizeof(*fcp)); | 359 | fcp = fc_frame_payload_get(cmd->req_frame, sizeof(*fcp)); |
| @@ -386,33 +384,9 @@ static void ft_send_tm(struct ft_cmd *cmd) | |||
| 386 | return; | 384 | return; |
| 387 | } | 385 | } |
| 388 | 386 | ||
| 389 | transport_init_se_cmd(&cmd->se_cmd, &ft_configfs->tf_ops, | 387 | target_submit_tmr(&cmd->se_cmd, cmd->sess->se_sess, |
| 390 | cmd->sess->se_sess, 0, DMA_NONE, 0, | 388 | &cmd->ft_sense_buffer[0], scsilun_to_int(&fcp->fc_lun), |
| 391 | &cmd->ft_sense_buffer[0]); | 389 | cmd, tm_func, 0); |
| 392 | target_get_sess_cmd(cmd->sess->se_sess, &cmd->se_cmd, false); | ||
| 393 | |||
| 394 | pr_debug("alloc tm cmd fn %d\n", tm_func); | ||
| 395 | rc = core_tmr_alloc_req(&cmd->se_cmd, cmd, tm_func, GFP_KERNEL); | ||
| 396 | if (rc < 0) { | ||
| 397 | pr_debug("alloc failed\n"); | ||
| 398 | ft_send_resp_code_and_free(cmd, FCP_TMF_FAILED); | ||
| 399 | return; | ||
| 400 | } | ||
| 401 | |||
| 402 | rc = transport_lookup_tmr_lun(&cmd->se_cmd, scsilun_to_int(&fcp->fc_lun)); | ||
| 403 | if (rc < 0) { | ||
| 404 | pr_debug("Failed to get LUN for TMR func %d, " | ||
| 405 | "se_cmd %p, unpacked_lun %d\n", | ||
| 406 | tm_func, &cmd->se_cmd, scsilun_to_int(&fcp->fc_lun)); | ||
| 407 | ft_dump_cmd(cmd, __func__); | ||
| 408 | sess = cmd->sess; | ||
| 409 | transport_send_check_condition_and_sense(&cmd->se_cmd, | ||
| 410 | cmd->se_cmd.scsi_sense_reason, 0); | ||
| 411 | transport_generic_free_cmd(&cmd->se_cmd, 0); | ||
| 412 | return; | ||
| 413 | } | ||
| 414 | |||
| 415 | transport_generic_handle_tmr(&cmd->se_cmd); | ||
| 416 | } | 390 | } |
| 417 | 391 | ||
| 418 | /* | 392 | /* |
