diff mbox series

[v5,29/52] mpi3mr: Use scsi_cmd_to_rq() instead of scsi_cmnd.request

Message ID 20210809230355.8186-30-bvanassche@acm.org
State New
Headers show
Series [v5,01/52] core: Introduce the scsi_cmd_to_rq() function | expand

Commit Message

Bart Van Assche Aug. 9, 2021, 11:03 p.m. UTC
Prepare for removal of the request pointer by using scsi_cmd_to_rq()
instead. This patch does not change any functionality.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/mpi3mr/mpi3mr_os.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Kashyap Desai Aug. 16, 2021, 8:32 a.m. UTC | #1
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

> ---

>  drivers/scsi/mpi3mr/mpi3mr_os.c | 8 ++++----

>  1 file changed, 4 insertions(+), 4 deletions(-)

>

> diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c

> index 24ac7ddec749..bc1c32f599de 100644

> --- a/drivers/scsi/mpi3mr/mpi3mr_os.c

> +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c

> @@ -50,7 +50,7 @@ static u16 mpi3mr_host_tag_for_scmd(struct mpi3mr_ioc *mrioc,

>         u32 unique_tag;

>         u16 host_tag, hw_queue;

>

> -       unique_tag = blk_mq_unique_tag(scmd->request);

> +       unique_tag = blk_mq_unique_tag(scsi_cmd_to_rq(scmd));

>

>         hw_queue = blk_mq_unique_tag_to_hwq(unique_tag);

>         if (hw_queue >= mrioc->num_op_reply_q)

> @@ -2016,7 +2016,7 @@ static void mpi3mr_setup_eedp(struct mpi3mr_ioc *mrioc,

>         case SCSI_PROT_DIF_TYPE0:

>                 eedp_flags |= MPI3_EEDPFLAGS_INCR_PRI_REF_TAG;

>                 scsiio_req->cdb.eedp32.primary_reference_tag =

> -                   cpu_to_be32(t10_pi_ref_tag(scmd->request));

> +                   cpu_to_be32(t10_pi_ref_tag(scsi_cmd_to_rq(scmd)));

>                 break;

>         case SCSI_PROT_DIF_TYPE1:

>         case SCSI_PROT_DIF_TYPE2:

> @@ -2024,7 +2024,7 @@ static void mpi3mr_setup_eedp(struct mpi3mr_ioc *mrioc,

>                     MPI3_EEDPFLAGS_ESC_MODE_APPTAG_DISABLE |

>                     MPI3_EEDPFLAGS_CHK_GUARD;

>                 scsiio_req->cdb.eedp32.primary_reference_tag =

> -                   cpu_to_be32(t10_pi_ref_tag(scmd->request));

> +                   cpu_to_be32(t10_pi_ref_tag(scsi_cmd_to_rq(scmd)));

Bart,

t10_pi_ref_tag API is replaced by scsi_prot_ref_tag in the patch below
posted by Martin.

https://patchwork.kernel.org/project/linux-scsi/patch/20210806040023.5355-4-martin.petersen@oracle.com/

Rebase is required for mpi3mr and mpt3sas driver changes in this series.

Kashyap
Martin K. Petersen Aug. 16, 2021, 5:13 p.m. UTC | #2
Kashyap,

> t10_pi_ref_tag API is replaced by scsi_prot_ref_tag in the patch below

> posted by Martin.


> Rebase is required for mpi3mr and mpt3sas driver changes in this series.


I fixed this conflict when I merged the series.

The corresponding mpt3sas patch caused a zeroday warning and had a
bug. Posting a fixed version shortly.

-- 
Martin K. Petersen	Oracle Linux Engineering
diff mbox series

Patch

diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index 24ac7ddec749..bc1c32f599de 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -50,7 +50,7 @@  static u16 mpi3mr_host_tag_for_scmd(struct mpi3mr_ioc *mrioc,
 	u32 unique_tag;
 	u16 host_tag, hw_queue;
 
-	unique_tag = blk_mq_unique_tag(scmd->request);
+	unique_tag = blk_mq_unique_tag(scsi_cmd_to_rq(scmd));
 
 	hw_queue = blk_mq_unique_tag_to_hwq(unique_tag);
 	if (hw_queue >= mrioc->num_op_reply_q)
@@ -2016,7 +2016,7 @@  static void mpi3mr_setup_eedp(struct mpi3mr_ioc *mrioc,
 	case SCSI_PROT_DIF_TYPE0:
 		eedp_flags |= MPI3_EEDPFLAGS_INCR_PRI_REF_TAG;
 		scsiio_req->cdb.eedp32.primary_reference_tag =
-		    cpu_to_be32(t10_pi_ref_tag(scmd->request));
+		    cpu_to_be32(t10_pi_ref_tag(scsi_cmd_to_rq(scmd)));
 		break;
 	case SCSI_PROT_DIF_TYPE1:
 	case SCSI_PROT_DIF_TYPE2:
@@ -2024,7 +2024,7 @@  static void mpi3mr_setup_eedp(struct mpi3mr_ioc *mrioc,
 		    MPI3_EEDPFLAGS_ESC_MODE_APPTAG_DISABLE |
 		    MPI3_EEDPFLAGS_CHK_GUARD;
 		scsiio_req->cdb.eedp32.primary_reference_tag =
-		    cpu_to_be32(t10_pi_ref_tag(scmd->request));
+		    cpu_to_be32(t10_pi_ref_tag(scsi_cmd_to_rq(scmd)));
 		break;
 	case SCSI_PROT_DIF_TYPE3:
 		eedp_flags |= MPI3_EEDPFLAGS_CHK_GUARD |
@@ -3451,7 +3451,7 @@  static int mpi3mr_qcmd(struct Scsi_Host *shost,
 	u16 dev_handle;
 	u16 host_tag;
 	u32 scsiio_flags = 0;
-	struct request *rq = scmd->request;
+	struct request *rq = scsi_cmd_to_rq(scmd);
 	int iprio_class;
 
 	sdev_priv_data = scmd->device->hostdata;