All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: "Martin K . Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
	linux-scsi@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
	Jens Axboe <axboe@kernel.dk>, Hannes Reinecke <hare@suse.de>,
	Ming Lei <ming.lei@redhat.com>
Subject: [PATCH v3 07/51] ata: Use scsi_cmd_to_rq() instead of scsi_cmnd.request
Date: Sun, 23 May 2021 20:08:12 -0700	[thread overview]
Message-ID: <20210524030856.2824-8-bvanassche@acm.org> (raw)
In-Reply-To: <20210524030856.2824-1-bvanassche@acm.org>

Prepare for removal of the request pointer by using scsi_cmd_to_rq()
instead. This patch does not change any functionality.

Cc: Jens Axboe <axboe@kernel.dk>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/ata/libata-eh.c   |  5 ++---
 drivers/ata/libata-scsi.c | 10 +++++-----
 drivers/ata/pata_falcon.c |  4 ++--
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index bb3637762985..bf9c4b6c5c3d 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -912,7 +912,7 @@ void ata_qc_schedule_eh(struct ata_queued_cmd *qc)
 	 * Note that ATA_QCFLAG_FAILED is unconditionally set after
 	 * this function completes.
 	 */
-	blk_abort_request(qc->scsicmd->request);
+	blk_abort_request(scsi_cmd_to_rq(qc->scsicmd));
 }
 
 /**
@@ -1893,8 +1893,7 @@ static inline int ata_eh_worth_retry(struct ata_queued_cmd *qc)
  */
 static inline bool ata_eh_quiet(struct ata_queued_cmd *qc)
 {
-	if (qc->scsicmd &&
-	    qc->scsicmd->request->rq_flags & RQF_QUIET)
+	if (qc->scsicmd && scsi_cmd_to_rq(qc->scsicmd)->rq_flags & RQF_QUIET)
 		qc->flags |= ATA_QCFLAG_QUIET;
 	return qc->flags & ATA_QCFLAG_QUIET;
 }
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index fd8b6febbf70..debc78f653c1 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -627,7 +627,7 @@ static struct ata_queued_cmd *ata_scsi_qc_new(struct ata_device *dev,
 {
 	struct ata_queued_cmd *qc;
 
-	qc = ata_qc_new_init(dev, cmd->request->tag);
+	qc = ata_qc_new_init(dev, scsi_cmd_to_rq(cmd)->tag);
 	if (qc) {
 		qc->scsicmd = cmd;
 		qc->scsidone = cmd->scsi_done;
@@ -635,7 +635,7 @@ static struct ata_queued_cmd *ata_scsi_qc_new(struct ata_device *dev,
 		qc->sg = scsi_sglist(cmd);
 		qc->n_elem = scsi_sg_count(cmd);
 
-		if (cmd->request->rq_flags & RQF_QUIET)
+		if (scsi_cmd_to_rq(cmd)->rq_flags & RQF_QUIET)
 			qc->flags |= ATA_QCFLAG_QUIET;
 	} else {
 		cmd->result = (DID_OK << 16) | (QUEUE_FULL << 1);
@@ -1497,7 +1497,7 @@ static unsigned int ata_scsi_verify_xlat(struct ata_queued_cmd *qc)
 
 static bool ata_check_nblocks(struct scsi_cmnd *scmd, u32 n_blocks)
 {
-	struct request *rq = scmd->request;
+	struct request *rq = scsi_cmd_to_rq(scmd);
 	u32 req_blocks;
 
 	if (!blk_rq_is_passthrough(rq))
@@ -1532,7 +1532,7 @@ static unsigned int ata_scsi_rw_xlat(struct ata_queued_cmd *qc)
 {
 	struct scsi_cmnd *scmd = qc->scsicmd;
 	const u8 *cdb = scmd->cmnd;
-	struct request *rq = scmd->request;
+	struct request *rq = scsi_cmd_to_rq(scmd);
 	int class = IOPRIO_PRIO_CLASS(req_get_ioprio(rq));
 	unsigned int tf_flags = 0;
 	u64 block;
@@ -3182,7 +3182,7 @@ static unsigned int ata_scsi_write_same_xlat(struct ata_queued_cmd *qc)
 	 * as it modifies the DATA OUT buffer, which would corrupt user
 	 * memory for SG_IO commands.
 	 */
-	if (unlikely(blk_rq_is_passthrough(scmd->request)))
+	if (unlikely(blk_rq_is_passthrough(scsi_cmd_to_rq(scmd))))
 		goto invalid_opcode;
 
 	if (unlikely(scmd->cmd_len < 16)) {
diff --git a/drivers/ata/pata_falcon.c b/drivers/ata/pata_falcon.c
index 27b0952fde6b..154e3577878b 100644
--- a/drivers/ata/pata_falcon.c
+++ b/drivers/ata/pata_falcon.c
@@ -50,8 +50,8 @@ static unsigned int pata_falcon_data_xfer(struct ata_queued_cmd *qc,
 	struct scsi_cmnd *cmd = qc->scsicmd;
 	bool swap = 1;
 
-	if (dev->class == ATA_DEV_ATA && cmd && cmd->request &&
-	    !blk_rq_is_passthrough(cmd->request))
+	if (dev->class == ATA_DEV_ATA && cmd &&
+	    !blk_rq_is_passthrough(scsi_cmd_to_rq(cmd)))
 		swap = 0;
 
 	/* Transfer multiple of 2 bytes */

  parent reply	other threads:[~2021-05-24  3:09 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-24  3:08 [PATCH v3 00/51] Remove the request pointer from struct scsi_cmnd Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 01/51] core: Introduce the scsi_cmd_to_rq() function Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 02/51] core: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 03/51] sd: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 04/51] sr: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 05/51] scsi_transport_fc: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 06/51] scsi_transport_spi: " Bart Van Assche
2021-05-24  3:08 ` Bart Van Assche [this message]
2021-05-24  3:08 ` [PATCH v3 08/51] RDMA/iser: " Bart Van Assche
2021-05-24  8:46   ` Max Gurtovoy
2021-05-24  3:08 ` [PATCH v3 09/51] RDMA/srp: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 10/51] zfcp: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 11/51] 53c700: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 12/51] NCR5380: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 13/51] aacraid: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 14/51] advansys: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 15/51] aha1542: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 16/51] bnx2i: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 17/51] csiostor: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 18/51] cxlflash: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 19/51] dpt_i2o: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 20/51] fnic: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 21/51] hisi_sas: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 22/51] hpsa: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 23/51] ibmvfc: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 24/51] ibmvscsi: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 25/51] ips: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 26/51] libsas: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 27/51] lpfc: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 28/51] megaraid: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 29/51] mpt3sas: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 30/51] mvumi: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 31/51] myrb: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 32/51] myrs: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 33/51] ncr53c8xx: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 34/51] qedf: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 35/51] qedi: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 36/51] qla1280: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 37/51] qla2xxx: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 38/51] qla4xxx: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 39/51] qlogicpti: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 40/51] scsi_debug: " Bart Van Assche
2021-05-25 16:19   ` Douglas Gilbert
2021-05-24  3:08 ` [PATCH v3 41/51] smartpqi: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 42/51] snic: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 43/51] stex: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 44/51] sun3_scsi: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 45/51] sym53c8xx: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 46/51] ufs: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 47/51] virtio_scsi: " Bart Van Assche
2021-05-24  9:23   ` Michael S. Tsirkin
2021-05-24  3:08 ` [PATCH v3 48/51] xen-scsifront: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 49/51] tcm_loop: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 50/51] usb-storage: " Bart Van Assche
2021-05-24  3:08 ` [PATCH v3 51/51] core: Remove the request member from struct scsi_cmnd Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210524030856.2824-8-bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=axboe@kernel.dk \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ming.lei@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.