mirror of https://gitee.com/openkylin/linux.git
scsi: myrs: Use scsi_cmd_to_rq() instead of scsi_cmnd.request
Prepare for removal of the request pointer by using scsi_cmd_to_rq() instead. This patch does not change any functionality. Link: https://lore.kernel.org/r/20210809230355.8186-34-bvanassche@acm.org Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
2fd8f23aae
commit
43b2d1b14e
|
@ -1582,6 +1582,7 @@ static void myrs_mode_sense(struct myrs_hba *cs, struct scsi_cmnd *scmd,
|
|||
static int myrs_queuecommand(struct Scsi_Host *shost,
|
||||
struct scsi_cmnd *scmd)
|
||||
{
|
||||
struct request *rq = scsi_cmd_to_rq(scmd);
|
||||
struct myrs_hba *cs = shost_priv(shost);
|
||||
struct myrs_cmdblk *cmd_blk = scsi_cmd_priv(scmd);
|
||||
union myrs_cmd_mbox *mbox = &cmd_blk->mbox;
|
||||
|
@ -1628,7 +1629,7 @@ static int myrs_queuecommand(struct Scsi_Host *shost,
|
|||
return SCSI_MLQUEUE_HOST_BUSY;
|
||||
cmd_blk->sense_addr = sense_addr;
|
||||
|
||||
timeout = scmd->request->timeout;
|
||||
timeout = rq->timeout;
|
||||
if (scmd->cmd_len <= 10) {
|
||||
if (scmd->device->channel >= cs->ctlr_info->physchan_present) {
|
||||
struct myrs_ldev_info *ldev_info = sdev->hostdata;
|
||||
|
@ -1644,10 +1645,10 @@ static int myrs_queuecommand(struct Scsi_Host *shost,
|
|||
mbox->SCSI_10.pdev.target = sdev->id;
|
||||
mbox->SCSI_10.pdev.channel = sdev->channel;
|
||||
}
|
||||
mbox->SCSI_10.id = scmd->request->tag + 3;
|
||||
mbox->SCSI_10.id = rq->tag + 3;
|
||||
mbox->SCSI_10.control.dma_ctrl_to_host =
|
||||
(scmd->sc_data_direction == DMA_FROM_DEVICE);
|
||||
if (scmd->request->cmd_flags & REQ_FUA)
|
||||
if (rq->cmd_flags & REQ_FUA)
|
||||
mbox->SCSI_10.control.fua = true;
|
||||
mbox->SCSI_10.dma_size = scsi_bufflen(scmd);
|
||||
mbox->SCSI_10.sense_addr = cmd_blk->sense_addr;
|
||||
|
@ -1690,10 +1691,10 @@ static int myrs_queuecommand(struct Scsi_Host *shost,
|
|||
mbox->SCSI_255.pdev.target = sdev->id;
|
||||
mbox->SCSI_255.pdev.channel = sdev->channel;
|
||||
}
|
||||
mbox->SCSI_255.id = scmd->request->tag + 3;
|
||||
mbox->SCSI_255.id = rq->tag + 3;
|
||||
mbox->SCSI_255.control.dma_ctrl_to_host =
|
||||
(scmd->sc_data_direction == DMA_FROM_DEVICE);
|
||||
if (scmd->request->cmd_flags & REQ_FUA)
|
||||
if (rq->cmd_flags & REQ_FUA)
|
||||
mbox->SCSI_255.control.fua = true;
|
||||
mbox->SCSI_255.dma_size = scsi_bufflen(scmd);
|
||||
mbox->SCSI_255.sense_addr = cmd_blk->sense_addr;
|
||||
|
|
Loading…
Reference in New Issue