From: Mike Christie <michael.christie@oracle.com>
To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de,
martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
james.bottomley@hansenpartnership.com
Cc: Mike Christie <michael.christie@oracle.com>
Subject: [PATCH 06/15] scsi: core: Convert to scsi_execute_cmd
Date: Mon, 21 Nov 2022 21:39:25 -0600 [thread overview]
Message-ID: <20221122033934.33797-7-michael.christie@oracle.com> (raw)
In-Reply-To: <20221122033934.33797-1-michael.christie@oracle.com>
scsi_execute_req is going to be removed. Convert scsi-ml to
scsi_execute_cmd.
Signed-off-by: Mike Christie <michael.christie@oracle.com>
---
drivers/scsi/scsi.c | 9 +++++----
drivers/scsi/scsi_ioctl.c | 5 +++--
drivers/scsi/scsi_lib.c | 17 +++++++++++------
drivers/scsi/scsi_scan.c | 22 ++++++++++++++--------
4 files changed, 33 insertions(+), 20 deletions(-)
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 1426b9b03612..fc65d64b7299 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -309,8 +309,8 @@ static int scsi_vpd_inquiry(struct scsi_device *sdev, unsigned char *buffer,
* I'm not convinced we need to try quite this hard to get VPD, but
* all the existing users tried this hard.
*/
- result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer,
- len, NULL, 30 * HZ, 3, NULL);
+ result = __scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_IN, buffer,
+ len, 30 * HZ, 3, NULL);
if (result)
return -EIO;
@@ -531,8 +531,9 @@ int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer,
put_unaligned_be32(request_len, &cmd[6]);
memset(buffer, 0, len);
- result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer,
- request_len, &sshdr, 30 * HZ, 3, NULL);
+ result = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_IN, buffer,
+ request_len, 30 * HZ, 3,
+ ((struct scsi_exec_args) { .sshdr = &sshdr }));
if (result < 0)
return result;
diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c
index 8baff7edf7c3..6956849bd1f1 100644
--- a/drivers/scsi/scsi_ioctl.c
+++ b/drivers/scsi/scsi_ioctl.c
@@ -73,8 +73,9 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd,
SCSI_LOG_IOCTL(1, sdev_printk(KERN_INFO, sdev,
"Trying ioctl with scsi command %d\n", *cmd));
- result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, 0,
- &sshdr, timeout, retries, NULL);
+ result = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_IN, NULL, 0, timeout,
+ retries,
+ ((struct scsi_exec_args) { .sshdr = &sshdr }));
SCSI_LOG_IOCTL(2, sdev_printk(KERN_INFO, sdev,
"Ioctl returned 0x%x\n", result));
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 327eb2df5583..403bcda8ef09 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -2130,8 +2130,9 @@ int scsi_mode_select(struct scsi_device *sdev, int pf, int sp,
cmd[4] = len;
}
- ret = scsi_execute_req(sdev, cmd, DMA_TO_DEVICE, real_buffer, len,
- sshdr, timeout, retries, NULL);
+ ret = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_OUT, real_buffer, len,
+ timeout, retries,
+ ((struct scsi_exec_args) { .sshdr = sshdr }));
kfree(real_buffer);
return ret;
}
@@ -2195,8 +2196,9 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage,
memset(buffer, 0, len);
- result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer, len,
- sshdr, timeout, retries, NULL);
+ result = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_IN, buffer, len,
+ timeout, retries,
+ ((struct scsi_exec_args) { .sshdr = sshdr }));
if (result < 0)
return result;
@@ -2280,8 +2282,11 @@ scsi_test_unit_ready(struct scsi_device *sdev, int timeout, int retries,
/* try to eat the UNIT_ATTENTION if there are enough retries */
do {
- result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, 0, sshdr,
- timeout, 1, NULL);
+ result = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_IN, NULL, 0,
+ timeout, 1,
+ ((struct scsi_exec_args) {
+ .sshdr = sshdr
+ }));
if (sdev->removable && scsi_sense_valid(sshdr) &&
sshdr->sense_key == UNIT_ATTENTION)
sdev->changed = 1;
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 5d27f5196de6..1af75cff9489 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -210,8 +210,8 @@ static void scsi_unlock_floptical(struct scsi_device *sdev,
scsi_cmd[3] = 0;
scsi_cmd[4] = 0x2a; /* size */
scsi_cmd[5] = 0;
- scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE, result, 0x2a, NULL,
- SCSI_TIMEOUT, 3, NULL);
+ __scsi_execute_cmd(sdev, scsi_cmd, REQ_OP_DRV_IN, result, 0x2a,
+ SCSI_TIMEOUT, 3, NULL);
}
static int scsi_realloc_sdev_budget_map(struct scsi_device *sdev,
@@ -674,10 +674,13 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,
memset(inq_result, 0, try_inquiry_len);
- result = scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE,
- inq_result, try_inquiry_len, &sshdr,
+ result = scsi_execute_cmd(sdev, scsi_cmd, REQ_OP_DRV_IN,
+ inq_result, try_inquiry_len,
HZ / 2 + HZ * scsi_inq_timeout, 3,
- &resid);
+ ((struct scsi_exec_args) {
+ .sshdr = &sshdr,
+ .resid = &resid
+ }));
SCSI_LOG_SCAN_BUS(3, sdev_printk(KERN_INFO, sdev,
"scsi scan: INQUIRY %s with code 0x%x\n",
@@ -1477,9 +1480,12 @@ static int scsi_report_lun_scan(struct scsi_target *starget, blist_flags_t bflag
"scsi scan: Sending REPORT LUNS to (try %d)\n",
retries));
- result = scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE,
- lun_data, length, &sshdr,
- SCSI_REPORT_LUNS_TIMEOUT, 3, NULL);
+ result = scsi_execute_cmd(sdev, scsi_cmd, REQ_OP_DRV_IN,
+ lun_data, length,
+ SCSI_REPORT_LUNS_TIMEOUT, 3,
+ ((struct scsi_exec_args) {
+ .sshdr = &sshdr
+ }));
SCSI_LOG_SCAN_BUS(3, sdev_printk (KERN_INFO, sdev,
"scsi scan: REPORT LUNS"
--
2.25.1
next prev parent reply other threads:[~2022-11-22 3:40 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-22 3:39 [PATCH 00/15] Add struct to pass in optional args to scsi_execute Mike Christie
2022-11-22 3:39 ` [PATCH 01/15] scsi: Add struct for args to execution functions Mike Christie
2022-11-22 6:36 ` Christoph Hellwig
2022-11-22 9:16 ` John Garry
2022-11-22 15:44 ` Mike Christie
2022-11-22 3:39 ` [PATCH 02/15] scsi: libata: Convert to scsi_execute_cmd Mike Christie
2022-11-22 3:39 ` [PATCH 03/15] hwmon: drivetemp: " Mike Christie
2022-11-22 3:39 ` [PATCH 04/15] scsi: ch: " Mike Christie
2022-11-22 3:39 ` [PATCH 05/15] scsi: scsi_dh: " Mike Christie
2022-11-22 3:39 ` Mike Christie [this message]
2022-11-22 6:38 ` [PATCH 06/15] scsi: core: " Christoph Hellwig
2022-11-22 16:13 ` Mike Christie
2022-11-22 18:46 ` Bart Van Assche
2022-11-22 20:06 ` Mike Christie
2022-11-22 3:39 ` [PATCH 07/15] scsi: spi: " Mike Christie
2022-11-22 3:39 ` [PATCH 08/15] scsi: sd: " Mike Christie
2022-11-22 3:39 ` [PATCH 09/15] scsi: zbc: " Mike Christie
2022-11-22 3:39 ` [PATCH 10/15] scsi: ses: " Mike Christie
2022-11-22 3:39 ` [PATCH 11/15] scsi: sr: " Mike Christie
2022-11-22 3:39 ` [PATCH 12/15] scsi: virtio_scsi: " Mike Christie
2022-11-22 3:39 ` [PATCH 13/15] scsi: target_core_pscsi: " Mike Christie
2022-11-22 3:39 ` [PATCH 14/15] scsi: cxlflash: " Mike Christie
2022-11-22 3:39 ` [PATCH 15/15] scsi: Remove scsi_execute functions Mike Christie
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=20221122033934.33797-7-michael.christie@oracle.com \
--to=michael.christie@oracle.com \
--cc=bvanassche@acm.org \
--cc=hch@lst.de \
--cc=james.bottomley@hansenpartnership.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mwilck@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox