diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-02-25 08:10:04 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-02-25 21:39:13 -0500 |
commit | c0974f89385970455a60a999ae4fc0a783cf458d (patch) | |
tree | 14abc856524251bf392bcaf0b2b8c621500ec1b2 /drivers/target | |
parent | 9f0d05c2c6185d7b5ba08a6c052e90837101031f (diff) |
target: Allow target_submit_tmr interrupt context + pass ABORT_TASK tag
This patch allows target_submit_tmr() to pass gfp_t for se_cmd->se_tmr_req
allocation, and also set up se_cmd->se_tmr_req->ref_task_tag for passed
tag with TMR_ABORT_TASK.
Also update tcm_fc(fcoe) parameter usgae and add ref_task_tag FIXME
for TMR_ABORT_TASK usage,
Cc: Andy Grover <agrover@redhat.com>
Cc: Kiran Patil <kiran.patil@intel.com>
Cc: Arun Easi <arun.easi@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/target_core_transport.c | 10 | ||||
-rw-r--r-- | drivers/target/tcm_fc/tfc_cmd.c | 3 |
2 files changed, 10 insertions, 3 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 | ||
1721 | int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, | 1723 | int 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 | } |