qla2x00t-32gbit, target: Use an on-stack completion instead of cmd_wait_comp

This patch avoids that the se_cmd.cmd_wait_comp member is used. See also
Linux kernel commit 7b2cc7dc0dbf ("scsi: target: Simplify the code for
waiting for command completion") # v4.19.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8098 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2019-03-29 01:36:41 +00:00
parent 6d5464f017
commit 39232f985c
3 changed files with 6 additions and 9 deletions

View File

@@ -820,17 +820,17 @@ static void sqa_qla2xxx_free_session(struct fc_port *fcport)
mcmd = kzalloc(sizeof(*mcmd), GFP_ATOMIC);
if (mcmd) {
DECLARE_COMPLETION_ONSTACK(c);
struct scsi_lun sl;
memset(&sl, 0, sizeof(sl));
mcmd->flags = SQA_INTERNAL_CMD;
mcmd->sess = fcport;
mcmd->reset_count = vha->hw->base_qpair->chip_reset;
init_completion(&mcmd->se_cmd.cmd_wait_comp);
mcmd->completion = &c;
scst_rx_mgmt_fn_lun(scst_sess, SCST_NEXUS_LOSS_SESS,
&sl, sizeof(sl), SCST_ATOMIC, mcmd);
wait_for_completion(&mcmd->se_cmd.cmd_wait_comp);
wait_for_completion(&c);
kfree(mcmd);
TRACE_MGMT_DBG("sqatgt(%ld/%d): Flush cmd done %8phC \n",
@@ -1880,8 +1880,8 @@ static void sqa_task_mgmt_fn_done(struct scst_mgmt_cmd *scst_mcmd)
vha->host_no, vha->vp_idx, scst_mcmd,
scst_mcmd->status, scst_mcmd->state);
if (mcmd->flags & SQA_INTERNAL_CMD) {
complete(&mcmd->se_cmd.cmd_wait_comp);
if (mcmd->completion) {
complete(mcmd->completion);
goto out;
}

View File

@@ -1,7 +1,3 @@
enum sqa_mgt_flags {
SQA_INTERNAL_CMD = BIT_31,
};
#define SQA_DEFAULT_TAGS 2048
extern size_t qlt_add_vtarget(u64, u64, u64);

View File

@@ -969,6 +969,7 @@ struct qla_tgt_mgmt_cmd {
uint32_t reset_count;
struct work_struct work;
uint64_t unpacked_lun;
struct completion *completion;
union {
struct atio_from_isp atio;
struct imm_ntfy_from_isp imm_ntfy;