From 34bbbf47d8f1b31f5a8f5c678448549cdd4a2213 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 29 Mar 2019 01:37:50 +0000 Subject: [PATCH] qla2x00t-32gbit, target: Avoid using the protocol_data member Avoid using this structure member since it is not available in kernel versions before v4.2. See also commit 7a971b1b3055 ("target: replace se_cmd->execute_rw with a protocol_data field") # v4.2. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8099 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c b/qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c index 94abe4ecb..721652215 100644 --- a/qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c +++ b/qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c @@ -436,8 +436,9 @@ static inline void qla_tgt_set_cmd_prot_op(struct qla_tgt_cmd *cmd, uint8_t xmit static void sqa_qla2xxx_rel_cmd(struct qla_tgt_cmd *cmd) { - struct sqa_scst_tgt *sqa_tgt = - (struct sqa_scst_tgt *)cmd->se_cmd.protocol_data; + struct fc_port *sess = cmd->sess; + struct sqa_scst_tgt *sqa_tgt = sess->vha->vha_tgt.target_lport_ptr; + percpu_ida_free(&sqa_tgt->tgt_tag_pool, cmd->se_cmd.map_tag); } @@ -455,8 +456,6 @@ static struct qla_tgt_cmd *sqa_qla2xxx_get_cmd(struct fc_port *sess) cmd = &((struct qla_tgt_cmd *)sqa_tgt->tgt_cmd_map)[tag]; memset(cmd, 0, sizeof(struct qla_tgt_cmd)); cmd->se_cmd.map_tag = tag; - /* BORROWing this field to carry sqa_tgt */ - cmd->se_cmd.protocol_data = (void*)sqa_tgt; cmd->sess = sess; cmd->vha = sess->vha; cmd->rel_cmd = sqa_qla2xxx_rel_cmd;