Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257831
b: refs/heads/master
c: f2f7b09
h: refs/heads/master
i:
  257829: 0e886cf
  257827: 9fa48ed
  257823: 9cec5c5
v: v3
  • Loading branch information
Kiran Patil authored and James Bottomley committed Jun 29, 2011
1 parent f635d3b commit 3663ed5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e3e65c69c3cfe8e407797c78fd11808aee1a8a81
refs/heads/master: f2f7b09ccea1717026915a4401f0452f05c97364
21 changes: 16 additions & 5 deletions trunk/drivers/target/tcm_fc/tfc_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,23 @@ static void ft_send_resp_status(struct fc_lport *lport,

/*
* Send error or task management response.
* Always frees the cmd and associated state.
*/
static void ft_send_resp_code(struct ft_cmd *cmd, enum fcp_resp_rsp_codes code)
static void ft_send_resp_code(struct ft_cmd *cmd,
enum fcp_resp_rsp_codes code)
{
ft_send_resp_status(cmd->sess->tport->lport,
cmd->req_frame, SAM_STAT_GOOD, code);
}


/*
* Send error or task management response.
* Always frees the cmd and associated state.
*/
static void ft_send_resp_code_and_free(struct ft_cmd *cmd,
enum fcp_resp_rsp_codes code)
{
ft_send_resp_code(cmd, code);
ft_free_cmd(cmd);
}

Expand Down Expand Up @@ -423,15 +434,15 @@ static void ft_send_tm(struct ft_cmd *cmd)
* tm_flags set is invalid.
*/
FT_TM_DBG("invalid FCP tm_flags %x\n", fcp->fc_tm_flags);
ft_send_resp_code(cmd, FCP_CMND_FIELDS_INVALID);
ft_send_resp_code_and_free(cmd, FCP_CMND_FIELDS_INVALID);
return;
}

FT_TM_DBG("alloc tm cmd fn %d\n", tm_func);
tmr = core_tmr_alloc_req(&cmd->se_cmd, cmd, tm_func);
if (!tmr) {
FT_TM_DBG("alloc failed\n");
ft_send_resp_code(cmd, FCP_TMF_FAILED);
ft_send_resp_code_and_free(cmd, FCP_TMF_FAILED);
return;
}
cmd->se_cmd.se_tmr_req = tmr;
Expand Down Expand Up @@ -670,7 +681,7 @@ static void ft_send_cmd(struct ft_cmd *cmd)
return;

err:
ft_send_resp_code(cmd, FCP_CMND_FIELDS_INVALID);
ft_send_resp_code_and_free(cmd, FCP_CMND_FIELDS_INVALID);
return;
}

Expand Down

0 comments on commit 3663ed5

Please sign in to comment.