aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/target/target_core_transport.c10
-rw-r--r--drivers/target/tcm_fc/tfc_cmd.c3
-rw-r--r--include/target/target_core_fabric.h3
3 files changed, 12 insertions, 4 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index ca1a40dc4888..3533ad644286 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1713,6 +1713,8 @@ static void target_complete_tmr_failure(struct work_struct *work)
1713 * @unpacked_lun: unpacked LUN to reference for struct se_lun 1713 * @unpacked_lun: unpacked LUN to reference for struct se_lun
1714 * @fabric_context: fabric context for TMR req 1714 * @fabric_context: fabric context for TMR req
1715 * @tm_type: Type of TM request 1715 * @tm_type: Type of TM request
1716 * @gfp: gfp type for caller
1717 * @tag: referenced task tag for TMR_ABORT_TASK
1716 * @flags: submit cmd flags 1718 * @flags: submit cmd flags
1717 * 1719 *
1718 * Callable from all contexts. 1720 * Callable from all contexts.
@@ -1720,7 +1722,8 @@ static void target_complete_tmr_failure(struct work_struct *work)
1720 1722
1721int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, 1723int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
1722 unsigned char *sense, u32 unpacked_lun, 1724 unsigned char *sense, u32 unpacked_lun,
1723 void *fabric_tmr_ptr, unsigned char tm_type, int flags) 1725 void *fabric_tmr_ptr, unsigned char tm_type,
1726 gfp_t gfp, unsigned int tag, int flags)
1724{ 1727{
1725 struct se_portal_group *se_tpg; 1728 struct se_portal_group *se_tpg;
1726 int ret; 1729 int ret;
@@ -1734,10 +1737,13 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
1734 * FIXME: Currently expect caller to handle se_cmd->se_tmr_req 1737 * FIXME: Currently expect caller to handle se_cmd->se_tmr_req
1735 * allocation failure. 1738 * allocation failure.
1736 */ 1739 */
1737 ret = core_tmr_alloc_req(se_cmd, fabric_tmr_ptr, tm_type, GFP_KERNEL); 1740 ret = core_tmr_alloc_req(se_cmd, fabric_tmr_ptr, tm_type, gfp);
1738 if (ret < 0) 1741 if (ret < 0)
1739 return -ENOMEM; 1742 return -ENOMEM;
1740 1743
1744 if (tm_type == TMR_ABORT_TASK)
1745 se_cmd->se_tmr_req->ref_task_tag = tag;
1746
1741 /* See target_submit_cmd for commentary */ 1747 /* See target_submit_cmd for commentary */
1742 target_get_sess_cmd(se_sess, se_cmd, (flags & TARGET_SCF_ACK_KREF)); 1748 target_get_sess_cmd(se_sess, se_cmd, (flags & TARGET_SCF_ACK_KREF));
1743 1749
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c
index be3319af5d8b..17ffc82274a4 100644
--- a/drivers/target/tcm_fc/tfc_cmd.c
+++ b/drivers/target/tcm_fc/tfc_cmd.c
@@ -385,9 +385,10 @@ static void ft_send_tm(struct ft_cmd *cmd)
385 return; 385 return;
386 } 386 }
387 387
388 /* FIXME: Add referenced task tag for ABORT_TASK */
388 rc = target_submit_tmr(&cmd->se_cmd, cmd->sess->se_sess, 389 rc = target_submit_tmr(&cmd->se_cmd, cmd->sess->se_sess,
389 &cmd->ft_sense_buffer[0], scsilun_to_int(&fcp->fc_lun), 390 &cmd->ft_sense_buffer[0], scsilun_to_int(&fcp->fc_lun),
390 cmd, tm_func, 0); 391 cmd, tm_func, GFP_KERNEL, 0, 0);
391 if (rc < 0) 392 if (rc < 0)
392 ft_send_resp_code_and_free(cmd, FCP_TMF_FAILED); 393 ft_send_resp_code_and_free(cmd, FCP_TMF_FAILED);
393} 394}
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h
index 77a3b6e4f44c..e5d8c47892b7 100644
--- a/include/target/target_core_fabric.h
+++ b/include/target/target_core_fabric.h
@@ -118,7 +118,8 @@ void target_submit_cmd(struct se_cmd *, struct se_session *, unsigned char *,
118 unsigned char *, u32, u32, int, int, int); 118 unsigned char *, u32, u32, int, int, int);
119int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, 119int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
120 unsigned char *sense, u32 unpacked_lun, 120 unsigned char *sense, u32 unpacked_lun,
121 void *fabric_tmr_ptr, unsigned char tm_type, int flags); 121 void *fabric_tmr_ptr, unsigned char tm_type,
122 gfp_t, unsigned int, int);
122int transport_handle_cdb_direct(struct se_cmd *); 123int transport_handle_cdb_direct(struct se_cmd *);
123int transport_generic_handle_cdb_map(struct se_cmd *); 124int transport_generic_handle_cdb_map(struct se_cmd *);
124int transport_generic_handle_data(struct se_cmd *); 125int transport_generic_handle_data(struct se_cmd *);