diff options
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/tcm_fc/tfc_cmd.c | 27 | ||||
-rw-r--r-- | drivers/target/tcm_fc/tfc_conf.c | 1 | ||||
-rw-r--r-- | drivers/target/tcm_fc/tfc_io.c | 1 | ||||
-rw-r--r-- | drivers/target/tcm_fc/tfc_sess.c | 2 |
4 files changed, 19 insertions, 12 deletions
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c index 03977e8996d8..5654dc22f7ae 100644 --- a/drivers/target/tcm_fc/tfc_cmd.c +++ b/drivers/target/tcm_fc/tfc_cmd.c | |||
@@ -45,7 +45,6 @@ | |||
45 | #include <target/target_core_device.h> | 45 | #include <target/target_core_device.h> |
46 | #include <target/target_core_tpg.h> | 46 | #include <target/target_core_tpg.h> |
47 | #include <target/target_core_configfs.h> | 47 | #include <target/target_core_configfs.h> |
48 | #include <target/target_core_base.h> | ||
49 | #include <target/target_core_tmr.h> | 48 | #include <target/target_core_tmr.h> |
50 | #include <target/configfs_macros.h> | 49 | #include <target/configfs_macros.h> |
51 | 50 | ||
@@ -264,8 +263,9 @@ int ft_write_pending(struct se_cmd *se_cmd) | |||
264 | cmd->sg_cnt = | 263 | cmd->sg_cnt = |
265 | se_cmd->t_tasks_sg_chained_no; | 264 | se_cmd->t_tasks_sg_chained_no; |
266 | } | 265 | } |
267 | if (cmd->sg && lport->tt.ddp_setup(lport, ep->xid, | 266 | if (cmd->sg && lport->tt.ddp_target(lport, ep->xid, |
268 | cmd->sg, cmd->sg_cnt)) | 267 | cmd->sg, |
268 | cmd->sg_cnt)) | ||
269 | cmd->was_ddp_setup = 1; | 269 | cmd->was_ddp_setup = 1; |
270 | } | 270 | } |
271 | } | 271 | } |
@@ -372,12 +372,23 @@ static void ft_send_resp_status(struct fc_lport *lport, | |||
372 | 372 | ||
373 | /* | 373 | /* |
374 | * Send error or task management response. | 374 | * Send error or task management response. |
375 | * Always frees the cmd and associated state. | ||
376 | */ | 375 | */ |
377 | static void ft_send_resp_code(struct ft_cmd *cmd, enum fcp_resp_rsp_codes code) | 376 | static void ft_send_resp_code(struct ft_cmd *cmd, |
377 | enum fcp_resp_rsp_codes code) | ||
378 | { | 378 | { |
379 | ft_send_resp_status(cmd->sess->tport->lport, | 379 | ft_send_resp_status(cmd->sess->tport->lport, |
380 | cmd->req_frame, SAM_STAT_GOOD, code); | 380 | cmd->req_frame, SAM_STAT_GOOD, code); |
381 | } | ||
382 | |||
383 | |||
384 | /* | ||
385 | * Send error or task management response. | ||
386 | * Always frees the cmd and associated state. | ||
387 | */ | ||
388 | static void ft_send_resp_code_and_free(struct ft_cmd *cmd, | ||
389 | enum fcp_resp_rsp_codes code) | ||
390 | { | ||
391 | ft_send_resp_code(cmd, code); | ||
381 | ft_free_cmd(cmd); | 392 | ft_free_cmd(cmd); |
382 | } | 393 | } |
383 | 394 | ||
@@ -415,7 +426,7 @@ static void ft_send_tm(struct ft_cmd *cmd) | |||
415 | * tm_flags set is invalid. | 426 | * tm_flags set is invalid. |
416 | */ | 427 | */ |
417 | pr_debug("invalid FCP tm_flags %x\n", fcp->fc_tm_flags); | 428 | pr_debug("invalid FCP tm_flags %x\n", fcp->fc_tm_flags); |
418 | ft_send_resp_code(cmd, FCP_CMND_FIELDS_INVALID); | 429 | ft_send_resp_code_and_free(cmd, FCP_CMND_FIELDS_INVALID); |
419 | return; | 430 | return; |
420 | } | 431 | } |
421 | 432 | ||
@@ -423,7 +434,7 @@ static void ft_send_tm(struct ft_cmd *cmd) | |||
423 | tmr = core_tmr_alloc_req(&cmd->se_cmd, cmd, tm_func); | 434 | tmr = core_tmr_alloc_req(&cmd->se_cmd, cmd, tm_func); |
424 | if (!tmr) { | 435 | if (!tmr) { |
425 | pr_debug("alloc failed\n"); | 436 | pr_debug("alloc failed\n"); |
426 | ft_send_resp_code(cmd, FCP_TMF_FAILED); | 437 | ft_send_resp_code_and_free(cmd, FCP_TMF_FAILED); |
427 | return; | 438 | return; |
428 | } | 439 | } |
429 | cmd->se_cmd.se_tmr_req = tmr; | 440 | cmd->se_cmd.se_tmr_req = tmr; |
@@ -662,7 +673,7 @@ static void ft_send_cmd(struct ft_cmd *cmd) | |||
662 | return; | 673 | return; |
663 | 674 | ||
664 | err: | 675 | err: |
665 | ft_send_resp_code(cmd, FCP_CMND_FIELDS_INVALID); | 676 | ft_send_resp_code_and_free(cmd, FCP_CMND_FIELDS_INVALID); |
666 | } | 677 | } |
667 | 678 | ||
668 | /* | 679 | /* |
diff --git a/drivers/target/tcm_fc/tfc_conf.c b/drivers/target/tcm_fc/tfc_conf.c index d63e3dd3b180..8781d1e423df 100644 --- a/drivers/target/tcm_fc/tfc_conf.c +++ b/drivers/target/tcm_fc/tfc_conf.c | |||
@@ -48,7 +48,6 @@ | |||
48 | #include <target/target_core_device.h> | 48 | #include <target/target_core_device.h> |
49 | #include <target/target_core_tpg.h> | 49 | #include <target/target_core_tpg.h> |
50 | #include <target/target_core_configfs.h> | 50 | #include <target/target_core_configfs.h> |
51 | #include <target/target_core_base.h> | ||
52 | #include <target/configfs_macros.h> | 51 | #include <target/configfs_macros.h> |
53 | 52 | ||
54 | #include "tcm_fc.h" | 53 | #include "tcm_fc.h" |
diff --git a/drivers/target/tcm_fc/tfc_io.c b/drivers/target/tcm_fc/tfc_io.c index 06943eeb3c84..c37f4cd96452 100644 --- a/drivers/target/tcm_fc/tfc_io.c +++ b/drivers/target/tcm_fc/tfc_io.c | |||
@@ -54,7 +54,6 @@ | |||
54 | #include <target/target_core_device.h> | 54 | #include <target/target_core_device.h> |
55 | #include <target/target_core_tpg.h> | 55 | #include <target/target_core_tpg.h> |
56 | #include <target/target_core_configfs.h> | 56 | #include <target/target_core_configfs.h> |
57 | #include <target/target_core_base.h> | ||
58 | #include <target/configfs_macros.h> | 57 | #include <target/configfs_macros.h> |
59 | 58 | ||
60 | #include "tcm_fc.h" | 59 | #include "tcm_fc.h" |
diff --git a/drivers/target/tcm_fc/tfc_sess.c b/drivers/target/tcm_fc/tfc_sess.c index fbcbb3d1d06b..dbb5eaeee399 100644 --- a/drivers/target/tcm_fc/tfc_sess.c +++ b/drivers/target/tcm_fc/tfc_sess.c | |||
@@ -46,10 +46,8 @@ | |||
46 | #include <target/target_core_device.h> | 46 | #include <target/target_core_device.h> |
47 | #include <target/target_core_tpg.h> | 47 | #include <target/target_core_tpg.h> |
48 | #include <target/target_core_configfs.h> | 48 | #include <target/target_core_configfs.h> |
49 | #include <target/target_core_base.h> | ||
50 | #include <target/configfs_macros.h> | 49 | #include <target/configfs_macros.h> |
51 | 50 | ||
52 | #include <scsi/libfc.h> | ||
53 | #include "tcm_fc.h" | 51 | #include "tcm_fc.h" |
54 | 52 | ||
55 | static void ft_sess_delete_all(struct ft_tport *); | 53 | static void ft_sess_delete_all(struct ft_tport *); |