Commit e81ce97f authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Martin K. Petersen

scsi: lpfc: Use rport as argument for lpfc_chk_tgt_mapped()

We only need the rport structure for lpfc_chk_tgt_mapped().

Link: https://lore.kernel.org/r/20220301143718.40913-6-hare@suse.de
Cc: James Smart <james.smart@broadcom.com>
Reviewed-by: default avatarJames Smart <jsmart2021@gmail.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 123a3af3
...@@ -6244,7 +6244,7 @@ lpfc_send_taskmgmt(struct lpfc_vport *vport, struct fc_rport *rport, ...@@ -6244,7 +6244,7 @@ lpfc_send_taskmgmt(struct lpfc_vport *vport, struct fc_rport *rport,
/** /**
* lpfc_chk_tgt_mapped - * lpfc_chk_tgt_mapped -
* @vport: The virtual port to check on * @vport: The virtual port to check on
* @cmnd: Pointer to scsi_cmnd data structure. * @rport: Pointer to fc_rport data structure.
* *
* This routine delays until the scsi target (aka rport) for the * This routine delays until the scsi target (aka rport) for the
* command exists (is present and logged in) or we declare it non-existent. * command exists (is present and logged in) or we declare it non-existent.
...@@ -6254,19 +6254,20 @@ lpfc_send_taskmgmt(struct lpfc_vport *vport, struct fc_rport *rport, ...@@ -6254,19 +6254,20 @@ lpfc_send_taskmgmt(struct lpfc_vport *vport, struct fc_rport *rport,
* 0x2002 - Success * 0x2002 - Success
**/ **/
static int static int
lpfc_chk_tgt_mapped(struct lpfc_vport *vport, struct scsi_cmnd *cmnd) lpfc_chk_tgt_mapped(struct lpfc_vport *vport, struct fc_rport *rport)
{ {
struct lpfc_rport_data *rdata; struct lpfc_rport_data *rdata;
struct lpfc_nodelist *pnode; struct lpfc_nodelist *pnode = NULL;
unsigned long later; unsigned long later;
rdata = lpfc_rport_data_from_scsi_device(cmnd->device); rdata = rport->dd_data;
if (!rdata) { if (!rdata) {
lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP, lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
"0797 Tgt Map rport failure: rdata x%px\n", rdata); "0797 Tgt Map rport failure: rdata x%px\n", rdata);
return FAILED; return FAILED;
} }
pnode = rdata->pnode; pnode = rdata->pnode;
/* /*
* If target is not in a MAPPED state, delay until * If target is not in a MAPPED state, delay until
* target is rediscovered or devloss timeout expires. * target is rediscovered or devloss timeout expires.
...@@ -6278,7 +6279,7 @@ lpfc_chk_tgt_mapped(struct lpfc_vport *vport, struct scsi_cmnd *cmnd) ...@@ -6278,7 +6279,7 @@ lpfc_chk_tgt_mapped(struct lpfc_vport *vport, struct scsi_cmnd *cmnd)
if (pnode->nlp_state == NLP_STE_MAPPED_NODE) if (pnode->nlp_state == NLP_STE_MAPPED_NODE)
return SUCCESS; return SUCCESS;
schedule_timeout_uninterruptible(msecs_to_jiffies(500)); schedule_timeout_uninterruptible(msecs_to_jiffies(500));
rdata = lpfc_rport_data_from_scsi_device(cmnd->device); rdata = rport->dd_data;
if (!rdata) if (!rdata)
return FAILED; return FAILED;
pnode = rdata->pnode; pnode = rdata->pnode;
...@@ -6371,7 +6372,7 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd) ...@@ -6371,7 +6372,7 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd)
if (status != 0 && status != SUCCESS) if (status != 0 && status != SUCCESS)
return status; return status;
status = lpfc_chk_tgt_mapped(vport, cmnd); status = lpfc_chk_tgt_mapped(vport, rport);
if (status == FAILED) { if (status == FAILED) {
lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
"0721 Device Reset rport failure: rdata x%px\n", rdata); "0721 Device Reset rport failure: rdata x%px\n", rdata);
...@@ -6449,7 +6450,7 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd) ...@@ -6449,7 +6450,7 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd)
if (status != 0 && status != SUCCESS) if (status != 0 && status != SUCCESS)
return status; return status;
status = lpfc_chk_tgt_mapped(vport, cmnd); status = lpfc_chk_tgt_mapped(vport, rport);
if (status == FAILED) { if (status == FAILED) {
lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
"0722 Target Reset rport failure: rdata x%px\n", rdata); "0722 Target Reset rport failure: rdata x%px\n", rdata);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment