Remove the request pointer from struct scsi_cmnd
Subsystems (40)
Bart Van Assche
maintainercover Remove the request pointer from struct scsi_cmnd
Hi Martin,
This patch series implements the following two changes for all SCSI drivers:
- Use blk_mq_rq_from_pdu() instead of the request member of struct scsi_cmnd since adding an offset to a pointer is faster than pointer indirection.
- Remove the request pointer from struct scsi_cmnd.
Please consider this patch series for kernel v5.14.
Thanks,
Bart.
Bart Van Assche (50):
core: Introduce the blk_req() function
core: Use blk_req() instead of scsi_cmnd.request
sd: Use blk_req() instead of scsi_cmnd.request
sr: Use blk_req() instead of scsi_cmnd.request
scsi_transport_fc: Use blk_req() instead of scsi_cmnd.request
scsi_transport_spi: Use blk_req() instead of scsi_cmnd.request
ata: Use blk_req() instead of scsi_cmnd.request rdma/iser: Use blk_req() instead of scsi_cmnd.request rdma/srp: Use blk_req() instead of scsi_cmnd.request
zfcp: Use blk_req() instead of scsi_cmnd.request 53c700: Use blk_req() instead of scsi_cmnd.request
NCR5380: Use blk_req() instead of scsi_cmnd.request
aacraid: Use blk_req() instead of scsi_cmnd.request
advansys: Use blk_req() instead of scsi_cmnd.request
bnx2i: Use blk_req() instead of scsi_cmnd.request
csiostor: Use blk_req() instead of scsi_cmnd.request
cxlflash: Use blk_req() instead of scsi_cmnd.request
dpt_i2o: Use blk_req() instead of scsi_cmnd.request
fnic: Use blk_req() instead of scsi_cmnd.request
hisi_sas: Use blk_req() instead of scsi_cmnd.request
hpsa: Use blk_req() instead of scsi_cmnd.request
ibmvfc: Use blk_req() instead of scsi_cmnd.request
ibmvscsi: Use blk_req() instead of scsi_cmnd.request
ips: Use blk_req() instead of scsi_cmnd.request
libsas: Use blk_req() instead of scsi_cmnd.request
lpfc: Use blk_req() instead of scsi_cmnd.request
megaraid: Use blk_req() instead of scsi_cmnd.request
mpt3sas: Use blk_req() instead of scsi_cmnd.request
mvumi: Use blk_req() instead of scsi_cmnd.request
myrb: Use blk_req() instead of scsi_cmnd.request
myrs: Use blk_req() instead of scsi_cmnd.request
ncr53c8xx: Use blk_req() instead of scsi_cmnd.request
qedf: Use blk_req() instead of scsi_cmnd.request
qedi: Use blk_req() instead of scsi_cmnd.request
qla1280: Use blk_req() instead of scsi_cmnd.request
qla2xxx: Use blk_req() instead of scsi_cmnd.request
qla4xxx: Use blk_req() instead of scsi_cmnd.request
qlogicpti: Use blk_req() instead of scsi_cmnd.request
scsi_debug: Use blk_req() instead of scsi_cmnd.request
smartpqi: Use blk_req() instead of scsi_cmnd.request
snic: Use blk_req() instead of scsi_cmnd.request
stex: Use blk_req() instead of scsi_cmnd.request
sun3_scsi: Use blk_req() instead of scsi_cmnd.request
sym53c8xx: Use blk_req() instead of scsi_cmnd.request
ufs: Use blk_req() instead of scsi_cmnd.request
virtio_scsi: Use blk_req() instead of scsi_cmnd.request
xen-scsifront: Use blk_req() instead of scsi_cmnd.request
tcm_loop: Use blk_req() instead of scsi_cmnd.request
usb-storage: Use blk_req() instead of scsi_cmnd.request
core: Remove the request member from struct scsi_cmnd
drivers/ata/libata-eh.c | 5 +- drivers/ata/libata-scsi.c | 10 ++-- drivers/infiniband/ulp/iser/iser_memory.c | 2 +- drivers/infiniband/ulp/srp/ib_srp.c | 6 +- drivers/s390/scsi/zfcp_fsf.c | 2 +- drivers/scsi/53c700.c | 2 +- drivers/scsi/NCR5380.c | 6 +- drivers/scsi/aacraid/aachba.c | 2 +- drivers/scsi/aacraid/commsup.c | 2 +- drivers/scsi/advansys.c | 4 +- drivers/scsi/bnx2i/bnx2i_hwi.c | 2 +- drivers/scsi/csiostor/csio_scsi.c | 6 +- drivers/scsi/cxlflash/main.c | 2 +- drivers/scsi/dpt_i2o.c | 4 +- drivers/scsi/fnic/fnic_scsi.c | 40 ++++++------- drivers/scsi/hisi_sas/hisi_sas_main.c | 4 +- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 +- drivers/scsi/hpsa.c | 6 +- drivers/scsi/ibmvscsi/ibmvfc.c | 2 +- drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +- drivers/scsi/ips.c | 2 +- drivers/scsi/libsas/sas_ata.c | 2 +- drivers/scsi/libsas/sas_scsi_host.c | 2 +- drivers/scsi/lpfc/lpfc_scsi.c | 63 ++++++++++----------- drivers/scsi/megaraid/megaraid_sas_base.c | 4 +- drivers/scsi/megaraid/megaraid_sas_fusion.c | 10 ++-- drivers/scsi/mpt3sas/mpt3sas_base.c | 4 +- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 6 +- drivers/scsi/mvumi.c | 2 +- drivers/scsi/myrb.c | 10 ++-- drivers/scsi/myrs.c | 10 ++-- drivers/scsi/ncr53c8xx.c | 4 +- drivers/scsi/qedf/qedf_io.c | 8 +-- drivers/scsi/qedi/qedi_fw.c | 9 +-- drivers/scsi/qla1280.c | 6 +- drivers/scsi/qla2xxx/qla_os.c | 4 +- drivers/scsi/qla4xxx/ql4_iocb.c | 2 +- drivers/scsi/qla4xxx/ql4_os.c | 4 +- drivers/scsi/qlogicpti.c | 2 +- drivers/scsi/scsi.c | 2 +- drivers/scsi/scsi_debug.c | 13 +++-- drivers/scsi/scsi_error.c | 15 +++-- drivers/scsi/scsi_lib.c | 27 +++++---- drivers/scsi/scsi_logging.c | 18 +++--- drivers/scsi/scsi_transport_fc.c | 2 +- drivers/scsi/scsi_transport_spi.c | 2 +- drivers/scsi/sd.c | 32 +++++------ drivers/scsi/sd_zbc.c | 10 ++-- drivers/scsi/smartpqi/smartpqi_init.c | 4 +- drivers/scsi/snic/snic_scsi.c | 10 ++-- drivers/scsi/sr.c | 10 ++-- drivers/scsi/stex.c | 6 +- drivers/scsi/sun3_scsi.c | 2 +- drivers/scsi/sym53c8xx_2/sym_glue.c | 4 +- drivers/scsi/ufs/ufshcd.c | 22 +++---- drivers/scsi/virtio_scsi.c | 4 +- drivers/scsi/xen-scsifront.c | 2 +- drivers/target/loopback/tcm_loop.c | 4 +- drivers/usb/storage/transport.c | 2 +- include/scsi/scsi_cmnd.h | 13 +++-- include/scsi/scsi_device.h | 16 +++--- 61 files changed, 239 insertions(+), 246 deletions(-)
Bart Van Assche
maintainerPATCH 1/50 core: Introduce the blk_req() function
The 'request' member of struct scsi_cmnd is superfluous. The struct request and struct scsi_cmnd data structures are adjacent and hence the request pointer can be derived easily from a scsi_cmnd pointer. Introduce a helper function that performs that conversion in a type-safe way. This patch is the first step towards removing the request member from struct scsi_cmnd. Making that change has the following advantages:
- This is a performance optimization since adding an offset to a pointer takes less time than dereferencing a pointer.
- struct scsi_cmnd becomes smaller.
--- include/scsi/scsi_cmnd.h | 6 ++++++ 1 file changed, 6 insertions(+)
include/scsi/scsi_cmnd.h +6 -0
@@ -146,6 +146,12 @@ struct scsi_cmnd {unsigned int extra_len;/* length of alignment and padding */ }; +/* Variant of blk_mq_rq_from_pdu() that verifies the type of its argument. */ +static inline struct request *blk_req (struct scsi_cmnd *scmd) +{ +return blk_mq_rq_from_pdu (scmd); +} +/* * Return the driver private allocation behind the command. * Only works if cmd_size is set in the host template.
Re: [PATCH 01/50] core: Introduce the blk_req() function
include/scsi/scsi_cmnd.h struct scsi_cmnd { · line 150
Quoted 2 lines
include/scsi/scsi_cmnd.h +2
-0+/* Variant of blk_mq_rq_from_pdu() that verifies the type of its argument. */ +static inline struct request *blk_req (struct scsi_cmnd *scmd)
Please don't use a blk_ prefix for a SCSI funtion. Why not scsi_scmd_to_rq or something like that?
Bart Van Assche
maintainerRe: [PATCH 01/50] core: Introduce the blk_req() function
Quoted 5 lines · Christoph Hellwig
include/scsi/scsi_cmnd.h struct scsi_cmnd { · line 150
Quoted 2 lines
include/scsi/scsi_cmnd.h +2
-0+/* Variant of blk_mq_rq_from_pdu() that verifies the type of its argument. */ +static inline struct request *blk_req (struct scsi_cmnd *scmd)Please don't use a
blk_prefix for a SCSI funtion. Why notscsi_scmd_to_rqor something like that?
Hi Christoph,
Thanks for having taken a look. I will rename that function into scsi_cmd_to_rq().
Bart.
Bart Van Assche
maintainerPATCH 1/50 core: Introduce the blk_req() function
In reply to Bart Van AsscheThe 'request' member of struct scsi_cmnd is superfluous. The struct request and struct scsi_cmnd data structures are adjacent and hence the request pointer can be derived easily from a scsi_cmnd pointer. Introduce a helper function that performs that conversion in a type-safe way. This patch is the first step towards removing the request member from struct scsi_cmnd. Making that change has the following advantages:
- This is a performance optimization since adding an offset to a pointer takes less time than dereferencing a pointer.
- struct scsi_cmnd becomes smaller.
--- include/scsi/scsi_cmnd.h | 6 ++++++ 1 file changed, 6 insertions(+)
include/scsi/scsi_cmnd.h +6 -0
@@ -146,6 +146,12 @@ struct scsi_cmnd {unsigned int extra_len;/* length of alignment and padding */ }; +/* Variant of blk_mq_rq_from_pdu() that verifies the type of its argument. */ +static inline struct request *blk_req (struct scsi_cmnd *scmd) +{ +return blk_mq_rq_from_pdu (scmd); +} +/* * Return the driver private allocation behind the command. * Only works if cmd_size is set in the host template.
Bart Van Assche
maintainerPATCH 2/50 core: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/scsi.c | 2 +- drivers/scsi/scsi_error.c | 14 +++++++------- drivers/scsi/scsi_lib.c | 26 +++++++++++++------------- drivers/scsi/scsi_logging.c | 18 ++++++++++-------- include/scsi/scsi_cmnd.h | 4 ++-- include/scsi/scsi_device.h | 16 +++++++++------- 6 files changed, 42 insertions(+), 38 deletions(-)
drivers/scsi/scsi.c +1 -1
@@ -197,7 +197,7 @@ void scsi_finish_command(struct scsi_cmnd *cmd) "(result %x)\n", cmd->result)); good_bytes =scsi_bufflen (cmd); -if (!blk_rq_is_passthrough (cmd->request)) { +if (!blk_rq_is_passthrough (blk_req (cmd))) {int old_good_bytes = good_bytes; drv =scsi_cmd_to_driver (cmd);if (drv->done)
drivers/scsi/scsi_error.c +7 -7
@@ -242,7 +242,7 @@ scsi_abort_command(struct scsi_cmnd *scmd)*/ static void scsi_eh_reset (struct scsi_cmnd *scmd) { -if (!blk_rq_is_passthrough (scmd->request)) { +if (!blk_rq_is_passthrough (blk_req (scmd))) {struct scsi_driver *sdrv =scsi_cmd_to_driver (scmd);if (sdrv->eh_reset) sdrv->eh_reset (scmd);
@@ -1188,7 +1188,7 @@ static enum scsi_disposition scsi_request_sense(struct scsi_cmnd *scmd)static enum scsi_disposition scsi_eh_action (struct scsi_cmnd *scmd,enum scsi_disposition rtn) { -if (!blk_rq_is_passthrough (scmd->request)) { +if (!blk_rq_is_passthrough (blk_req (scmd))) {struct scsi_driver *sdrv =scsi_cmd_to_driver (scmd);if (sdrv->eh_action) rtn = sdrv->eh_action (scmd, rtn);
@@ -1762,16 +1762,16 @@ int scsi_noretry_cmd(struct scsi_cmnd *scmd)case DID_TIME_OUT : goto check_type;case DID_BUS_BUSY : -return (scmd->request->cmd_flags &REQ_FAILFAST_TRANSPORT ); +return blk_req (scmd)->cmd_flags &REQ_FAILFAST_TRANSPORT ;case DID_PARITY : -return (scmd->request->cmd_flags &REQ_FAILFAST_DEV ); +return blk_req (scmd)->cmd_flags &REQ_FAILFAST_DEV ;case DID_ERROR :if (msg_byte (scmd->result) ==COMMAND_COMPLETE &&status_byte (scmd->result) ==RESERVATION_CONFLICT )return 0 ; fallthrough;case DID_SOFT_ERROR : -return (scmd->request->cmd_flags &REQ_FAILFAST_DRIVER ); +return blk_req (scmd)->cmd_flags &REQ_FAILFAST_DRIVER ; }if (status_byte (scmd->result) !=CHECK_CONDITION )
@@ -1782,8 +1782,8 @@ int scsi_noretry_cmd(struct scsi_cmnd *scmd)* assume caller has checked sense and determined * the check condition was retryable. */ -if (scmd->request->cmd_flags &REQ_FAILFAST_DEV || -blk_rq_is_passthrough (scmd->request)) +if (blk_req (scmd)->cmd_flags &REQ_FAILFAST_DEV || +blk_rq_is_passthrough (blk_req (scmd)))return 1 ;return 0 ;
drivers/scsi/scsi_lib.c +13 -13
@@ -119,13 +119,13 @@ scsi_set_blocked(struct scsi_cmnd *cmd, int reason)static void scsi_mq_requeue_cmd (struct scsi_cmnd *cmd) { -if (cmd->request->rq_flags &RQF_DONTPREP ) { - cmd->request->rq_flags &= ~RQF_DONTPREP ; +if (blk_req (cmd)->rq_flags &RQF_DONTPREP ) { +blk_req (cmd)->rq_flags &= ~RQF_DONTPREP ;scsi_mq_uninit_cmd (cmd); }else {WARN_ON_ONCE (true); } -blk_mq_requeue_request (cmd->request, true); +blk_mq_requeue_request (blk_req (cmd), true); }/**
@@ -164,7 +164,7 @@ static void __scsi_queue_insert(struct scsi_cmnd *cmd, int reason, bool unbusy)*/ cmd->result =0 ; -blk_mq_requeue_request (cmd->request, true); +blk_mq_requeue_request (blk_req (cmd), true); }/**
@@ -475,7 +475,7 @@ void scsi_run_host_queues(struct Scsi_Host *shost)static void scsi_uninit_cmd (struct scsi_cmnd *cmd) { -if (!blk_rq_is_passthrough (cmd->request)) { +if (!blk_rq_is_passthrough (blk_req (cmd))) {struct scsi_driver *drv =scsi_cmd_to_driver (cmd);if (drv->uninit_command)
@@ -626,7 +626,7 @@ static void scsi_io_completion_reprep(struct scsi_cmnd *cmd,static bool scsi_cmd_runtime_exceeced (struct scsi_cmnd *cmd) { -struct request *req = cmd->request; +struct request *req =blk_req (cmd);unsigned long wait_for;if (cmd->allowed ==SCSI_CMD_RETRIES_NO_LIMIT )
@@ -645,7 +645,7 @@ static bool scsi_cmd_runtime_exceeced(struct scsi_cmnd *cmd)static void scsi_io_completion_action (struct scsi_cmnd *cmd,int result) {struct request_queue *q = cmd->device->request_queue; -struct request *req = cmd->request; +struct request *req =blk_req (cmd);int level =0 ;enum {ACTION_FAIL ,ACTION_REPREP ,ACTION_RETRY ,ACTION_DELAYED_RETRY } action;
@@ -819,7 +819,7 @@ static int scsi_io_completion_nz_result(struct scsi_cmnd *cmd, int result, {bool sense_valid;bool sense_current = true;/* false implies "deferred sense" */ -struct request *req = cmd->request; +struct request *req =blk_req (cmd);struct scsi_sense_hdr sshdr; sense_valid =scsi_command_normalize_sense (cmd, &sshdr);
@@ -908,7 +908,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) {int result = cmd->result;struct request_queue *q = cmd->device->request_queue; -struct request *req = cmd->request; +struct request *req =blk_req (cmd);blk_status_t blk_stat =BLK_STS_OK ;if (unlikely (result))/* a nz result may or may not be an error */
@@ -979,7 +979,7 @@ static inline bool scsi_cmd_needs_dma_drain(struct scsi_device *sdev,blk_status_t scsi_alloc_sgtables (struct scsi_cmnd *cmd) {struct scsi_device *sdev = cmd->device; -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);unsigned short nr_segs =blk_rq_nr_phys_segments (rq);struct scatterlist *last_sg =NULL ;blk_status_t ret;
@@ -1108,7 +1108,7 @@ void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd) {void *buf = cmd->sense_buffer;void *prot = cmd->prot_sdb; -struct request *rq =blk_mq_rq_from_pdu (cmd); +struct request *rq =blk_req (cmd);unsigned int flags = cmd->flags &SCMD_PRESERVED_FLAGS ;unsigned long jiffies_at_alloc;int retries, to_clear;
@@ -1573,12 +1573,12 @@ static blk_status_t scsi_prepare_cmd(struct request *req)static void scsi_mq_done (struct scsi_cmnd *cmd) { -if (unlikely (blk_should_fake_timeout (cmd->request->q))) +if (unlikely (blk_should_fake_timeout (blk_req (cmd)->q)))return ;if (unlikely (test_and_set_bit (SCMD_STATE_COMPLETE , &cmd->state)))return ;trace_scsi_dispatch_cmd_done (cmd); -blk_mq_complete_request (cmd->request); +blk_mq_complete_request (blk_req (cmd)); }static void scsi_mq_put_budget (struct request_queue *q,int budget_token)
drivers/scsi/scsi_logging.c +10 -8
@@ -28,8 +28,9 @@ static void scsi_log_release_buffer(char *bufptr)static inline const char *scmd_name (const struct scsi_cmnd *scmd) { -return scmd->request->rq_disk ? - scmd->request->rq_disk->disk_name :NULL ; +struct request *rq =blk_req ((struct scsi_cmnd *)scmd); + +return rq->rq_disk ? rq->rq_disk->disk_name :NULL ; } static size_t sdev_format_header(char *logbuf, size_t logbuf_len,
@@ -91,7 +92,7 @@ void scmd_printk(const char *level, const struct scsi_cmnd *scmd,if (!logbuf)return ; off =sdev_format_header (logbuf, logbuf_len,scmd_name (scmd), - scmd->request->tag); +blk_req ((struct scsi_cmnd *)scmd)->tag);if (off < logbuf_len) {va_start (args, fmt); off +=vscnprintf (logbuf + off, logbuf_len - off, fmt, args);
@@ -188,7 +189,7 @@ void scsi_print_command(struct scsi_cmnd *cmd)return ; off =sdev_format_header (logbuf, logbuf_len, -scmd_name (cmd), cmd->request->tag); +scmd_name (cmd),blk_req (cmd)->tag);if (off >= logbuf_len) goto out_printk; off +=scnprintf (logbuf + off, logbuf_len - off,"CDB: " );
@@ -210,7 +211,7 @@ void scsi_print_command(struct scsi_cmnd *cmd) off =sdev_format_header (logbuf, logbuf_len,scmd_name (cmd), - cmd->request->tag); +blk_req (cmd)->tag);if (!WARN_ON (off > logbuf_len -58 )) { off +=scnprintf (logbuf + off, logbuf_len - off,"CDB[%02x]: " , k);
@@ -373,7 +374,8 @@ EXPORT_SYMBOL(__scsi_print_sense);/* Normalize and print sense buffer in SCSI command */ void scsi_print_sense (const struct scsi_cmnd *cmd) { -scsi_log_print_sense (cmd->device,scmd_name (cmd), cmd->request->tag, +scsi_log_print_sense (cmd->device,scmd_name (cmd), +blk_req ((struct scsi_cmnd *)cmd)->tag, cmd->sense_buffer,SCSI_SENSE_BUFFERSIZE ); }EXPORT_SYMBOL (scsi_print_sense);
@@ -392,8 +394,8 @@ void scsi_print_result(const struct scsi_cmnd *cmd, const char *msg,if (!logbuf)return ; - off =sdev_format_header (logbuf, logbuf_len, -scmd_name (cmd), cmd->request->tag); + off =sdev_format_header (logbuf, logbuf_len,scmd_name (cmd), +blk_req ((struct scsi_cmnd *)cmd)->tag);if (off >= logbuf_len) goto out_printk;
include/scsi/scsi_cmnd.h +2 -2
@@ -164,7 +164,7 @@ static inline void *scsi_cmd_priv(struct scsi_cmnd *cmd)/* make sure not to use it with passthrough commands */ static inline struct scsi_driver *scsi_cmd_to_driver (struct scsi_cmnd *cmd) { -return *(struct scsi_driver **)cmd->request->rq_disk->private_data; +return *(struct scsi_driver **)blk_req (cmd)->rq_disk->private_data; }extern void scsi_finish_command (struct scsi_cmnd *cmd);
@@ -290,7 +290,7 @@ static inline unsigned char scsi_get_prot_type(struct scsi_cmnd *scmd)static inline sector_t scsi_get_lba (struct scsi_cmnd *scmd) { -return blk_rq_pos (scmd->request); +return blk_rq_pos (blk_req (scmd)); }static inline unsigned int scsi_prot_interval (struct scsi_cmnd *scmd)
include/scsi/scsi_device.h +9 -7
@@ -265,13 +265,15 @@ sdev_prefix_printk(const char *, const struct scsi_device *, const char *, __printf(3, 4) voidscmd_printk (const char *,const struct scsi_cmnd *,const char *, ...); -#define scmd_dbg(scmd, fmt, a...) \ - do { \ - if ((scmd)->request->rq_disk) \ - sdev_dbg((scmd)->device, "[%s] " fmt, \ - (scmd)->request->rq_disk->disk_name, ##a);\ - else \ - sdev_dbg((scmd)->device, fmt, ##a); \ +#define scmd_dbg(scmd, fmt, a...) \ + do { \ + struct request *rq = blk_req((scmd)); \ + \ + if (rq->rq_disk) \ + sdev_dbg((scmd)->device, "[%s] " fmt, \ + rq->rq_disk->disk_name, ##a); \ + else \ + sdev_dbg((scmd)->device, fmt, ##a); \ } while (0)enum scsi_target_state {
Bart Van Assche
maintainerPATCH 2/50 core: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/scsi.c | 2 +- drivers/scsi/scsi_error.c | 14 +++++++------- drivers/scsi/scsi_lib.c | 26 +++++++++++++------------- drivers/scsi/scsi_logging.c | 18 ++++++++++-------- include/scsi/scsi_cmnd.h | 4 ++-- include/scsi/scsi_device.h | 16 +++++++++------- 6 files changed, 42 insertions(+), 38 deletions(-)
drivers/scsi/scsi.c +1 -1
@@ -197,7 +197,7 @@ void scsi_finish_command(struct scsi_cmnd *cmd) "(result %x)\n", cmd->result)); good_bytes =scsi_bufflen (cmd); -if (!blk_rq_is_passthrough (cmd->request)) { +if (!blk_rq_is_passthrough (blk_req (cmd))) {int old_good_bytes = good_bytes; drv =scsi_cmd_to_driver (cmd);if (drv->done)
drivers/scsi/scsi_error.c +7 -7
@@ -242,7 +242,7 @@ scsi_abort_command(struct scsi_cmnd *scmd)*/ static void scsi_eh_reset (struct scsi_cmnd *scmd) { -if (!blk_rq_is_passthrough (scmd->request)) { +if (!blk_rq_is_passthrough (blk_req (scmd))) {struct scsi_driver *sdrv =scsi_cmd_to_driver (scmd);if (sdrv->eh_reset) sdrv->eh_reset (scmd);
@@ -1188,7 +1188,7 @@ static enum scsi_disposition scsi_request_sense(struct scsi_cmnd *scmd)static enum scsi_disposition scsi_eh_action (struct scsi_cmnd *scmd,enum scsi_disposition rtn) { -if (!blk_rq_is_passthrough (scmd->request)) { +if (!blk_rq_is_passthrough (blk_req (scmd))) {struct scsi_driver *sdrv =scsi_cmd_to_driver (scmd);if (sdrv->eh_action) rtn = sdrv->eh_action (scmd, rtn);
@@ -1762,16 +1762,16 @@ int scsi_noretry_cmd(struct scsi_cmnd *scmd)case DID_TIME_OUT : goto check_type;case DID_BUS_BUSY : -return (scmd->request->cmd_flags &REQ_FAILFAST_TRANSPORT ); +return blk_req (scmd)->cmd_flags &REQ_FAILFAST_TRANSPORT ;case DID_PARITY : -return (scmd->request->cmd_flags &REQ_FAILFAST_DEV ); +return blk_req (scmd)->cmd_flags &REQ_FAILFAST_DEV ;case DID_ERROR :if (msg_byte (scmd->result) ==COMMAND_COMPLETE &&status_byte (scmd->result) ==RESERVATION_CONFLICT )return 0 ; fallthrough;case DID_SOFT_ERROR : -return (scmd->request->cmd_flags &REQ_FAILFAST_DRIVER ); +return blk_req (scmd)->cmd_flags &REQ_FAILFAST_DRIVER ; }if (status_byte (scmd->result) !=CHECK_CONDITION )
@@ -1782,8 +1782,8 @@ int scsi_noretry_cmd(struct scsi_cmnd *scmd)* assume caller has checked sense and determined * the check condition was retryable. */ -if (scmd->request->cmd_flags &REQ_FAILFAST_DEV || -blk_rq_is_passthrough (scmd->request)) +if (blk_req (scmd)->cmd_flags &REQ_FAILFAST_DEV || +blk_rq_is_passthrough (blk_req (scmd)))return 1 ;return 0 ;
drivers/scsi/scsi_lib.c +13 -13
@@ -119,13 +119,13 @@ scsi_set_blocked(struct scsi_cmnd *cmd, int reason)static void scsi_mq_requeue_cmd (struct scsi_cmnd *cmd) { -if (cmd->request->rq_flags &RQF_DONTPREP ) { - cmd->request->rq_flags &= ~RQF_DONTPREP ; +if (blk_req (cmd)->rq_flags &RQF_DONTPREP ) { +blk_req (cmd)->rq_flags &= ~RQF_DONTPREP ;scsi_mq_uninit_cmd (cmd); }else {WARN_ON_ONCE (true); } -blk_mq_requeue_request (cmd->request, true); +blk_mq_requeue_request (blk_req (cmd), true); }/**
@@ -164,7 +164,7 @@ static void __scsi_queue_insert(struct scsi_cmnd *cmd, int reason, bool unbusy)*/ cmd->result =0 ; -blk_mq_requeue_request (cmd->request, true); +blk_mq_requeue_request (blk_req (cmd), true); }/**
@@ -475,7 +475,7 @@ void scsi_run_host_queues(struct Scsi_Host *shost)static void scsi_uninit_cmd (struct scsi_cmnd *cmd) { -if (!blk_rq_is_passthrough (cmd->request)) { +if (!blk_rq_is_passthrough (blk_req (cmd))) {struct scsi_driver *drv =scsi_cmd_to_driver (cmd);if (drv->uninit_command)
@@ -626,7 +626,7 @@ static void scsi_io_completion_reprep(struct scsi_cmnd *cmd,static bool scsi_cmd_runtime_exceeced (struct scsi_cmnd *cmd) { -struct request *req = cmd->request; +struct request *req =blk_req (cmd);unsigned long wait_for;if (cmd->allowed ==SCSI_CMD_RETRIES_NO_LIMIT )
@@ -645,7 +645,7 @@ static bool scsi_cmd_runtime_exceeced(struct scsi_cmnd *cmd)static void scsi_io_completion_action (struct scsi_cmnd *cmd,int result) {struct request_queue *q = cmd->device->request_queue; -struct request *req = cmd->request; +struct request *req =blk_req (cmd);int level =0 ;enum {ACTION_FAIL ,ACTION_REPREP ,ACTION_RETRY ,ACTION_DELAYED_RETRY } action;
@@ -819,7 +819,7 @@ static int scsi_io_completion_nz_result(struct scsi_cmnd *cmd, int result, {bool sense_valid;bool sense_current = true;/* false implies "deferred sense" */ -struct request *req = cmd->request; +struct request *req =blk_req (cmd);struct scsi_sense_hdr sshdr; sense_valid =scsi_command_normalize_sense (cmd, &sshdr);
@@ -908,7 +908,7 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) {int result = cmd->result;struct request_queue *q = cmd->device->request_queue; -struct request *req = cmd->request; +struct request *req =blk_req (cmd);blk_status_t blk_stat =BLK_STS_OK ;if (unlikely (result))/* a nz result may or may not be an error */
@@ -979,7 +979,7 @@ static inline bool scsi_cmd_needs_dma_drain(struct scsi_device *sdev,blk_status_t scsi_alloc_sgtables (struct scsi_cmnd *cmd) {struct scsi_device *sdev = cmd->device; -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);unsigned short nr_segs =blk_rq_nr_phys_segments (rq);struct scatterlist *last_sg =NULL ;blk_status_t ret;
@@ -1108,7 +1108,7 @@ void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd) {void *buf = cmd->sense_buffer;void *prot = cmd->prot_sdb; -struct request *rq =blk_mq_rq_from_pdu (cmd); +struct request *rq =blk_req (cmd);unsigned int flags = cmd->flags &SCMD_PRESERVED_FLAGS ;unsigned long jiffies_at_alloc;int retries, to_clear;
@@ -1573,12 +1573,12 @@ static blk_status_t scsi_prepare_cmd(struct request *req)static void scsi_mq_done (struct scsi_cmnd *cmd) { -if (unlikely (blk_should_fake_timeout (cmd->request->q))) +if (unlikely (blk_should_fake_timeout (blk_req (cmd)->q)))return ;if (unlikely (test_and_set_bit (SCMD_STATE_COMPLETE , &cmd->state)))return ;trace_scsi_dispatch_cmd_done (cmd); -blk_mq_complete_request (cmd->request); +blk_mq_complete_request (blk_req (cmd)); }static void scsi_mq_put_budget (struct request_queue *q,int budget_token)
drivers/scsi/scsi_logging.c +10 -8
@@ -28,8 +28,9 @@ static void scsi_log_release_buffer(char *bufptr)static inline const char *scmd_name (const struct scsi_cmnd *scmd) { -return scmd->request->rq_disk ? - scmd->request->rq_disk->disk_name :NULL ; +struct request *rq =blk_req ((struct scsi_cmnd *)scmd); + +return rq->rq_disk ? rq->rq_disk->disk_name :NULL ; } static size_t sdev_format_header(char *logbuf, size_t logbuf_len,
@@ -91,7 +92,7 @@ void scmd_printk(const char *level, const struct scsi_cmnd *scmd,if (!logbuf)return ; off =sdev_format_header (logbuf, logbuf_len,scmd_name (scmd), - scmd->request->tag); +blk_req ((struct scsi_cmnd *)scmd)->tag);if (off < logbuf_len) {va_start (args, fmt); off +=vscnprintf (logbuf + off, logbuf_len - off, fmt, args);
@@ -188,7 +189,7 @@ void scsi_print_command(struct scsi_cmnd *cmd)return ; off =sdev_format_header (logbuf, logbuf_len, -scmd_name (cmd), cmd->request->tag); +scmd_name (cmd),blk_req (cmd)->tag);if (off >= logbuf_len) goto out_printk; off +=scnprintf (logbuf + off, logbuf_len - off,"CDB: " );
@@ -210,7 +211,7 @@ void scsi_print_command(struct scsi_cmnd *cmd) off =sdev_format_header (logbuf, logbuf_len,scmd_name (cmd), - cmd->request->tag); +blk_req (cmd)->tag);if (!WARN_ON (off > logbuf_len -58 )) { off +=scnprintf (logbuf + off, logbuf_len - off,"CDB[%02x]: " , k);
@@ -373,7 +374,8 @@ EXPORT_SYMBOL(__scsi_print_sense);/* Normalize and print sense buffer in SCSI command */ void scsi_print_sense (const struct scsi_cmnd *cmd) { -scsi_log_print_sense (cmd->device,scmd_name (cmd), cmd->request->tag, +scsi_log_print_sense (cmd->device,scmd_name (cmd), +blk_req ((struct scsi_cmnd *)cmd)->tag, cmd->sense_buffer,SCSI_SENSE_BUFFERSIZE ); }EXPORT_SYMBOL (scsi_print_sense);
@@ -392,8 +394,8 @@ void scsi_print_result(const struct scsi_cmnd *cmd, const char *msg,if (!logbuf)return ; - off =sdev_format_header (logbuf, logbuf_len, -scmd_name (cmd), cmd->request->tag); + off =sdev_format_header (logbuf, logbuf_len,scmd_name (cmd), +blk_req ((struct scsi_cmnd *)cmd)->tag);if (off >= logbuf_len) goto out_printk;
include/scsi/scsi_cmnd.h +2 -2
@@ -164,7 +164,7 @@ static inline void *scsi_cmd_priv(struct scsi_cmnd *cmd)/* make sure not to use it with passthrough commands */ static inline struct scsi_driver *scsi_cmd_to_driver (struct scsi_cmnd *cmd) { -return *(struct scsi_driver **)cmd->request->rq_disk->private_data; +return *(struct scsi_driver **)blk_req (cmd)->rq_disk->private_data; }extern void scsi_finish_command (struct scsi_cmnd *cmd);
@@ -290,7 +290,7 @@ static inline unsigned char scsi_get_prot_type(struct scsi_cmnd *scmd)static inline sector_t scsi_get_lba (struct scsi_cmnd *scmd) { -return blk_rq_pos (scmd->request); +return blk_rq_pos (blk_req (scmd)); }static inline unsigned int scsi_prot_interval (struct scsi_cmnd *scmd)
include/scsi/scsi_device.h +9 -7
@@ -265,13 +265,15 @@ sdev_prefix_printk(const char *, const struct scsi_device *, const char *, __printf(3, 4) voidscmd_printk (const char *,const struct scsi_cmnd *,const char *, ...); -#define scmd_dbg(scmd, fmt, a...) \ - do { \ - if ((scmd)->request->rq_disk) \ - sdev_dbg((scmd)->device, "[%s] " fmt, \ - (scmd)->request->rq_disk->disk_name, ##a);\ - else \ - sdev_dbg((scmd)->device, fmt, ##a); \ +#define scmd_dbg(scmd, fmt, a...) \ + do { \ + struct request *rq = blk_req((scmd)); \ + \ + if (rq->rq_disk) \ + sdev_dbg((scmd)->device, "[%s] " fmt, \ + rq->rq_disk->disk_name, ##a); \ + else \ + sdev_dbg((scmd)->device, fmt, ##a); \ } while (0)enum scsi_target_state {
Bart Van Assche
maintainerPATCH 3/50 sd: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/sd.c | 32 ++++++++++++++++---------------- drivers/scsi/sd_zbc.c | 10 +++++----- 2 files changed, 21 insertions(+), 21 deletions(-)
drivers/scsi/sd.c +16 -16
@@ -779,8 +779,8 @@ static unsigned int sd_prot_flag_mask(unsigned int prot_op)static unsigned char sd_setup_protect_cmnd (struct scsi_cmnd *scmd,unsigned int dix,unsigned int dif) { -struct bio *bio = scmd->request->bio; -unsigned int prot_op =sd_prot_op (rq_data_dir (scmd->request), dix, dif); +struct bio *bio =blk_req (scmd)->bio; +unsigned int prot_op =sd_prot_op (rq_data_dir (blk_req (scmd)), dix, dif);unsigned int protect =0 ;if (dix) {/* DIX Type 0, 1, 2, 3 */
@@ -871,7 +871,7 @@ static void sd_config_discard(struct scsi_disk *sdkp, unsigned int mode)static blk_status_t sd_setup_unmap_cmnd (struct scsi_cmnd *cmd) {struct scsi_device *sdp = cmd->device; -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);u64 lba =sectors_to_logical (sdp,blk_rq_pos (rq));u32 nr_blocks =sectors_to_logical (sdp,blk_rq_sectors (rq));
@@ -907,7 +907,7 @@ static blk_status_t sd_setup_write_same16_cmnd(struct scsi_cmnd *cmd, bool unmap) {struct scsi_device *sdp = cmd->device; -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);u64 lba =sectors_to_logical (sdp,blk_rq_pos (rq));u32 nr_blocks =sectors_to_logical (sdp,blk_rq_sectors (rq));
@@ -939,7 +939,7 @@ static blk_status_t sd_setup_write_same10_cmnd(struct scsi_cmnd *cmd, bool unmap) {struct scsi_device *sdp = cmd->device; -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);u64 lba =sectors_to_logical (sdp,blk_rq_pos (rq));u32 nr_blocks =sectors_to_logical (sdp,blk_rq_sectors (rq));
@@ -969,7 +969,7 @@ static blk_status_t sd_setup_write_same10_cmnd(struct scsi_cmnd *cmd,static blk_status_t sd_setup_write_zeroes_cmnd (struct scsi_cmnd *cmd) { -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);struct scsi_device *sdp = cmd->device;struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);u64 lba =sectors_to_logical (sdp,blk_rq_pos (rq));
@@ -1066,7 +1066,7 @@ static void sd_config_write_same(struct scsi_disk *sdkp)**/ static blk_status_t sd_setup_write_same_cmnd (struct scsi_cmnd *cmd) { -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);struct scsi_device *sdp = cmd->device;struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);struct bio *bio = rq->bio;
@@ -1115,7 +1115,7 @@ static blk_status_t sd_setup_write_same_cmnd(struct scsi_cmnd *cmd)static blk_status_t sd_setup_flush_cmnd (struct scsi_cmnd *cmd) { -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);/* flush requests don't perform I/O, zero the S/G table */
@@ -1213,7 +1213,7 @@ static blk_status_t sd_setup_rw6_cmnd(struct scsi_cmnd *cmd, bool write,static blk_status_t sd_setup_read_write_cmnd (struct scsi_cmnd *cmd) { -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);struct scsi_device *sdp = cmd->device;struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);sector_t lba =sectors_to_logical (sdp,blk_rq_pos (rq));
@@ -1327,7 +1327,7 @@ static blk_status_t sd_setup_read_write_cmnd(struct scsi_cmnd *cmd)static blk_status_t sd_init_command (struct scsi_cmnd *cmd) { -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);switch (req_op (rq)) {case REQ_OP_DISCARD :
@@ -1373,7 +1373,7 @@ static blk_status_t sd_init_command(struct scsi_cmnd *cmd)static void sd_uninit_command (struct scsi_cmnd *SCpnt) { -struct request *rq = SCpnt->request; +struct request *rq =blk_req (SCpnt);u8 *cmnd;if (rq->rq_flags &RQF_SPECIAL_PAYLOAD )
@@ -1906,7 +1906,7 @@ static const struct block_device_operations sd_fops = {**/ static void sd_eh_reset (struct scsi_cmnd *scmd) { -struct scsi_disk *sdkp =scsi_disk (scmd->request->rq_disk); +struct scsi_disk *sdkp =scsi_disk (blk_req (scmd)->rq_disk);/* New SCSI EH run, reset gate variable */ sdkp->ignore_medium_access_errors = false;
@@ -1926,7 +1926,7 @@ static void sd_eh_reset(struct scsi_cmnd *scmd)**/ static int sd_eh_action (struct scsi_cmnd *scmd,int eh_disp) { -struct scsi_disk *sdkp =scsi_disk (scmd->request->rq_disk); +struct scsi_disk *sdkp =scsi_disk (blk_req (scmd)->rq_disk);struct scsi_device *sdev = scmd->device; if (!scsi_device_online(sdev) ||
@@ -1967,7 +1967,7 @@ static int sd_eh_action(struct scsi_cmnd *scmd, int eh_disp)static unsigned int sd_completed_bytes (struct scsi_cmnd *scmd) { -struct request *req = scmd->request; +struct request *req =blk_req (scmd);struct scsi_device *sdev = scmd->device;unsigned int transferred, good_bytes;u64 start_lba, end_lba, bad_lba;
@@ -2022,8 +2022,8 @@ static int sd_done(struct scsi_cmnd *SCpnt)unsigned int sector_size = SCpnt->device->sector_size;unsigned int resid;struct scsi_sense_hdr sshdr; -struct scsi_disk *sdkp =scsi_disk (SCpnt->request->rq_disk); -struct request *req = SCpnt->request; +struct scsi_disk *sdkp =scsi_disk (blk_req (SCpnt)->rq_disk); +struct request *req =blk_req (SCpnt);int sense_valid =0 ;int sense_deferred =0 ;
drivers/scsi/sd_zbc.c +5 -5
@@ -244,7 +244,7 @@ int sd_zbc_report_zones(struct gendisk *disk, sector_t sector,static blk_status_t sd_zbc_cmnd_checks (struct scsi_cmnd *cmd) { -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);sector_t sector =blk_rq_pos (rq);
@@ -322,7 +322,7 @@ static void sd_zbc_update_wp_offset_workfn(struct work_struct *work)blk_status_t sd_zbc_prepare_zone_append (struct scsi_cmnd *cmd,sector_t *lba,unsigned int nr_blocks) { -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);unsigned int wp_offset, zno =blk_rq_zone_no (rq);unsigned long flags;
@@ -387,7 +387,7 @@ blk_status_t sd_zbc_prepare_zone_append(struct scsi_cmnd *cmd, sector_t *lba,blk_status_t sd_zbc_setup_zone_mgmt_cmnd (struct scsi_cmnd *cmd,unsigned char op,bool all) { -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);sector_t sector =blk_rq_pos (rq);struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);sector_t block =sectors_to_logical (sdkp->device, sector);
@@ -443,7 +443,7 @@ static unsigned int sd_zbc_zone_wp_update(struct scsi_cmnd *cmd, unsigned int good_bytes) {int result = cmd->result; -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);unsigned int zno =blk_rq_zone_no (rq);enum req_opf op =req_op (rq);
@@ -517,7 +517,7 @@ unsigned int sd_zbc_complete(struct scsi_cmnd *cmd, unsigned int good_bytes, struct scsi_sense_hdr *sshdr) {int result = cmd->result; -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd); if (op_is_zone_mgmt(req_op(rq)) && result &&
Bart Van Assche
maintainerPATCH 3/50 sd: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/sd.c | 32 ++++++++++++++++---------------- drivers/scsi/sd_zbc.c | 10 +++++----- 2 files changed, 21 insertions(+), 21 deletions(-)
drivers/scsi/sd.c +16 -16
@@ -779,8 +779,8 @@ static unsigned int sd_prot_flag_mask(unsigned int prot_op)static unsigned char sd_setup_protect_cmnd (struct scsi_cmnd *scmd,unsigned int dix,unsigned int dif) { -struct bio *bio = scmd->request->bio; -unsigned int prot_op =sd_prot_op (rq_data_dir (scmd->request), dix, dif); +struct bio *bio =blk_req (scmd)->bio; +unsigned int prot_op =sd_prot_op (rq_data_dir (blk_req (scmd)), dix, dif);unsigned int protect =0 ;if (dix) {/* DIX Type 0, 1, 2, 3 */
@@ -871,7 +871,7 @@ static void sd_config_discard(struct scsi_disk *sdkp, unsigned int mode)static blk_status_t sd_setup_unmap_cmnd (struct scsi_cmnd *cmd) {struct scsi_device *sdp = cmd->device; -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);u64 lba =sectors_to_logical (sdp,blk_rq_pos (rq));u32 nr_blocks =sectors_to_logical (sdp,blk_rq_sectors (rq));
@@ -907,7 +907,7 @@ static blk_status_t sd_setup_write_same16_cmnd(struct scsi_cmnd *cmd, bool unmap) {struct scsi_device *sdp = cmd->device; -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);u64 lba =sectors_to_logical (sdp,blk_rq_pos (rq));u32 nr_blocks =sectors_to_logical (sdp,blk_rq_sectors (rq));
@@ -939,7 +939,7 @@ static blk_status_t sd_setup_write_same10_cmnd(struct scsi_cmnd *cmd, bool unmap) {struct scsi_device *sdp = cmd->device; -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);u64 lba =sectors_to_logical (sdp,blk_rq_pos (rq));u32 nr_blocks =sectors_to_logical (sdp,blk_rq_sectors (rq));
@@ -969,7 +969,7 @@ static blk_status_t sd_setup_write_same10_cmnd(struct scsi_cmnd *cmd,static blk_status_t sd_setup_write_zeroes_cmnd (struct scsi_cmnd *cmd) { -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);struct scsi_device *sdp = cmd->device;struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);u64 lba =sectors_to_logical (sdp,blk_rq_pos (rq));
@@ -1066,7 +1066,7 @@ static void sd_config_write_same(struct scsi_disk *sdkp)**/ static blk_status_t sd_setup_write_same_cmnd (struct scsi_cmnd *cmd) { -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);struct scsi_device *sdp = cmd->device;struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);struct bio *bio = rq->bio;
@@ -1115,7 +1115,7 @@ static blk_status_t sd_setup_write_same_cmnd(struct scsi_cmnd *cmd)static blk_status_t sd_setup_flush_cmnd (struct scsi_cmnd *cmd) { -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);/* flush requests don't perform I/O, zero the S/G table */
@@ -1213,7 +1213,7 @@ static blk_status_t sd_setup_rw6_cmnd(struct scsi_cmnd *cmd, bool write,static blk_status_t sd_setup_read_write_cmnd (struct scsi_cmnd *cmd) { -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);struct scsi_device *sdp = cmd->device;struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);sector_t lba =sectors_to_logical (sdp,blk_rq_pos (rq));
@@ -1327,7 +1327,7 @@ static blk_status_t sd_setup_read_write_cmnd(struct scsi_cmnd *cmd)static blk_status_t sd_init_command (struct scsi_cmnd *cmd) { -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);switch (req_op (rq)) {case REQ_OP_DISCARD :
@@ -1373,7 +1373,7 @@ static blk_status_t sd_init_command(struct scsi_cmnd *cmd)static void sd_uninit_command (struct scsi_cmnd *SCpnt) { -struct request *rq = SCpnt->request; +struct request *rq =blk_req (SCpnt);u8 *cmnd;if (rq->rq_flags &RQF_SPECIAL_PAYLOAD )
@@ -1906,7 +1906,7 @@ static const struct block_device_operations sd_fops = {**/ static void sd_eh_reset (struct scsi_cmnd *scmd) { -struct scsi_disk *sdkp =scsi_disk (scmd->request->rq_disk); +struct scsi_disk *sdkp =scsi_disk (blk_req (scmd)->rq_disk);/* New SCSI EH run, reset gate variable */ sdkp->ignore_medium_access_errors = false;
@@ -1926,7 +1926,7 @@ static void sd_eh_reset(struct scsi_cmnd *scmd)**/ static int sd_eh_action (struct scsi_cmnd *scmd,int eh_disp) { -struct scsi_disk *sdkp =scsi_disk (scmd->request->rq_disk); +struct scsi_disk *sdkp =scsi_disk (blk_req (scmd)->rq_disk);struct scsi_device *sdev = scmd->device; if (!scsi_device_online(sdev) ||
@@ -1967,7 +1967,7 @@ static int sd_eh_action(struct scsi_cmnd *scmd, int eh_disp)static unsigned int sd_completed_bytes (struct scsi_cmnd *scmd) { -struct request *req = scmd->request; +struct request *req =blk_req (scmd);struct scsi_device *sdev = scmd->device;unsigned int transferred, good_bytes;u64 start_lba, end_lba, bad_lba;
@@ -2022,8 +2022,8 @@ static int sd_done(struct scsi_cmnd *SCpnt)unsigned int sector_size = SCpnt->device->sector_size;unsigned int resid;struct scsi_sense_hdr sshdr; -struct scsi_disk *sdkp =scsi_disk (SCpnt->request->rq_disk); -struct request *req = SCpnt->request; +struct scsi_disk *sdkp =scsi_disk (blk_req (SCpnt)->rq_disk); +struct request *req =blk_req (SCpnt);int sense_valid =0 ;int sense_deferred =0 ;
drivers/scsi/sd_zbc.c +5 -5
@@ -244,7 +244,7 @@ int sd_zbc_report_zones(struct gendisk *disk, sector_t sector,static blk_status_t sd_zbc_cmnd_checks (struct scsi_cmnd *cmd) { -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);sector_t sector =blk_rq_pos (rq);
@@ -322,7 +322,7 @@ static void sd_zbc_update_wp_offset_workfn(struct work_struct *work)blk_status_t sd_zbc_prepare_zone_append (struct scsi_cmnd *cmd,sector_t *lba,unsigned int nr_blocks) { -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);unsigned int wp_offset, zno =blk_rq_zone_no (rq);unsigned long flags;
@@ -387,7 +387,7 @@ blk_status_t sd_zbc_prepare_zone_append(struct scsi_cmnd *cmd, sector_t *lba,blk_status_t sd_zbc_setup_zone_mgmt_cmnd (struct scsi_cmnd *cmd,unsigned char op,bool all) { -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);sector_t sector =blk_rq_pos (rq);struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);sector_t block =sectors_to_logical (sdkp->device, sector);
@@ -443,7 +443,7 @@ static unsigned int sd_zbc_zone_wp_update(struct scsi_cmnd *cmd, unsigned int good_bytes) {int result = cmd->result; -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd);struct scsi_disk *sdkp =scsi_disk (rq->rq_disk);unsigned int zno =blk_rq_zone_no (rq);enum req_opf op =req_op (rq);
@@ -517,7 +517,7 @@ unsigned int sd_zbc_complete(struct scsi_cmnd *cmd, unsigned int good_bytes, struct scsi_sense_hdr *sshdr) {int result = cmd->result; -struct request *rq = cmd->request; +struct request *rq =blk_req (cmd); if (op_is_zone_mgmt(req_op(rq)) && result &&
Bart Van Assche
maintainerPATCH 4/50 sr: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/sr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/scsi/sr.c +5 -5
@@ -326,7 +326,7 @@ static int sr_done(struct scsi_cmnd *SCpnt)int good_bytes = (result ==0 ? this_count :0 );int block_sectors =0 ;long error_sector; -struct scsi_cd *cd =scsi_cd (SCpnt->request->rq_disk); +struct scsi_cd *cd =scsi_cd (blk_req (SCpnt)->rq_disk);#ifdef DEBUG scmd_printk (KERN_INFO , SCpnt,"done: %x\n" , result);
@@ -348,16 +348,16 @@ static int sr_done(struct scsi_cmnd *SCpnt)break ; error_sector =get_unaligned_be32 (&SCpnt->sense_buffer[3 ]); -if (SCpnt->request->bio !=NULL ) +if (blk_req (SCpnt)->bio !=NULL ) block_sectors = -bio_sectors (SCpnt->request->bio); +bio_sectors (blk_req (SCpnt)->bio);if (block_sectors <4 ) block_sectors =4 ;if (cd->device->sector_size ==2048 ) error_sector <<=2 ; error_sector &= ~(block_sectors -1 ); good_bytes = (error_sector - -blk_rq_pos (SCpnt->request)) <<9 ; +blk_rq_pos (blk_req (SCpnt))) <<9 ;if (good_bytes <0 || good_bytes >= this_count) good_bytes =0 ;/*
@@ -389,7 +389,7 @@ static blk_status_t sr_init_command(struct scsi_cmnd *SCpnt) {int block =0 , this_count, s_size;struct scsi_cd *cd; -struct request *rq = SCpnt->request; +struct request *rq =blk_req (SCpnt);blk_status_t ret; ret =scsi_alloc_sgtables (SCpnt);
Bart Van Assche
maintainerPATCH 4/50 sr: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/sr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/scsi/sr.c +5 -5
@@ -326,7 +326,7 @@ static int sr_done(struct scsi_cmnd *SCpnt)int good_bytes = (result ==0 ? this_count :0 );int block_sectors =0 ;long error_sector; -struct scsi_cd *cd =scsi_cd (SCpnt->request->rq_disk); +struct scsi_cd *cd =scsi_cd (blk_req (SCpnt)->rq_disk);#ifdef DEBUG scmd_printk (KERN_INFO , SCpnt,"done: %x\n" , result);
@@ -348,16 +348,16 @@ static int sr_done(struct scsi_cmnd *SCpnt)break ; error_sector =get_unaligned_be32 (&SCpnt->sense_buffer[3 ]); -if (SCpnt->request->bio !=NULL ) +if (blk_req (SCpnt)->bio !=NULL ) block_sectors = -bio_sectors (SCpnt->request->bio); +bio_sectors (blk_req (SCpnt)->bio);if (block_sectors <4 ) block_sectors =4 ;if (cd->device->sector_size ==2048 ) error_sector <<=2 ; error_sector &= ~(block_sectors -1 ); good_bytes = (error_sector - -blk_rq_pos (SCpnt->request)) <<9 ; +blk_rq_pos (blk_req (SCpnt))) <<9 ;if (good_bytes <0 || good_bytes >= this_count) good_bytes =0 ;/*
@@ -389,7 +389,7 @@ static blk_status_t sr_init_command(struct scsi_cmnd *SCpnt) {int block =0 , this_count, s_size;struct scsi_cd *cd; -struct request *rq = SCpnt->request; +struct request *rq =blk_req (SCpnt);blk_status_t ret; ret =scsi_alloc_sgtables (SCpnt);
Bart Van Assche
maintainerPATCH 5/50 scsi_transport_fc: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/scsi_transport_fc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_transport_fc.c +1 -1
@@ -3804,7 +3804,7 @@ bool fc_eh_should_retry_cmd(struct scsi_cmnd *scmd)struct fc_rport *rport =starget_to_rport (scsi_target (scmd->device));if ((rport->port_state !=FC_PORTSTATE_ONLINE ) && - (scmd->request->cmd_flags &REQ_FAILFAST_TRANSPORT )) { + (blk_req (scmd)->cmd_flags &REQ_FAILFAST_TRANSPORT )) {set_host_byte (scmd,DID_TRANSPORT_MARGINAL );return false; }
Bart Van Assche
maintainerPATCH 5/50 scsi_transport_fc: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/scsi_transport_fc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_transport_fc.c +1 -1
@@ -3804,7 +3804,7 @@ bool fc_eh_should_retry_cmd(struct scsi_cmnd *scmd)struct fc_rport *rport =starget_to_rport (scsi_target (scmd->device));if ((rport->port_state !=FC_PORTSTATE_ONLINE ) && - (scmd->request->cmd_flags &REQ_FAILFAST_TRANSPORT )) { + (blk_req (scmd)->cmd_flags &REQ_FAILFAST_TRANSPORT )) {set_host_byte (scmd,DID_TRANSPORT_MARGINAL );return false; }
Bart Van Assche
maintainerPATCH 6/50 scsi_transport_spi: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/scsi_transport_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_transport_spi.c +1 -1
@@ -1230,7 +1230,7 @@ int spi_populate_tag_msg(unsigned char *msg, struct scsi_cmnd *cmd) {if (cmd->flags &SCMD_TAGGED ) { *msg++ =SIMPLE_QUEUE_TAG ; - *msg++ = cmd->request->tag; + *msg++ =blk_req (cmd)->tag;return 2 ; }
Bart Van Assche
maintainerPATCH 6/50 scsi_transport_spi: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/scsi_transport_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_transport_spi.c +1 -1
@@ -1230,7 +1230,7 @@ int spi_populate_tag_msg(unsigned char *msg, struct scsi_cmnd *cmd) {if (cmd->flags &SCMD_TAGGED ) { *msg++ =SIMPLE_QUEUE_TAG ; - *msg++ = cmd->request->tag; + *msg++ =blk_req (cmd)->tag;return 2 ; }
Bart Van Assche
maintainerPATCH 7/50 ata: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/ata/libata-eh.c | 5 ++--- drivers/ata/libata-scsi.c | 10 +++++----- 2 files changed, 7 insertions(+), 8 deletions(-)
drivers/ata/libata-eh.c +2 -3
@@ -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 (blk_req (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 &&blk_req (qc->scsicmd)->rq_flags &RQF_QUIET ) qc->flags |=ATA_QCFLAG_QUIET ;return qc->flags &ATA_QCFLAG_QUIET ; }
drivers/ata/libata-scsi.c +5 -5
@@ -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,blk_req (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 (blk_req (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 =blk_req (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 =blk_req (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 (blk_req (scmd)))) goto invalid_opcode;if (unlikely (scmd->cmd_len <16 )) {
Bart Van Assche
maintainerPATCH 7/50 ata: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/ata/libata-eh.c | 5 ++--- drivers/ata/libata-scsi.c | 10 +++++----- 2 files changed, 7 insertions(+), 8 deletions(-)
drivers/ata/libata-eh.c +2 -3
@@ -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 (blk_req (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 &&blk_req (qc->scsicmd)->rq_flags &RQF_QUIET ) qc->flags |=ATA_QCFLAG_QUIET ;return qc->flags &ATA_QCFLAG_QUIET ; }
drivers/ata/libata-scsi.c +5 -5
@@ -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,blk_req (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 (blk_req (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 =blk_req (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 =blk_req (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 (blk_req (scmd)))) goto invalid_opcode;if (unlikely (scmd->cmd_len <16 )) {
Bart Van Assche
maintainerPATCH 8/50 rdma/iser: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/infiniband/ulp/iser/iser_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/ulp/iser/iser_memory.c +1 -1
@@ -159,7 +159,7 @@ iser_set_dif_domain(struct scsi_cmnd *sc, struct ib_sig_domain *domain) { domain->sig_type =IB_SIG_TYPE_T10_DIF ; domain->sig.dif.pi_interval =scsi_prot_interval (sc); - domain->sig.dif.ref_tag =t10_pi_ref_tag (sc->request); + domain->sig.dif.ref_tag =t10_pi_ref_tag (blk_req (sc));/* * At the moment we hard code those, but in the future * we will take them from sc.
Bart Van Assche
maintainerPATCH 8/50 rdma/iser: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/infiniband/ulp/iser/iser_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/ulp/iser/iser_memory.c +1 -1
@@ -159,7 +159,7 @@ iser_set_dif_domain(struct scsi_cmnd *sc, struct ib_sig_domain *domain) { domain->sig_type =IB_SIG_TYPE_T10_DIF ; domain->sig.dif.pi_interval =scsi_prot_interval (sc); - domain->sig.dif.ref_tag =t10_pi_ref_tag (sc->request); + domain->sig.dif.ref_tag =t10_pi_ref_tag (blk_req (sc));/* * At the moment we hard code those, but in the future * we will take them from sc.
Bart Van Assche
maintainerPATCH 9/50 rdma/srp: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/infiniband/ulp/srp/ib_srp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/infiniband/ulp/srp/ib_srp.c +3 -3
@@ -2182,8 +2182,8 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd)if (unlikely (scmnd->result)) goto err; -WARN_ON_ONCE (scmnd->request->tag <0 ); - tag =blk_mq_unique_tag (scmnd->request); +WARN_ON_ONCE (blk_req (scmnd)->tag <0 ); + tag =blk_mq_unique_tag (blk_req (scmnd)); ch = &target->ch[blk_mq_unique_tag_to_hwq (tag)]; idx =blk_mq_unique_tag_to_tag (tag); WARN_ONCE(idx >= target->req_ring_size, "%s: tag %#x: idx %d >= %d\n",
@@ -2814,7 +2814,7 @@ static int srp_abort(struct scsi_cmnd *scmnd)if (!req)return SUCCESS ; - tag =blk_mq_unique_tag (scmnd->request); + tag =blk_mq_unique_tag (blk_req (scmnd)); ch_idx =blk_mq_unique_tag_to_hwq (tag);if (WARN_ON_ONCE (ch_idx >= target->ch_count))return SUCCESS ;
Bart Van Assche
maintainerPATCH 9/50 rdma/srp: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/infiniband/ulp/srp/ib_srp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/infiniband/ulp/srp/ib_srp.c +3 -3
@@ -2182,8 +2182,8 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd)if (unlikely (scmnd->result)) goto err; -WARN_ON_ONCE (scmnd->request->tag <0 ); - tag =blk_mq_unique_tag (scmnd->request); +WARN_ON_ONCE (blk_req (scmnd)->tag <0 ); + tag =blk_mq_unique_tag (blk_req (scmnd)); ch = &target->ch[blk_mq_unique_tag_to_hwq (tag)]; idx =blk_mq_unique_tag_to_tag (tag); WARN_ONCE(idx >= target->req_ring_size, "%s: tag %#x: idx %d >= %d\n",
@@ -2814,7 +2814,7 @@ static int srp_abort(struct scsi_cmnd *scmnd)if (!req)return SUCCESS ; - tag =blk_mq_unique_tag (scmnd->request); + tag =blk_mq_unique_tag (blk_req (scmnd)); ch_idx =blk_mq_unique_tag_to_hwq (tag);if (WARN_ON_ONCE (ch_idx >= target->ch_count))return SUCCESS ;
Bart Van Assche
maintainerPATCH 10/50 zfcp: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/s390/scsi/zfcp_fsf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/scsi/zfcp_fsf.c +1 -1
@@ -2377,7 +2377,7 @@ static void zfcp_fsf_req_trace(struct zfcp_fsf_req *req, struct scsi_cmnd *scsi) } } -blk_add_driver_data (scsi->request, &blktrc,sizeof (blktrc)); +blk_add_driver_data (blk_req (scsi), &blktrc,sizeof (blktrc)); }/**
Bart Van Assche
maintainerPATCH 10/50 zfcp: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/s390/scsi/zfcp_fsf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/scsi/zfcp_fsf.c +1 -1
@@ -2377,7 +2377,7 @@ static void zfcp_fsf_req_trace(struct zfcp_fsf_req *req, struct scsi_cmnd *scsi) } } -blk_add_driver_data (scsi->request, &blktrc,sizeof (blktrc)); +blk_add_driver_data (blk_req (scsi), &blktrc,sizeof (blktrc)); }/**
Re: [PATCH 10/50] zfcp: Use blk_req() instead of scsi_cmnd.request
Quoted 13 lines · Bart Van Assche
Prepare for removal of the request pointer by using
blk_req()instead. This patch does not change any functionality.Signed-off-by Bart Van Assche <[email protected]>--- drivers/s390/scsi/zfcp_fsf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/s390/scsi/zfcp_fsf.c +0
-0
drivers/s390/scsi/zfcp_fsf.c static void zfcp_fsf_req_trace(struct zfcp_fsf_req *req, struct scsi_cmnd *scsi) · line 2383
Quoted 8 lines
drivers/s390/scsi/zfcp_fsf.c +1
-1@@ -2377,7 +2377,7 @@ static void zfcp_fsf_req_trace(struct zfcp_fsf_req *req, struct scsi_cmnd *scsi) } } -blk_add_driver_data (scsi->request, &blktrc,sizeof (blktrc)); +blk_add_driver_data (blk_req (scsi), &blktrc,sizeof (blktrc)); }/**
Looks good.
If you only rename blk_req(), like you suggested in the conversation with Christoph, and nothing else changes, feel free to carry the Acked-by over.
Signature · 4 lines
Best Regards, Benjamin Block / Linux on IBM Z Kernel Development / IBM Systems IBM Deutschland Research & Development GmbH / https://www.ibm.com/privacy Vorsitz. AufsR.: Gregor Pillen / Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen / Registergericht: AmtsG Stuttgart, HRB 243294
Bart Van Assche
maintainerPATCH 11/50 53c700: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/53c700.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/53c700.c +1 -1
@@ -1823,7 +1823,7 @@ NCR_700_queuecommand_lck(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)if ((hostdata->tag_negotiated & (1 <<scmd_id (SCp))) && SCp->device->simple_tags) { - slot->tag = SCp->request->tag; + slot->tag =blk_req (SCp)->tag;CDEBUG (KERN_DEBUG , SCp,"sending out tag %d, slot %p\n" , slot->tag, slot); }else {
Bart Van Assche
maintainerPATCH 11/50 53c700: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/53c700.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/53c700.c +1 -1
@@ -1823,7 +1823,7 @@ NCR_700_queuecommand_lck(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *)if ((hostdata->tag_negotiated & (1 <<scmd_id (SCp))) && SCp->device->simple_tags) { - slot->tag = SCp->request->tag; + slot->tag =blk_req (SCp)->tag;CDEBUG (KERN_DEBUG , SCp,"sending out tag %d, slot %p\n" , slot->tag, slot); }else {
Bart Van Assche
maintainerPATCH 12/50 NCR5380: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/NCR5380.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/NCR5380.c +3 -3
@@ -778,7 +778,7 @@ static void NCR5380_dma_complete(struct Scsi_Host *instance) }#ifdef CONFIG_SUN3 -if ((sun3scsi_dma_finish (rq_data_dir (hostdata->connected->request)))) { +if ((sun3scsi_dma_finish (rq_data_dir (blk_req (hostdata->connected))))) {pr_err ("scsi%d: overrun in UDC counter -- not prepared to deal with this!\n" , instance->host_no);BUG ();
@@ -1710,7 +1710,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) count =sun3scsi_dma_xfer_len (hostdata, cmd);if (count >0 ) { -if (rq_data_dir (cmd->request)) +if (rq_data_dir (blk_req (cmd)))sun3scsi_dma_send_setup (hostdata, cmd->SCp.ptr, count);else
@@ -2158,7 +2158,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) count =sun3scsi_dma_xfer_len (hostdata, tmp);if (count >0 ) { -if (rq_data_dir (tmp->request)) +if (rq_data_dir (blk_req (tmp)))sun3scsi_dma_send_setup (hostdata, tmp->SCp.ptr, count);else
Bart Van Assche
maintainerPATCH 12/50 NCR5380: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/NCR5380.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/NCR5380.c +3 -3
@@ -778,7 +778,7 @@ static void NCR5380_dma_complete(struct Scsi_Host *instance) }#ifdef CONFIG_SUN3 -if ((sun3scsi_dma_finish (rq_data_dir (hostdata->connected->request)))) { +if ((sun3scsi_dma_finish (rq_data_dir (blk_req (hostdata->connected))))) {pr_err ("scsi%d: overrun in UDC counter -- not prepared to deal with this!\n" , instance->host_no);BUG ();
@@ -1710,7 +1710,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) count =sun3scsi_dma_xfer_len (hostdata, cmd);if (count >0 ) { -if (rq_data_dir (cmd->request)) +if (rq_data_dir (blk_req (cmd)))sun3scsi_dma_send_setup (hostdata, cmd->SCp.ptr, count);else
@@ -2158,7 +2158,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) count =sun3scsi_dma_xfer_len (hostdata, tmp);if (count >0 ) { -if (rq_data_dir (tmp->request)) +if (rq_data_dir (blk_req (tmp)))sun3scsi_dma_send_setup (hostdata, tmp->SCp.ptr, count);else
Bart Van Assche
maintainerPATCH 13/50 aacraid: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/aacraid/aachba.c | 2 +- drivers/scsi/aacraid/commsup.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/aacraid/aachba.c +1 -1
@@ -1505,7 +1505,7 @@ static struct aac_srb * aac_scsi_common(struct fib * fib, struct scsi_cmnd * cmd srbcmd->id =cpu_to_le32 (scmd_id (cmd)); srbcmd->lun =cpu_to_le32 (cmd->device->lun); srbcmd->flags =cpu_to_le32 (flag); - timeout = cmd->request->timeout/HZ ; + timeout =blk_req (cmd)->timeout /HZ ;if (timeout ==0 ) timeout = (dev->sa_firmware ?AAC_SA_TIMEOUT :AAC_ARC_TIMEOUT ); srbcmd->timeout =cpu_to_le32 (timeout);// timeout in seconds
drivers/scsi/aacraid/commsup.c +1 -1
@@ -224,7 +224,7 @@ struct fib *aac_fib_alloc_tag(struct aac_dev *dev, struct scsi_cmnd *scmd) {struct fib *fibptr; - fibptr = &dev->fibs[scmd->request->tag]; + fibptr = &dev->fibs[blk_req (scmd)->tag];/* * Null out fields that depend on being zero at the start of * each I/O
Bart Van Assche
maintainerPATCH 13/50 aacraid: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/aacraid/aachba.c | 2 +- drivers/scsi/aacraid/commsup.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/aacraid/aachba.c +1 -1
@@ -1505,7 +1505,7 @@ static struct aac_srb * aac_scsi_common(struct fib * fib, struct scsi_cmnd * cmd srbcmd->id =cpu_to_le32 (scmd_id (cmd)); srbcmd->lun =cpu_to_le32 (cmd->device->lun); srbcmd->flags =cpu_to_le32 (flag); - timeout = cmd->request->timeout/HZ ; + timeout =blk_req (cmd)->timeout /HZ ;if (timeout ==0 ) timeout = (dev->sa_firmware ?AAC_SA_TIMEOUT :AAC_ARC_TIMEOUT ); srbcmd->timeout =cpu_to_le32 (timeout);// timeout in seconds
drivers/scsi/aacraid/commsup.c +1 -1
@@ -224,7 +224,7 @@ struct fib *aac_fib_alloc_tag(struct aac_dev *dev, struct scsi_cmnd *scmd) {struct fib *fibptr; - fibptr = &dev->fibs[scmd->request->tag]; + fibptr = &dev->fibs[blk_req (scmd)->tag];/* * Null out fields that depend on being zero at the start of * each I/O
Bart Van Assche
maintainerPATCH 14/50 advansys: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/advansys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/advansys.c +2 -2
@@ -7427,7 +7427,7 @@ static int asc_build_req(struct asc_board *boardp, struct scsi_cmnd *scp,* Set the srb_tag to the command tag + 1, as * srb_tag '0' is used internally by the chip. */ - srb_tag = scp->request->tag +1 ; + srb_tag =blk_req (scp)->tag +1 ; asc_scsi_q->q2.srb_tag = srb_tag;/*
@@ -7641,7 +7641,7 @@ static int adv_build_req(struct asc_board *boardp, struct scsi_cmnd *scp, adv_req_t **adv_reqpp) { - u32 srb_tag = scp->request->tag; + u32 srb_tag = blk_req(scp)->tag;adv_req_t *reqp;ADV_SCSI_REQ_Q *scsiqp;int ret;
Bart Van Assche
maintainerPATCH 14/50 advansys: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/advansys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/advansys.c +2 -2
@@ -7427,7 +7427,7 @@ static int asc_build_req(struct asc_board *boardp, struct scsi_cmnd *scp,* Set the srb_tag to the command tag + 1, as * srb_tag '0' is used internally by the chip. */ - srb_tag = scp->request->tag +1 ; + srb_tag =blk_req (scp)->tag +1 ; asc_scsi_q->q2.srb_tag = srb_tag;/*
@@ -7641,7 +7641,7 @@ static int adv_build_req(struct asc_board *boardp, struct scsi_cmnd *scp, adv_req_t **adv_reqpp) { - u32 srb_tag = scp->request->tag; + u32 srb_tag = blk_req(scp)->tag;adv_req_t *reqp;ADV_SCSI_REQ_Q *scsiqp;int ret;
Bart Van Assche
maintainerPATCH 15/50 bnx2i: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/bnx2i/bnx2i_hwi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/bnx2i/bnx2i_hwi.c +1 -1
@@ -1918,7 +1918,7 @@ static int bnx2i_queue_scsi_cmd_resp(struct iscsi_session *session,spin_unlock (&session->back_lock); - p = &per_cpu (bnx2i_percpu,blk_mq_rq_cpu (sc->request)); + p = &per_cpu (bnx2i_percpu,blk_mq_rq_cpu (blk_req (sc)));spin_lock (&p->p_work_lock);if (unlikely (!p->iothread)) { rc = -EINVAL ;
Bart Van Assche
maintainerPATCH 15/50 bnx2i: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/bnx2i/bnx2i_hwi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/bnx2i/bnx2i_hwi.c +1 -1
@@ -1918,7 +1918,7 @@ static int bnx2i_queue_scsi_cmd_resp(struct iscsi_session *session,spin_unlock (&session->back_lock); - p = &per_cpu (bnx2i_percpu,blk_mq_rq_cpu (sc->request)); + p = &per_cpu (bnx2i_percpu,blk_mq_rq_cpu (blk_req (sc)));spin_lock (&p->p_work_lock);if (unlikely (!p->iothread)) { rc = -EINVAL ;
Bart Van Assche
maintainerPATCH 16/50 csiostor: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/csiostor/csio_scsi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/csiostor/csio_scsi.c +3 -3
@@ -1786,7 +1786,7 @@ csio_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmnd)struct csio_scsi_qset *sqset;struct fc_rport *rport =starget_to_rport (scsi_target (cmnd->device)); - sqset = &hw->sqset[ln->portid][blk_mq_rq_cpu (cmnd->request)]; + sqset = &hw->sqset[ln->portid][blk_mq_rq_cpu (blk_req (cmnd))]; nr =fc_remote_port_chkready (rport);if (nr) {
@@ -1989,13 +1989,13 @@ csio_eh_abort_handler(struct scsi_cmnd *cmnd)csio_info (hw,"Aborted SCSI command to (%d:%llu) tag %u\n" , cmnd->device->id, cmnd->device->lun, - cmnd->request->tag); +blk_req (cmnd)->tag);return SUCCESS ; }else {csio_info (hw,"Failed to abort SCSI command, (%d:%llu) tag %u\n" , cmnd->device->id, cmnd->device->lun, - cmnd->request->tag); +blk_req (cmnd)->tag);return FAILED ; } }
Bart Van Assche
maintainerPATCH 16/50 csiostor: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/csiostor/csio_scsi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/csiostor/csio_scsi.c +3 -3
@@ -1786,7 +1786,7 @@ csio_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmnd)struct csio_scsi_qset *sqset;struct fc_rport *rport =starget_to_rport (scsi_target (cmnd->device)); - sqset = &hw->sqset[ln->portid][blk_mq_rq_cpu (cmnd->request)]; + sqset = &hw->sqset[ln->portid][blk_mq_rq_cpu (blk_req (cmnd))]; nr =fc_remote_port_chkready (rport);if (nr) {
@@ -1989,13 +1989,13 @@ csio_eh_abort_handler(struct scsi_cmnd *cmnd)csio_info (hw,"Aborted SCSI command to (%d:%llu) tag %u\n" , cmnd->device->id, cmnd->device->lun, - cmnd->request->tag); +blk_req (cmnd)->tag);return SUCCESS ; }else {csio_info (hw,"Failed to abort SCSI command, (%d:%llu) tag %u\n" , cmnd->device->id, cmnd->device->lun, - cmnd->request->tag); +blk_req (cmnd)->tag);return FAILED ; } }
Bart Van Assche
maintainerPATCH 17/50 cxlflash: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/cxlflash/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/cxlflash/main.c +1 -1
@@ -433,7 +433,7 @@ static u32 cmd_to_target_hwq(struct Scsi_Host *host, struct scsi_cmnd *scp, hwq = afu->hwq_rr_count++ % afu->num_hwqs;break ;case HWQ_MODE_TAG : - tag =blk_mq_unique_tag (scp->request); + tag =blk_mq_unique_tag (blk_req (scp)); hwq =blk_mq_unique_tag_to_hwq (tag);break ;case HWQ_MODE_CPU :
Bart Van Assche
maintainerPATCH 17/50 cxlflash: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/cxlflash/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/cxlflash/main.c +1 -1
@@ -433,7 +433,7 @@ static u32 cmd_to_target_hwq(struct Scsi_Host *host, struct scsi_cmnd *scp, hwq = afu->hwq_rr_count++ % afu->num_hwqs;break ;case HWQ_MODE_TAG : - tag =blk_mq_unique_tag (scp->request); + tag =blk_mq_unique_tag (blk_req (scp)); hwq =blk_mq_unique_tag_to_hwq (tag);break ;case HWQ_MODE_CPU :
Bart Van Assche
maintainerPATCH 18/50 dpt_i2o: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/dpt_i2o.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/dpt_i2o.c +2 -2
@@ -652,7 +652,7 @@ static int adpt_abort(struct scsi_cmnd * cmd) msg[2 ] =0 ; msg[3 ]=0 ;/* Add 1 to avoid firmware treating it as invalid command */ - msg[4 ] = cmd->request->tag +1 ; + msg[4 ] =blk_req (cmd)->tag +1 ;if (pHba->host)spin_lock_irq (pHba->host->host_lock); rcode =adpt_i2o_post_wait (pHba, msg,sizeof (msg),FOREVER );
@@ -2236,7 +2236,7 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_d msg[1 ] = ((0xff <<24 )|(HOST_TID <<12 )|d->tid); msg[2 ] =0 ;/* Add 1 to avoid firmware treating it as invalid command */ - msg[3 ] = cmd->request->tag +1 ; + msg[3 ] =blk_req (cmd)->tag +1 ;// Our cards use the transaction context as the tag for queueing // Adaptec/DPT Private stuff msg[4 ] =I2O_CMD_SCSI_EXEC |(DPT_ORGANIZATION_ID <<16 );
Bart Van Assche
maintainerPATCH 18/50 dpt_i2o: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/dpt_i2o.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/dpt_i2o.c +2 -2
@@ -652,7 +652,7 @@ static int adpt_abort(struct scsi_cmnd * cmd) msg[2 ] =0 ; msg[3 ]=0 ;/* Add 1 to avoid firmware treating it as invalid command */ - msg[4 ] = cmd->request->tag +1 ; + msg[4 ] =blk_req (cmd)->tag +1 ;if (pHba->host)spin_lock_irq (pHba->host->host_lock); rcode =adpt_i2o_post_wait (pHba, msg,sizeof (msg),FOREVER );
@@ -2236,7 +2236,7 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_d msg[1 ] = ((0xff <<24 )|(HOST_TID <<12 )|d->tid); msg[2 ] =0 ;/* Add 1 to avoid firmware treating it as invalid command */ - msg[3 ] = cmd->request->tag +1 ; + msg[3 ] =blk_req (cmd)->tag +1 ;// Our cards use the transaction context as the tag for queueing // Adaptec/DPT Private stuff msg[4 ] =I2O_CMD_SCSI_EXEC |(DPT_ORGANIZATION_ID <<16 );
Bart Van Assche
maintainerPATCH 19/50 fnic: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/fnic/fnic_scsi.c | 40 ++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 19 deletions(-)
drivers/scsi/fnic/fnic_scsi.c +21 -19
@@ -107,7 +107,7 @@ static void fnic_cleanup_io(struct fnic *fnic);static inline spinlock_t *fnic_io_lock_hash (struct fnic *fnic,struct scsi_cmnd *sc) { -u32 hash = sc->request->tag & (FNIC_IO_LOCKS -1 ); +u32 hash =blk_req (sc)->tag & (FNIC_IO_LOCKS -1 );return &fnic->io_req_lock[hash]; }
@@ -390,7 +390,7 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic, (rp->flags & FC_RP_FLAGS_RETRY)) exch_flags |=FCPIO_ICMND_SRFLAG_RETRY ; - fnic_queue_wq_copy_desc_icmnd_16(wq, sc->request->tag, + fnic_queue_wq_copy_desc_icmnd_16(wq, blk_req(sc)->tag, 0, exch_flags, io_req->sgl_cnt, SCSI_SENSE_BUFFERSIZE, io_req->sgl_list_pa,
@@ -511,7 +511,7 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_ sg_count =scsi_dma_map (sc);if (sg_count <0 ) {FNIC_TRACE (fnic_queuecommand, sc->device->host->host_no, - sc->request->tag, sc,0 , sc->cmnd[0 ], +blk_req (sc)->tag, sc,0 , sc->cmnd[0 ], sg_count,CMD_STATE (sc));mempool_free (io_req, fnic->io_req_pool); goto out;
@@ -571,7 +571,7 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_* refetch the pointer under the lock. */ FNIC_TRACE (fnic_queuecommand, sc->device->host->host_no, - sc->request->tag, sc,0 ,0 ,0 , +blk_req (sc)->tag, sc,0 ,0 ,0 , (((u64 )CMD_FLAGS (sc) <<32 ) |CMD_STATE (sc))); io_req = (struct fnic_io_req *)CMD_SP (sc);CMD_SP (sc) =NULL ;
@@ -603,7 +603,7 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_ sc->cmnd[5]);FNIC_TRACE (fnic_queuecommand, sc->device->host->host_no, - sc->request->tag, sc, io_req, +blk_req (sc)->tag, sc, io_req, sg_count, cmd_trace, (((u64 )CMD_FLAGS (sc) >>32 ) |CMD_STATE (sc)));
@@ -1371,7 +1371,7 @@ static bool fnic_cleanup_io_iter(struct scsi_cmnd *sc, void *data,unsigned long start_time =0 ;struct fnic_stats *fnic_stats = &fnic->fnic_stats; - io_lock =fnic_io_lock_tag (fnic, sc->request->tag); + io_lock =fnic_io_lock_tag (fnic,blk_req (sc)->tag);spin_lock_irqsave (io_lock, flags); io_req = (struct fnic_io_req *)CMD_SP (sc);
@@ -1413,7 +1413,7 @@ static bool fnic_cleanup_io_iter(struct scsi_cmnd *sc, void *data, sc->result =DID_TRANSPORT_DISRUPTED <<16 ;FNIC_SCSI_DBG (KERN_DEBUG , fnic->lport->host,"fnic_cleanup_io: tag:0x%x : sc:0x%p duration = %lu DID_TRANSPORT_DISRUPTED\n" , - sc->request->tag, sc, (jiffies - start_time)); +blk_req (sc)->tag, sc, jiffies - start_time);if (atomic64_read (&fnic->io_cmpl_skip))atomic64_dec (&fnic->io_cmpl_skip);
@@ -1425,10 +1425,10 @@ static bool fnic_cleanup_io_iter(struct scsi_cmnd *sc, void *data,if (!(CMD_FLAGS (sc) &FNIC_IO_ISSUED ))shost_printk (KERN_ERR , fnic->lport->host,"Calling done for IO not issued to fw: tag:0x%x sc:0x%p\n" , - sc->request->tag, sc); +blk_req (sc)->tag, sc); FNIC_TRACE(fnic_cleanup_io, - sc->device->host->host_no, sc->request->tag, sc, + sc->device->host->host_no, blk_req(sc)->tag, sc, jiffies_to_msecs(jiffies - start_time), 0, ((u64)sc->cmnd[0] << 32 | (u64)sc->cmnd[2] << 24 |
@@ -1566,7 +1566,7 @@ static bool fnic_rport_abort_io_iter(struct scsi_cmnd *sc, void *data, {struct fnic_rport_abort_io_iter_data *iter_data = data;struct fnic *fnic = iter_data->fnic; -int abt_tag = sc->request->tag; +int abt_tag =blk_req (sc)->tag;struct fnic_io_req *io_req;spinlock_t *io_lock;unsigned long flags;
@@ -1757,7 +1757,7 @@ int fnic_abort_cmd(struct scsi_cmnd *sc) term_stats = &fnic->fnic_stats.term_stats; rport =starget_to_rport (scsi_target (sc->device)); - tag = sc->request->tag; + tag =blk_req (sc)->tag; FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, "Abort Cmd called FCID 0x%x, LUN 0x%llx TAG %x flags %x\n",
@@ -1842,7 +1842,7 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)/* Now queue the abort command to firmware */ int_to_scsilun (sc->device->lun, &fc_lun); -if (fnic_queue_abort_io_req (fnic, sc->request->tag, task_req, +if (fnic_queue_abort_io_req (fnic,blk_req (sc)->tag, task_req, fc_lun.scsi_lun, io_req)) {spin_lock_irqsave (io_lock, flags);if (CMD_STATE (sc) ==FNIC_IOREQ_ABTS_PENDING )
@@ -1944,7 +1944,7 @@ int fnic_abort_cmd(struct scsi_cmnd *sc) fnic_abort_cmd_end: FNIC_TRACE(fnic_abort_cmd, sc->device->host->host_no, - sc->request->tag, sc, + blk_req(sc)->tag, sc, jiffies_to_msecs(jiffies - start_time), 0, ((u64)sc->cmnd[0] << 32 | (u64)sc->cmnd[2] << 24 | (u64)sc->cmnd[3] << 16 |
@@ -1994,7 +1994,7 @@ static inline int fnic_queue_dr_io_req(struct fnic *fnic,/* fill in the lun info */ int_to_scsilun (sc->device->lun, &fc_lun); -fnic_queue_wq_copy_desc_itmf (wq, sc->request->tag |FNIC_TAG_DEV_RST , +fnic_queue_wq_copy_desc_itmf (wq,blk_req (sc)->tag |FNIC_TAG_DEV_RST ,0 ,FCPIO_ITMF_LUN_RESET ,SCSI_NO_TAG , fc_lun.scsi_lun, io_req->port_id, fnic->config.ra_tov, fnic->config.ed_tov);
@@ -2025,7 +2025,7 @@ static bool fnic_pending_aborts_iter(struct scsi_cmnd *sc,struct fnic_pending_aborts_iter_data *iter_data = data;struct fnic *fnic = iter_data->fnic;struct scsi_device *lun_dev = iter_data->lun_dev; -int abt_tag = sc->request->tag; +int abt_tag =blk_req (sc)->tag;struct fnic_io_req *io_req;spinlock_t *io_lock;unsigned long flags;
@@ -2206,14 +2206,16 @@ static int fnic_clean_pending_aborts(struct fnic *fnic,static inline int fnic_scsi_host_start_tag (struct fnic *fnic,struct scsi_cmnd *sc) { -struct request_queue *q = sc->request->q; +struct request_queue *q =blk_req (sc)->q;struct request *dummy; dummy =blk_mq_alloc_request (q,REQ_OP_WRITE ,BLK_MQ_REQ_NOWAIT );if (IS_ERR (dummy))return SCSI_NO_TAG ; - sc->tag = sc->request->tag = dummy->tag; +WARN_ON_ONCE (blk_req (sc)->tag); +WARN_ON_ONCE (sc->tag); + sc->tag =blk_req (sc)->tag = dummy->tag; sc->host_scribble = (unsigned char *)dummy;return dummy->tag;
@@ -2284,7 +2286,7 @@ int fnic_device_reset(struct scsi_cmnd *sc)CMD_FLAGS (sc) =FNIC_DEVICE_RESET ;/* Allocate tag if not present */ - tag = sc->request->tag; + tag =blk_req (sc)->tag;if (unlikely (tag <0 )) {/* * Really should fix the midlayer to pass in a proper
@@ -2459,7 +2461,7 @@ int fnic_device_reset(struct scsi_cmnd *sc) fnic_device_reset_end: FNIC_TRACE(fnic_device_reset, sc->device->host->host_no, - sc->request->tag, sc, + blk_req(sc)->tag, sc, jiffies_to_msecs(jiffies - start_time), 0, ((u64)sc->cmnd[0] << 32 | (u64)sc->cmnd[2] << 24 | (u64)sc->cmnd[3] << 16 |
Bart Van Assche
maintainerPATCH 19/50 fnic: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/fnic/fnic_scsi.c | 40 ++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 19 deletions(-)
drivers/scsi/fnic/fnic_scsi.c +21 -19
@@ -107,7 +107,7 @@ static void fnic_cleanup_io(struct fnic *fnic);static inline spinlock_t *fnic_io_lock_hash (struct fnic *fnic,struct scsi_cmnd *sc) { -u32 hash = sc->request->tag & (FNIC_IO_LOCKS -1 ); +u32 hash =blk_req (sc)->tag & (FNIC_IO_LOCKS -1 );return &fnic->io_req_lock[hash]; }
@@ -390,7 +390,7 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic, (rp->flags & FC_RP_FLAGS_RETRY)) exch_flags |=FCPIO_ICMND_SRFLAG_RETRY ; - fnic_queue_wq_copy_desc_icmnd_16(wq, sc->request->tag, + fnic_queue_wq_copy_desc_icmnd_16(wq, blk_req(sc)->tag, 0, exch_flags, io_req->sgl_cnt, SCSI_SENSE_BUFFERSIZE, io_req->sgl_list_pa,
@@ -511,7 +511,7 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_ sg_count =scsi_dma_map (sc);if (sg_count <0 ) {FNIC_TRACE (fnic_queuecommand, sc->device->host->host_no, - sc->request->tag, sc,0 , sc->cmnd[0 ], +blk_req (sc)->tag, sc,0 , sc->cmnd[0 ], sg_count,CMD_STATE (sc));mempool_free (io_req, fnic->io_req_pool); goto out;
@@ -571,7 +571,7 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_* refetch the pointer under the lock. */ FNIC_TRACE (fnic_queuecommand, sc->device->host->host_no, - sc->request->tag, sc,0 ,0 ,0 , +blk_req (sc)->tag, sc,0 ,0 ,0 , (((u64 )CMD_FLAGS (sc) <<32 ) |CMD_STATE (sc))); io_req = (struct fnic_io_req *)CMD_SP (sc);CMD_SP (sc) =NULL ;
@@ -603,7 +603,7 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_ sc->cmnd[5]);FNIC_TRACE (fnic_queuecommand, sc->device->host->host_no, - sc->request->tag, sc, io_req, +blk_req (sc)->tag, sc, io_req, sg_count, cmd_trace, (((u64 )CMD_FLAGS (sc) >>32 ) |CMD_STATE (sc)));
@@ -1371,7 +1371,7 @@ static bool fnic_cleanup_io_iter(struct scsi_cmnd *sc, void *data,unsigned long start_time =0 ;struct fnic_stats *fnic_stats = &fnic->fnic_stats; - io_lock =fnic_io_lock_tag (fnic, sc->request->tag); + io_lock =fnic_io_lock_tag (fnic,blk_req (sc)->tag);spin_lock_irqsave (io_lock, flags); io_req = (struct fnic_io_req *)CMD_SP (sc);
@@ -1413,7 +1413,7 @@ static bool fnic_cleanup_io_iter(struct scsi_cmnd *sc, void *data, sc->result =DID_TRANSPORT_DISRUPTED <<16 ;FNIC_SCSI_DBG (KERN_DEBUG , fnic->lport->host,"fnic_cleanup_io: tag:0x%x : sc:0x%p duration = %lu DID_TRANSPORT_DISRUPTED\n" , - sc->request->tag, sc, (jiffies - start_time)); +blk_req (sc)->tag, sc, jiffies - start_time);if (atomic64_read (&fnic->io_cmpl_skip))atomic64_dec (&fnic->io_cmpl_skip);
@@ -1425,10 +1425,10 @@ static bool fnic_cleanup_io_iter(struct scsi_cmnd *sc, void *data,if (!(CMD_FLAGS (sc) &FNIC_IO_ISSUED ))shost_printk (KERN_ERR , fnic->lport->host,"Calling done for IO not issued to fw: tag:0x%x sc:0x%p\n" , - sc->request->tag, sc); +blk_req (sc)->tag, sc); FNIC_TRACE(fnic_cleanup_io, - sc->device->host->host_no, sc->request->tag, sc, + sc->device->host->host_no, blk_req(sc)->tag, sc, jiffies_to_msecs(jiffies - start_time), 0, ((u64)sc->cmnd[0] << 32 | (u64)sc->cmnd[2] << 24 |
@@ -1566,7 +1566,7 @@ static bool fnic_rport_abort_io_iter(struct scsi_cmnd *sc, void *data, {struct fnic_rport_abort_io_iter_data *iter_data = data;struct fnic *fnic = iter_data->fnic; -int abt_tag = sc->request->tag; +int abt_tag =blk_req (sc)->tag;struct fnic_io_req *io_req;spinlock_t *io_lock;unsigned long flags;
@@ -1757,7 +1757,7 @@ int fnic_abort_cmd(struct scsi_cmnd *sc) term_stats = &fnic->fnic_stats.term_stats; rport =starget_to_rport (scsi_target (sc->device)); - tag = sc->request->tag; + tag =blk_req (sc)->tag; FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, "Abort Cmd called FCID 0x%x, LUN 0x%llx TAG %x flags %x\n",
@@ -1842,7 +1842,7 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)/* Now queue the abort command to firmware */ int_to_scsilun (sc->device->lun, &fc_lun); -if (fnic_queue_abort_io_req (fnic, sc->request->tag, task_req, +if (fnic_queue_abort_io_req (fnic,blk_req (sc)->tag, task_req, fc_lun.scsi_lun, io_req)) {spin_lock_irqsave (io_lock, flags);if (CMD_STATE (sc) ==FNIC_IOREQ_ABTS_PENDING )
@@ -1944,7 +1944,7 @@ int fnic_abort_cmd(struct scsi_cmnd *sc) fnic_abort_cmd_end: FNIC_TRACE(fnic_abort_cmd, sc->device->host->host_no, - sc->request->tag, sc, + blk_req(sc)->tag, sc, jiffies_to_msecs(jiffies - start_time), 0, ((u64)sc->cmnd[0] << 32 | (u64)sc->cmnd[2] << 24 | (u64)sc->cmnd[3] << 16 |
@@ -1994,7 +1994,7 @@ static inline int fnic_queue_dr_io_req(struct fnic *fnic,/* fill in the lun info */ int_to_scsilun (sc->device->lun, &fc_lun); -fnic_queue_wq_copy_desc_itmf (wq, sc->request->tag |FNIC_TAG_DEV_RST , +fnic_queue_wq_copy_desc_itmf (wq,blk_req (sc)->tag |FNIC_TAG_DEV_RST ,0 ,FCPIO_ITMF_LUN_RESET ,SCSI_NO_TAG , fc_lun.scsi_lun, io_req->port_id, fnic->config.ra_tov, fnic->config.ed_tov);
@@ -2025,7 +2025,7 @@ static bool fnic_pending_aborts_iter(struct scsi_cmnd *sc,struct fnic_pending_aborts_iter_data *iter_data = data;struct fnic *fnic = iter_data->fnic;struct scsi_device *lun_dev = iter_data->lun_dev; -int abt_tag = sc->request->tag; +int abt_tag =blk_req (sc)->tag;struct fnic_io_req *io_req;spinlock_t *io_lock;unsigned long flags;
@@ -2206,14 +2206,16 @@ static int fnic_clean_pending_aborts(struct fnic *fnic,static inline int fnic_scsi_host_start_tag (struct fnic *fnic,struct scsi_cmnd *sc) { -struct request_queue *q = sc->request->q; +struct request_queue *q =blk_req (sc)->q;struct request *dummy; dummy =blk_mq_alloc_request (q,REQ_OP_WRITE ,BLK_MQ_REQ_NOWAIT );if (IS_ERR (dummy))return SCSI_NO_TAG ; - sc->tag = sc->request->tag = dummy->tag; +WARN_ON_ONCE (blk_req (sc)->tag); +WARN_ON_ONCE (sc->tag); + sc->tag =blk_req (sc)->tag = dummy->tag; sc->host_scribble = (unsigned char *)dummy;return dummy->tag;
@@ -2284,7 +2286,7 @@ int fnic_device_reset(struct scsi_cmnd *sc)CMD_FLAGS (sc) =FNIC_DEVICE_RESET ;/* Allocate tag if not present */ - tag = sc->request->tag; + tag =blk_req (sc)->tag;if (unlikely (tag <0 )) {/* * Really should fix the midlayer to pass in a proper
@@ -2459,7 +2461,7 @@ int fnic_device_reset(struct scsi_cmnd *sc) fnic_device_reset_end: FNIC_TRACE(fnic_device_reset, sc->device->host->host_no, - sc->request->tag, sc, + blk_req(sc)->tag, sc, jiffies_to_msecs(jiffies - start_time), 0, ((u64)sc->cmnd[0] << 32 | (u64)sc->cmnd[2] << 24 | (u64)sc->cmnd[3] << 16 |
Bart Van Assche
maintainerPATCH 20/50 hisi_sas: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/hisi_sas/hisi_sas_main.c | 4 ++-- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/hisi_sas/hisi_sas_main.c +2 -2
@@ -185,7 +185,7 @@ static int hisi_sas_slot_index_alloc(struct hisi_hba *hisi_hba,void *bitmap = hisi_hba->slot_index_tags;if (scsi_cmnd) -return scsi_cmnd->request->tag; +return blk_req (scsi_cmnd)->tag;spin_lock (&hisi_hba->lock); index = find_next_zero_bit(bitmap, hisi_hba->slot_index_count,
@@ -449,7 +449,7 @@ static int hisi_sas_task_prep(struct sas_task *task,unsigned int dq_index;u32 blk_tag; - blk_tag =blk_mq_unique_tag (scmd->request); + blk_tag =blk_mq_unique_tag (blk_req (scmd)); dq_index =blk_mq_unique_tag_to_hwq (blk_tag); *dq_pointer = dq = &hisi_hba->dq[dq_index]; }else {
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +1 -1
@@ -1153,7 +1153,7 @@ static void fill_prot_v3_hw(struct scsi_cmnd *scsi_cmnd, {unsigned char prot_op =scsi_get_prot_op (scsi_cmnd);unsigned int interval =scsi_prot_interval (scsi_cmnd); -u32 lbrt_chk_val =t10_pi_ref_tag (scsi_cmnd->request); +u32 lbrt_chk_val =t10_pi_ref_tag (blk_req (scsi_cmnd));switch (prot_op) {case SCSI_PROT_READ_INSERT :
Bart Van Assche
maintainerPATCH 20/50 hisi_sas: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/hisi_sas/hisi_sas_main.c | 4 ++-- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/hisi_sas/hisi_sas_main.c +2 -2
@@ -185,7 +185,7 @@ static int hisi_sas_slot_index_alloc(struct hisi_hba *hisi_hba,void *bitmap = hisi_hba->slot_index_tags;if (scsi_cmnd) -return scsi_cmnd->request->tag; +return blk_req (scsi_cmnd)->tag;spin_lock (&hisi_hba->lock); index = find_next_zero_bit(bitmap, hisi_hba->slot_index_count,
@@ -449,7 +449,7 @@ static int hisi_sas_task_prep(struct sas_task *task,unsigned int dq_index;u32 blk_tag; - blk_tag =blk_mq_unique_tag (scmd->request); + blk_tag =blk_mq_unique_tag (blk_req (scmd)); dq_index =blk_mq_unique_tag_to_hwq (blk_tag); *dq_pointer = dq = &hisi_hba->dq[dq_index]; }else {
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +1 -1
@@ -1153,7 +1153,7 @@ static void fill_prot_v3_hw(struct scsi_cmnd *scsi_cmnd, {unsigned char prot_op =scsi_get_prot_op (scsi_cmnd);unsigned int interval =scsi_prot_interval (scsi_cmnd); -u32 lbrt_chk_val =t10_pi_ref_tag (scsi_cmnd->request); +u32 lbrt_chk_val =t10_pi_ref_tag (blk_req (scsi_cmnd));switch (prot_op) {case SCSI_PROT_READ_INSERT :
Re: [PATCH 20/50] hisi_sas: Use blk_req() instead of scsi_cmnd.request
Quoted 4 lines · Bart Van Assche
Prepare for removal of the request pointer by using
blk_req()instead. This patch does not change any functionality.Signed-off-by Bart Van Assche<[email protected]>
Bart Van Assche
maintainerPATCH 21/50 hpsa: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/hpsa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/hpsa.c +3 -3
@@ -5686,7 +5686,7 @@ static int hpsa_scsi_queue_command(struct Scsi_Host *sh, struct scsi_cmnd *cmd)/* Get the ptr to our adapter structure out of cmd->host. */ h =sdev_to_hba (cmd->device); -BUG_ON (cmd->request->tag <0 ); +BUG_ON (blk_req (cmd)->tag <0 ); dev = cmd->device->hostdata;if (!dev) {
@@ -5729,7 +5729,7 @@ static int hpsa_scsi_queue_command(struct Scsi_Host *sh, struct scsi_cmnd *cmd)* and is therefore a brand-new command. */ if (likely (cmd->retries ==0 && - !blk_rq_is_passthrough (cmd->request) && + !blk_rq_is_passthrough (blk_req (cmd)) && h->acciopath_status)) {/* Submit with the retry_pending flag unset. */ rc =hpsa_ioaccel_submit (h, c, cmd, false);
@@ -5894,7 +5894,7 @@ static int hpsa_scsi_add_host(struct ctlr_info *h)*/ static int hpsa_get_cmd_index (struct scsi_cmnd *scmd) { -int idx = scmd->request->tag; +int idx =blk_req (scmd)->tag;if (idx <0 )return idx;
Bart Van Assche
maintainerPATCH 21/50 hpsa: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/hpsa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/hpsa.c +3 -3
@@ -5686,7 +5686,7 @@ static int hpsa_scsi_queue_command(struct Scsi_Host *sh, struct scsi_cmnd *cmd)/* Get the ptr to our adapter structure out of cmd->host. */ h =sdev_to_hba (cmd->device); -BUG_ON (cmd->request->tag <0 ); +BUG_ON (blk_req (cmd)->tag <0 ); dev = cmd->device->hostdata;if (!dev) {
@@ -5729,7 +5729,7 @@ static int hpsa_scsi_queue_command(struct Scsi_Host *sh, struct scsi_cmnd *cmd)* and is therefore a brand-new command. */ if (likely (cmd->retries ==0 && - !blk_rq_is_passthrough (cmd->request) && + !blk_rq_is_passthrough (blk_req (cmd)) && h->acciopath_status)) {/* Submit with the retry_pending flag unset. */ rc =hpsa_ioaccel_submit (h, c, cmd, false);
@@ -5894,7 +5894,7 @@ static int hpsa_scsi_add_host(struct ctlr_info *h)*/ static int hpsa_get_cmd_index (struct scsi_cmnd *scmd) { -int idx = scmd->request->tag; +int idx =blk_req (scmd)->tag;if (idx <0 )return idx;
Bart Van Assche
maintainerPATCH 22/50 ibmvfc: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/ibmvscsi/ibmvfc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ibmvscsi/ibmvfc.c +1 -1
@@ -1908,7 +1908,7 @@ static int ibmvfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)struct ibmvfc_cmd *vfc_cmd;struct ibmvfc_fcp_cmd_iu *iu;struct ibmvfc_event *evt; -u32 tag_and_hwq =blk_mq_unique_tag (cmnd->request); +u32 tag_and_hwq =blk_mq_unique_tag (blk_req (cmnd));u16 hwq =blk_mq_unique_tag_to_hwq (tag_and_hwq);u16 scsi_channel;int rc;
Bart Van Assche
maintainerPATCH 22/50 ibmvfc: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/ibmvscsi/ibmvfc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ibmvscsi/ibmvfc.c +1 -1
@@ -1908,7 +1908,7 @@ static int ibmvfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)struct ibmvfc_cmd *vfc_cmd;struct ibmvfc_fcp_cmd_iu *iu;struct ibmvfc_event *evt; -u32 tag_and_hwq =blk_mq_unique_tag (cmnd->request); +u32 tag_and_hwq =blk_mq_unique_tag (blk_req (cmnd));u16 hwq =blk_mq_unique_tag_to_hwq (tag_and_hwq);u16 scsi_channel;int rc;
Bart Van Assche
maintainerPATCH 23/50 ibmvscsi: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ibmvscsi/ibmvscsi.c +1 -1
@@ -1072,7 +1072,7 @@ static int ibmvscsi_queuecommand_lck(struct scsi_cmnd *cmnd,init_event_struct (evt_struct, handle_cmd_rsp,VIOSRP_SRP_FORMAT , - cmnd->request->timeout/HZ ); +blk_req (cmnd)->timeout /HZ ); evt_struct->cmnd = cmnd; evt_struct->cmnd_done = done;
Bart Van Assche
maintainerPATCH 23/50 ibmvscsi: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ibmvscsi/ibmvscsi.c +1 -1
@@ -1072,7 +1072,7 @@ static int ibmvscsi_queuecommand_lck(struct scsi_cmnd *cmnd,init_event_struct (evt_struct, handle_cmd_rsp,VIOSRP_SRP_FORMAT , - cmnd->request->timeout/HZ ); +blk_req (cmnd)->timeout /HZ ); evt_struct->cmnd = cmnd; evt_struct->cmnd_done = done;
Bart Van Assche
maintainerPATCH 24/50 ips: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/ips.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ips.c +1 -1
@@ -3733,7 +3733,7 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) scb->cmd.dcdb.segment_4G =0 ; scb->cmd.dcdb.enhanced_sg =0 ; - TimeOut = scb->scsi_cmd->request->timeout; + TimeOut =blk_req (scb->scsi_cmd)->timeout;if (ha->subsys->param[4 ] &0x00100000 ) {/* If NEW Tape DCDB is Supported */ if (!scb->sg_len) {
Bart Van Assche
maintainerPATCH 24/50 ips: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/ips.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ips.c +1 -1
@@ -3733,7 +3733,7 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) scb->cmd.dcdb.segment_4G =0 ; scb->cmd.dcdb.enhanced_sg =0 ; - TimeOut = scb->scsi_cmd->request->timeout; + TimeOut =blk_req (scb->scsi_cmd)->timeout;if (ha->subsys->param[4 ] &0x00100000 ) {/* If NEW Tape DCDB is Supported */ if (!scb->sg_len) {
Bart Van Assche
maintainerPATCH 25/50 libsas: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/libsas/sas_ata.c | 2 +- drivers/scsi/libsas/sas_scsi_host.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/libsas/sas_ata.c +1 -1
@@ -595,7 +595,7 @@ void sas_ata_task_abort(struct sas_task *task)/* Bounce SCSI-initiated commands to the SCSI EH */ if (qc->scsicmd) { -blk_abort_request (qc->scsicmd->request); +blk_abort_request (blk_req (qc->scsicmd));return ; }
drivers/scsi/libsas/sas_scsi_host.c +1 -1
@@ -908,7 +908,7 @@ void sas_task_abort(struct sas_task *task)if (dev_is_sata (task->dev))sas_ata_task_abort (task);else -blk_abort_request (sc->request); +blk_abort_request (blk_req (sc)); }void sas_target_destroy (struct scsi_target *starget)
Bart Van Assche
maintainerPATCH 26/50 lpfc: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/lpfc/lpfc_scsi.c | 63 +++++++++++++++++------------------ 1 file changed, 31 insertions(+), 32 deletions(-)
drivers/scsi/lpfc/lpfc_scsi.c +31 -32
@@ -648,7 +648,7 @@ lpfc_get_scsi_buf_s4(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp, cpu =raw_smp_processor_id ();if (cmnd && phba->cfg_fcp_io_sched ==LPFC_FCP_SCHED_BY_HDWQ ) { - tag =blk_mq_unique_tag (cmnd->request); + tag =blk_mq_unique_tag (blk_req (cmnd)); idx =blk_mq_unique_tag_to_hwq (tag); }else { idx = phba->sli4_hba.cpu_map[cpu].hdwq;
@@ -1010,7 +1010,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc,return 0 ; sgpe =scsi_prot_sglist (sc); - lba =t10_pi_ref_tag (sc->request); + lba =t10_pi_ref_tag (blk_req (sc));if (lba ==LPFC_INVALID_REFTAG )return 0 ;
@@ -1593,7 +1593,7 @@ lpfc_bg_setup_bpl(struct lpfc_hba *phba, struct scsi_cmnd *sc, goto out;/* extract some info from the scsi command for pde*/ - reftag =t10_pi_ref_tag (sc->request); + reftag =t10_pi_ref_tag (blk_req (sc));if (reftag ==LPFC_INVALID_REFTAG ) goto out;
@@ -1756,7 +1756,7 @@ lpfc_bg_setup_bpl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc,/* extract some info from the scsi command */ blksize =lpfc_cmd_blksize (sc); - reftag =t10_pi_ref_tag (sc->request); + reftag =t10_pi_ref_tag (blk_req (sc));if (reftag ==LPFC_INVALID_REFTAG ) goto out;
@@ -1987,7 +1987,7 @@ lpfc_bg_setup_sgl(struct lpfc_hba *phba, struct scsi_cmnd *sc, goto out;/* extract some info from the scsi command for pde*/ - reftag =t10_pi_ref_tag (sc->request); + reftag =t10_pi_ref_tag (blk_req (sc));if (reftag ==LPFC_INVALID_REFTAG ) goto out;
@@ -2188,7 +2188,7 @@ lpfc_bg_setup_sgl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc,/* extract some info from the scsi command */ blksize =lpfc_cmd_blksize (sc); - reftag =t10_pi_ref_tag (sc->request); + reftag =t10_pi_ref_tag (blk_req (sc));if (reftag ==LPFC_INVALID_REFTAG ) goto out;
@@ -2782,7 +2782,7 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) chk_guard =1 ; src = (struct scsi_dif_tuple *)sg_virt (sgpe); - start_ref_tag =t10_pi_ref_tag (cmd->request); + start_ref_tag =t10_pi_ref_tag (blk_req (cmd));if (start_ref_tag ==LPFC_INVALID_REFTAG ) goto out; start_app_tag = src->app_tag;
@@ -2876,7 +2876,7 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) phba->bg_guard_err_cnt++;lpfc_printf_log (phba,KERN_WARNING ,LOG_FCP |LOG_BG ,"9069 BLKGRD: reftag %x grd_tag err %x != %x\n" , -t10_pi_ref_tag (cmd->request), +t10_pi_ref_tag (blk_req (cmd)), sum, guard_tag); }else if (err_type ==BGS_REFTAG_ERR_MASK ) {
@@ -2888,7 +2888,7 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) phba->bg_reftag_err_cnt++;lpfc_printf_log (phba,KERN_WARNING ,LOG_FCP |LOG_BG ,"9066 BLKGRD: reftag %x ref_tag err %x != %x\n" , -t10_pi_ref_tag (cmd->request), +t10_pi_ref_tag (blk_req (cmd)), ref_tag, start_ref_tag); }else if (err_type ==BGS_APPTAG_ERR_MASK ) {
@@ -2900,7 +2900,7 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) phba->bg_apptag_err_cnt++;lpfc_printf_log (phba,KERN_WARNING ,LOG_FCP |LOG_BG ,"9041 BLKGRD: reftag %x app_tag err %x != %x\n" , -t10_pi_ref_tag (cmd->request), +t10_pi_ref_tag (blk_req (cmd)), app_tag, start_app_tag); } }
@@ -2964,7 +2964,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd," 0x%x lba 0x%llx blk cnt 0x%x " "bgstat=x%x bghm=x%x\n" , cmd->cmnd[0 ], (unsigned long long )scsi_get_lba (cmd), - blk_rq_sectors(cmd->request), bgstat, bghm); + blk_rq_sectors(blk_req(cmd)), bgstat, bghm); }if (lpfc_bgs_get_reftag_err (bgstat)) {
@@ -2981,7 +2981,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd," 0x%x lba 0x%llx blk cnt 0x%x " "bgstat=x%x bghm=x%x\n" , cmd->cmnd[0 ], (unsigned long long )scsi_get_lba (cmd), - blk_rq_sectors(cmd->request), bgstat, bghm); + blk_rq_sectors(blk_req(cmd)), bgstat, bghm); }if (lpfc_bgs_get_apptag_err (bgstat)) {
@@ -2998,7 +2998,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd," 0x%x lba 0x%llx blk cnt 0x%x " "bgstat=x%x bghm=x%x\n" , cmd->cmnd[0 ], (unsigned long long )scsi_get_lba (cmd), - blk_rq_sectors(cmd->request), bgstat, bghm); + blk_rq_sectors(blk_req(cmd)), bgstat, bghm); }if (lpfc_bgs_get_hi_water_mark_present (bgstat)) {
@@ -3042,7 +3042,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd," 0x%x lba 0x%llx blk cnt 0x%x " "bgstat=x%x bghm=x%x\n" , cmd->cmnd[0 ], (unsigned long long )scsi_get_lba (cmd), - blk_rq_sectors(cmd->request), bgstat, bghm); + blk_rq_sectors(blk_req(cmd)), bgstat, bghm);/* Calcuate what type of error it was */ lpfc_calc_bg_err (phba, lpfc_cmd);
@@ -3079,8 +3079,8 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,"9072 BLKGRD: Invalid BG Profile in cmd " "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n" , cmd->cmnd[0 ], -t10_pi_ref_tag (cmd->request), - blk_rq_sectors(cmd->request), bgstat, bghm); +t10_pi_ref_tag (blk_req (cmd)), + blk_rq_sectors(blk_req(cmd)), bgstat, bghm); ret = (-1 ); goto out; }
@@ -3091,8 +3091,8 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,"9073 BLKGRD: Invalid BG PDIF Block in cmd " "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n" , cmd->cmnd[0 ], -t10_pi_ref_tag (cmd->request), - blk_rq_sectors(cmd->request), bgstat, bghm); +t10_pi_ref_tag (blk_req (cmd)), + blk_rq_sectors(blk_req(cmd)), bgstat, bghm); ret = (-1 ); goto out; }
@@ -3109,8 +3109,8 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,"9055 BLKGRD: Guard Tag error in cmd " "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n" , cmd->cmnd[0 ], -t10_pi_ref_tag (cmd->request), - blk_rq_sectors(cmd->request), bgstat, bghm); +t10_pi_ref_tag (blk_req (cmd)), + blk_rq_sectors(blk_req(cmd)), bgstat, bghm); }if (lpfc_bgs_get_reftag_err (bgstat)) {
@@ -3126,8 +3126,8 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,"9056 BLKGRD: Ref Tag error in cmd " "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n" , cmd->cmnd[0 ], -t10_pi_ref_tag (cmd->request), - blk_rq_sectors(cmd->request), bgstat, bghm); +t10_pi_ref_tag (blk_req (cmd)), + blk_rq_sectors(blk_req(cmd)), bgstat, bghm); }if (lpfc_bgs_get_apptag_err (bgstat)) {
@@ -3143,8 +3143,8 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,"9061 BLKGRD: App Tag error in cmd " "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n" , cmd->cmnd[0 ], -t10_pi_ref_tag (cmd->request), - blk_rq_sectors(cmd->request), bgstat, bghm); +t10_pi_ref_tag (blk_req (cmd)), + blk_rq_sectors(blk_req(cmd)), bgstat, bghm); }if (lpfc_bgs_get_hi_water_mark_present (bgstat)) {
@@ -3187,8 +3187,8 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd,"9057 BLKGRD: Unknown error in cmd " "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n" , cmd->cmnd[0 ], -t10_pi_ref_tag (cmd->request), - blk_rq_sectors(cmd->request), bgstat, bghm); +t10_pi_ref_tag (blk_req (cmd)), + blk_rq_sectors(blk_req(cmd)), bgstat, bghm);/* Calcuate what type of error it was */ lpfc_calc_bg_err (phba, lpfc_cmd);
@@ -5269,8 +5269,8 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)"reftag x%x cnt %u pt %x\n" , dif_op_str[scsi_get_prot_op (cmnd)], cmnd->cmnd[0 ], -t10_pi_ref_tag (cmnd->request), -blk_rq_sectors (cmnd->request), +t10_pi_ref_tag (blk_req (cmnd)), +blk_rq_sectors (blk_req (cmnd)), (cmnd->cmnd[1]>>5)); } err =lpfc_bg_scsi_prep_dma_buf (phba, lpfc_cmd);
@@ -5281,8 +5281,8 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)"9038 BLKGRD: rcvd PROT_NORMAL cmd: " "x%x reftag x%x cnt %u pt %x\n" , cmnd->cmnd[0 ], -t10_pi_ref_tag (cmnd->request), -blk_rq_sectors (cmnd->request), +t10_pi_ref_tag (blk_req (cmnd)), +blk_rq_sectors (blk_req (cmnd)), (cmnd->cmnd[1]>>5)); } err =lpfc_scsi_prep_dma_buf (phba, lpfc_cmd);
@@ -5334,8 +5334,7 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)bf_get (wqe_tmo, &lpfc_cmd->cur_iocbq.wqe.generic.wqe_com) : lpfc_cmd->cur_iocbq.iocb.ulpTimeout, - (uint32_t ) - (cmnd->request->timeout / 1000)); + (uint32_t)(blk_req(cmnd)->timeout / 1000)); goto out_host_busy_free_buf; }
Bart Van Assche
maintainercover Remove the request pointer from struct scsi_cmnd
In reply to Bart Van AsscheHi Martin,
This patch series implements the following two changes for all SCSI drivers:
- Use blk_mq_rq_from_pdu() instead of the request member of struct scsi_cmnd since adding an offset to a pointer is faster than pointer indirection.
- Remove the request pointer from struct scsi_cmnd.
Please consider this patch series for kernel v5.14.
Thanks,
Bart.
Bart Van Assche (50):
core: Introduce the blk_req() function
core: Use blk_req() instead of scsi_cmnd.request
sd: Use blk_req() instead of scsi_cmnd.request
sr: Use blk_req() instead of scsi_cmnd.request
scsi_transport_fc: Use blk_req() instead of scsi_cmnd.request
scsi_transport_spi: Use blk_req() instead of scsi_cmnd.request
ata: Use blk_req() instead of scsi_cmnd.request rdma/iser: Use blk_req() instead of scsi_cmnd.request rdma/srp: Use blk_req() instead of scsi_cmnd.request
zfcp: Use blk_req() instead of scsi_cmnd.request 53c700: Use blk_req() instead of scsi_cmnd.request
NCR5380: Use blk_req() instead of scsi_cmnd.request
aacraid: Use blk_req() instead of scsi_cmnd.request
advansys: Use blk_req() instead of scsi_cmnd.request
bnx2i: Use blk_req() instead of scsi_cmnd.request
csiostor: Use blk_req() instead of scsi_cmnd.request
cxlflash: Use blk_req() instead of scsi_cmnd.request
dpt_i2o: Use blk_req() instead of scsi_cmnd.request
fnic: Use blk_req() instead of scsi_cmnd.request
hisi_sas: Use blk_req() instead of scsi_cmnd.request
hpsa: Use blk_req() instead of scsi_cmnd.request
ibmvfc: Use blk_req() instead of scsi_cmnd.request
ibmvscsi: Use blk_req() instead of scsi_cmnd.request
ips: Use blk_req() instead of scsi_cmnd.request
libsas: Use blk_req() instead of scsi_cmnd.request
lpfc: Use blk_req() instead of scsi_cmnd.request
megaraid: Use blk_req() instead of scsi_cmnd.request
mpt3sas: Use blk_req() instead of scsi_cmnd.request
mvumi: Use blk_req() instead of scsi_cmnd.request
myrb: Use blk_req() instead of scsi_cmnd.request
myrs: Use blk_req() instead of scsi_cmnd.request
ncr53c8xx: Use blk_req() instead of scsi_cmnd.request
qedf: Use blk_req() instead of scsi_cmnd.request
qedi: Use blk_req() instead of scsi_cmnd.request
qla1280: Use blk_req() instead of scsi_cmnd.request
qla2xxx: Use blk_req() instead of scsi_cmnd.request
qla4xxx: Use blk_req() instead of scsi_cmnd.request
qlogicpti: Use blk_req() instead of scsi_cmnd.request
scsi_debug: Use blk_req() instead of scsi_cmnd.request
smartpqi: Use blk_req() instead of scsi_cmnd.request
snic: Use blk_req() instead of scsi_cmnd.request
stex: Use blk_req() instead of scsi_cmnd.request
sun3_scsi: Use blk_req() instead of scsi_cmnd.request
sym53c8xx: Use blk_req() instead of scsi_cmnd.request
ufs: Use blk_req() instead of scsi_cmnd.request
virtio_scsi: Use blk_req() instead of scsi_cmnd.request
xen-scsifront: Use blk_req() instead of scsi_cmnd.request
tcm_loop: Use blk_req() instead of scsi_cmnd.request
usb-storage: Use blk_req() instead of scsi_cmnd.request
core: Remove the request member from struct scsi_cmnd
drivers/ata/libata-eh.c | 5 +- drivers/ata/libata-scsi.c | 10 ++-- drivers/infiniband/ulp/iser/iser_memory.c | 2 +- drivers/infiniband/ulp/srp/ib_srp.c | 6 +- drivers/s390/scsi/zfcp_fsf.c | 2 +- drivers/scsi/53c700.c | 2 +- drivers/scsi/NCR5380.c | 6 +- drivers/scsi/aacraid/aachba.c | 2 +- drivers/scsi/aacraid/commsup.c | 2 +- drivers/scsi/advansys.c | 4 +- drivers/scsi/bnx2i/bnx2i_hwi.c | 2 +- drivers/scsi/csiostor/csio_scsi.c | 6 +- drivers/scsi/cxlflash/main.c | 2 +- drivers/scsi/dpt_i2o.c | 4 +- drivers/scsi/fnic/fnic_scsi.c | 40 ++++++------- drivers/scsi/hisi_sas/hisi_sas_main.c | 4 +- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 +- drivers/scsi/hpsa.c | 6 +- drivers/scsi/ibmvscsi/ibmvfc.c | 2 +- drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +- drivers/scsi/ips.c | 2 +- drivers/scsi/libsas/sas_ata.c | 2 +- drivers/scsi/libsas/sas_scsi_host.c | 2 +- drivers/scsi/lpfc/lpfc_scsi.c | 63 ++++++++++----------- drivers/scsi/megaraid/megaraid_sas_base.c | 4 +- drivers/scsi/megaraid/megaraid_sas_fusion.c | 10 ++-- drivers/scsi/mpt3sas/mpt3sas_base.c | 4 +- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 6 +- drivers/scsi/mvumi.c | 2 +- drivers/scsi/myrb.c | 10 ++-- drivers/scsi/myrs.c | 10 ++-- drivers/scsi/ncr53c8xx.c | 4 +- drivers/scsi/qedf/qedf_io.c | 8 +-- drivers/scsi/qedi/qedi_fw.c | 9 +-- drivers/scsi/qla1280.c | 6 +- drivers/scsi/qla2xxx/qla_os.c | 4 +- drivers/scsi/qla4xxx/ql4_iocb.c | 2 +- drivers/scsi/qla4xxx/ql4_os.c | 4 +- drivers/scsi/qlogicpti.c | 2 +- drivers/scsi/scsi.c | 2 +- drivers/scsi/scsi_debug.c | 13 +++-- drivers/scsi/scsi_error.c | 15 +++-- drivers/scsi/scsi_lib.c | 27 +++++---- drivers/scsi/scsi_logging.c | 18 +++--- drivers/scsi/scsi_transport_fc.c | 2 +- drivers/scsi/scsi_transport_spi.c | 2 +- drivers/scsi/sd.c | 32 +++++------ drivers/scsi/sd_zbc.c | 10 ++-- drivers/scsi/smartpqi/smartpqi_init.c | 4 +- drivers/scsi/snic/snic_scsi.c | 10 ++-- drivers/scsi/sr.c | 10 ++-- drivers/scsi/stex.c | 6 +- drivers/scsi/sun3_scsi.c | 2 +- drivers/scsi/sym53c8xx_2/sym_glue.c | 4 +- drivers/scsi/ufs/ufshcd.c | 22 +++---- drivers/scsi/virtio_scsi.c | 4 +- drivers/scsi/xen-scsifront.c | 2 +- drivers/target/loopback/tcm_loop.c | 4 +- drivers/usb/storage/transport.c | 2 +- include/scsi/scsi_cmnd.h | 13 +++-- include/scsi/scsi_device.h | 16 +++--- 61 files changed, 239 insertions(+), 246 deletions(-)
Bart Van Assche
maintainerPATCH 27/50 megaraid: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/megaraid/megaraid_sas_base.c | 4 ++-- drivers/scsi/megaraid/megaraid_sas_fusion.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/scsi/megaraid/megaraid_sas_base.c +2 -2
@@ -1443,10 +1443,10 @@ megasas_build_dcdb(struct megasas_instance *instance, struct scsi_cmnd *scp,* pthru timeout to the os layer timeout value. */ if (scp->device->type ==TYPE_TAPE ) { -if ((scp->request->timeout /HZ ) >0xFFFF ) +if (blk_req (scp)->timeout /HZ >0xFFFF ) pthru->timeout =cpu_to_le16 (0xFFFF );else - pthru->timeout =cpu_to_le16 (scp->request->timeout /HZ ); + pthru->timeout =cpu_to_le16 (blk_req (scp)->timeout /HZ ); }/*
drivers/scsi/megaraid/megaraid_sas_fusion.c +5 -5
@@ -402,7 +402,7 @@ megasas_get_msix_index(struct megasas_instance *instance, (mega_mod64 (atomic64_add_return (1 , &instance->total_io_count), instance->msix_vectors)); }else if (instance->host->nr_hw_queues >1 ) { -u32 tag =blk_mq_unique_tag (scmd->request); +u32 tag =blk_mq_unique_tag (blk_req (scmd)); cmd->request_desc->SCSIIO.MSIxIndex =blk_mq_unique_tag_to_hwq (tag) + instance->low_latency_index_start;
@@ -3024,7 +3024,7 @@ static void megasas_build_ld_nonrw_fusion(struct megasas_instance *instance, io_request->DevHandle =cpu_to_le16 (device_id); io_request->LUN[1 ] = scmd->device->lun; pRAID_Context->timeout_value = -cpu_to_le16 (scmd->request->timeout /HZ ); +cpu_to_le16 (blk_req (scmd)->timeout /HZ ); cmd->request_desc->SCSIIO.RequestFlags = (MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO <<MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT );
@@ -3087,7 +3087,7 @@ megasas_build_syspd_fusion(struct megasas_instance *instance, device_id =MEGASAS_DEV_INDEX (scmd); pd_index =MEGASAS_PD_INDEX (scmd); - os_timeout_value = scmd->request->timeout /HZ ; + os_timeout_value =blk_req (scmd)->timeout /HZ ; mr_device_priv_data = scmd->device->hostdata; cmd->pd_interface = mr_device_priv_data->interface_type;
@@ -3376,7 +3376,7 @@ megasas_build_and_issue_cmd_fusion(struct megasas_instance *instance,return SCSI_MLQUEUE_HOST_BUSY ; } - cmd =megasas_get_cmd_fusion (instance, scmd->request->tag); + cmd =megasas_get_cmd_fusion (instance,blk_req (scmd)->tag);if (!cmd) {atomic_dec (&instance->fw_outstanding);
@@ -3417,7 +3417,7 @@ megasas_build_and_issue_cmd_fusion(struct megasas_instance *instance,*/ if (cmd->r1_alt_dev_handle !=MR_DEVHANDLE_INVALID ) { r1_cmd =megasas_get_cmd_fusion (instance, - (scmd->request->tag + instance->max_fw_cmds)); +blk_req (scmd)->tag + instance->max_fw_cmds);megasas_prepare_secondRaid1_IO (instance, cmd, r1_cmd); }
Bart Van Assche
maintainerPATCH 28/50 mpt3sas: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/mpt3sas/mpt3sas_base.c | 4 ++-- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/scsi/mpt3sas/mpt3sas_base.c +2 -2
@@ -3649,7 +3649,7 @@ _base_get_msix_index(struct MPT3SAS_ADAPTER *ioc, &ioc->total_io_cnt), ioc->reply_queue_count) : 0;if (scmd && ioc->shost->nr_hw_queues >1 ) { -u32 tag =blk_mq_unique_tag (scmd->request); +u32 tag =blk_mq_unique_tag (blk_req (scmd));return blk_mq_unique_tag_to_hwq (tag) + ioc->high_iops_queues;
@@ -3733,7 +3733,7 @@ mpt3sas_base_get_smid_scsiio(struct MPT3SAS_ADAPTER *ioc, u8 cb_idx,u16 smid;u32 tag, unique_tag; - unique_tag =blk_mq_unique_tag (scmd->request); + unique_tag =blk_mq_unique_tag (blk_req (scmd)); tag =blk_mq_unique_tag_to_tag (unique_tag);/*
drivers/scsi/mpt3sas/mpt3sas_scsih.c +3 -3
@@ -3303,7 +3303,7 @@ scsih_abort(struct scsi_cmnd *scmd)sdev_printk (KERN_INFO , scmd->device,"attempting task abort!" "scmd(0x%p), outstanding for %u ms & timeout %u ms\n" , scmd,jiffies_to_msecs (jiffies - scmd->jiffies_at_alloc), - (scmd->request->timeout /HZ ) *1000 ); + (blk_req (scmd)->timeout /HZ ) *1000 );_scsih_tm_display_info (ioc, scmd); sas_device_priv_data = scmd->device->hostdata;
@@ -5032,7 +5032,7 @@ _scsih_setup_eedp(struct MPT3SAS_ADAPTER *ioc, struct scsi_cmnd *scmd,MPI2_SCSIIO_EEDPFLAGS_CHECK_REFTAG |MPI2_SCSIIO_EEDPFLAGS_CHECK_GUARD ; mpi_request->CDB.EEDP32.PrimaryReferenceTag = -cpu_to_be32 (t10_pi_ref_tag (scmd->request)); +cpu_to_be32 (t10_pi_ref_tag (blk_req (scmd)));break ;case SCSI_PROT_DIF_TYPE3 :
@@ -5101,7 +5101,7 @@ scsih_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *scmd)struct MPT3SAS_DEVICE *sas_device_priv_data;struct MPT3SAS_TARGET *sas_target_priv_data;struct _raid_device *raid_device; -struct request *rq = scmd->request; +struct request *rq =blk_req (scmd);int class;Mpi25SCSIIORequest_t *mpi_request;struct _pcie_device *pcie_device =NULL ;
Bart Van Assche
maintainerPATCH 29/50 mvumi: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/mvumi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/mvumi.c +1 -1
@@ -702,7 +702,7 @@ static int mvumi_host_reset(struct scsi_cmnd *scmd) mhba = (struct mvumi_hba *) scmd->device->host->hostdata;scmd_printk (KERN_NOTICE , scmd,"RESET -%u cmd=%x retries=%x\n" , - scmd->request->tag, scmd->cmnd[0 ], scmd->retries); +blk_req (scmd)->tag, scmd->cmnd[0 ], scmd->retries);return mhba->instancet->reset_host (mhba); }
Bart Van Assche
maintainerPATCH 30/50 myrb: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/myrb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/scsi/myrb.c +5 -5
@@ -1286,7 +1286,7 @@ static int myrb_pthru_queuecommand(struct Scsi_Host *shost, } mbox->type3.opcode =MYRB_CMD_DCDB ; - mbox->type3.id = scmd->request->tag +3 ; + mbox->type3.id =blk_req (scmd)->tag +3 ; mbox->type3.addr = dcdb_addr; dcdb->channel = sdev->channel; dcdb->target = sdev->id;
@@ -1305,11 +1305,11 @@ static int myrb_pthru_queuecommand(struct Scsi_Host *shost,break ; } dcdb->early_status = false; -if (scmd->request->timeout <=10 ) +if (blk_req (scmd)->timeout <=10 ) dcdb->timeout =MYRB_DCDB_TMO_10_SECS ; -else if (scmd->request->timeout <=60 ) +else if (blk_req (scmd)->timeout <=60 ) dcdb->timeout =MYRB_DCDB_TMO_60_SECS ; -else if (scmd->request->timeout <=600 ) +else if (blk_req (scmd)->timeout <=600 ) dcdb->timeout =MYRB_DCDB_TMO_10_MINS ;else dcdb->timeout =MYRB_DCDB_TMO_24_HRS ;
@@ -1577,7 +1577,7 @@ static int myrb_ldev_queuecommand(struct Scsi_Host *shost, }myrb_reset_cmd (cmd_blk); - mbox->type5.id = scmd->request->tag +3 ; + mbox->type5.id =blk_req (scmd)->tag +3 ;if (scmd->sc_data_direction ==DMA_NONE ) goto submit; nsge =scsi_dma_map (scmd);
Bart Van Assche
maintainerPATCH 31/50 myrs: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/myrs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/scsi/myrs.c +5 -5
@@ -1633,7 +1633,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 =blk_req (scmd)->timeout;if (scmd->cmd_len <=10 ) {if (scmd->device->channel >= cs->ctlr_info->physchan_present) {struct myrs_ldev_info *ldev_info = sdev->hostdata;
@@ -1649,10 +1649,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 =blk_req (scmd)->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 (blk_req (scmd)->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;
@@ -1695,10 +1695,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 =blk_req (scmd)->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 (blk_req (scmd)->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;
Bart Van Assche
maintainerPATCH 32/50 ncr53c8xx: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/ncr53c8xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/ncr53c8xx.c +2 -2
@@ -4164,8 +4164,8 @@ static int ncr_queue_command (struct ncb *np, struct scsi_cmnd *cmd)** **---------------------------------------------------- */ -if (np->settle_time && cmd->request->timeout >=HZ ) { -u_long tlimit = jiffies + cmd->request->timeout -HZ ; +if (np->settle_time &&blk_req (cmd)->timeout >=HZ ) { +u_long tlimit = jiffies +blk_req (cmd)->timeout -HZ ;if (time_after (np->settle_time, tlimit)) np->settle_time = tlimit; }
Bart Van Assche
maintainerPATCH 33/50 qedf: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/qedf/qedf_io.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/scsi/qedf/qedf_io.c +1 -7
@@ -1167,13 +1167,7 @@ void qedf_scsi_completion(struct qedf_ctx *qedf, struct fcoe_cqe *cqe,return ; } -if (!sc_cmd->request) { -QEDF_WARN (&(qedf->dbg_ctx),"sc_cmd->request is NULL, " -"sc_cmd=%p.\n" , sc_cmd); -return ; - } - -if (!sc_cmd->request->q) { +if (!blk_req (sc_cmd)->q) {QEDF_WARN (&(qedf->dbg_ctx),"request->q is NULL so request " "is not valid, sc_cmd=%p.\n" , sc_cmd);return ;
Bart Van Assche
maintainerPATCH 34/50 qedi: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/qedi/qedi_fw.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/scsi/qedi/qedi_fw.c +1 -8
@@ -611,14 +611,7 @@ static void qedi_scsi_completion(struct qedi_ctx *qedi, goto error; } -if (!sc_cmd->request) { -QEDI_WARN (&qedi->dbg_ctx, -"sc_cmd->request is NULL, sc_cmd=%p.\n" , - sc_cmd); - goto error; - } - -if (!sc_cmd->request->q) { +if (!blk_req (sc_cmd)->q) {QEDI_WARN (&qedi->dbg_ctx,"request->q is NULL so request is not valid, sc_cmd=%p.\n" , sc_cmd);
Bart Van Assche
maintainerPATCH 35/50 qla1280: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/qla1280.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/qla1280.c +3 -3
@@ -490,7 +490,7 @@ __setup("qla1280=", qla1280_setup);#define CMD_SNSLEN (Cmnd) SCSI_SENSE_BUFFERSIZE#define CMD_RESULT (Cmnd) Cmnd->result#define CMD_HANDLE (Cmnd) Cmnd->host_scribble -#define CMD_REQUEST (Cmnd) Cmnd->request->cmd +#define CMD_REQUEST (Cmnd) blk_req(Cmnd)->cmd#define CMD_HOST (Cmnd) Cmnd->device->host#define SCSI_BUS_32 (Cmnd) Cmnd->device->channel
@@ -2827,7 +2827,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)memset (((char *)pkt +8 ),0 , (REQUEST_ENTRY_SIZE -8 ));/* Set ISP command timeout. */ - pkt->timeout =cpu_to_le16 (cmd->request->timeout/HZ ); + pkt->timeout =cpu_to_le16 (blk_req (cmd)->timeout /HZ );/* Set device target ID and LUN */ pkt->lun =SCSI_LUN_32 (cmd);
@@ -3082,7 +3082,7 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)memset (((char *)pkt +8 ),0 , (REQUEST_ENTRY_SIZE -8 ));/* Set ISP command timeout. */ - pkt->timeout =cpu_to_le16 (cmd->request->timeout/HZ ); + pkt->timeout =cpu_to_le16 (blk_req (cmd)->timeout /HZ );/* Set device target ID and LUN */ pkt->lun =SCSI_LUN_32 (cmd);
Bart Van Assche
maintainerPATCH 36/50 qla2xxx: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/qla2xxx/qla_os.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +2 -2
@@ -849,7 +849,7 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)uint16_t hwq;struct qla_qpair *qpair =NULL ; - tag =blk_mq_unique_tag (cmd->request); + tag =blk_mq_unique_tag (blk_req (cmd)); hwq =blk_mq_unique_tag_to_hwq (tag); qpair = ha->queue_pair_map[hwq];
@@ -1742,7 +1742,7 @@ static void qla2x00_abort_srb(struct qla_qpair *qp, srb_t *sp, const int res, }spin_lock_irqsave (qp->qp_lock_ptr, *flags); -if (ret_cmd &&blk_mq_request_started (cmd->request)) +if (ret_cmd &&blk_mq_request_started (blk_req (cmd))) sp->done (sp, res); }else { sp->done (sp, res);
Bart Van Assche
maintainerPATCH 37/50 qla4xxx: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/qla4xxx/ql4_iocb.c | 2 +- drivers/scsi/qla4xxx/ql4_os.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/qla4xxx/ql4_iocb.c +1 -1
@@ -288,7 +288,7 @@ int qla4xxx_send_command_to_isp(struct scsi_qla_host *ha, struct srb * srb)/* Acquire hardware specific lock */ spin_lock_irqsave (&ha->hardware_lock, flags); - index = (uint32_t )cmd->request->tag; + index =blk_req (cmd)->tag;/* * Check to see if adapter is online before placing request on
drivers/scsi/qla4xxx/ql4_os.c +2 -2
@@ -9282,7 +9282,7 @@ static int qla4xxx_eh_device_reset(struct scsi_cmnd *cmd)DEBUG2 (printk (KERN_INFO "scsi%ld: DEVICE_RESET cmd=%p jiffies = 0x%lx, to=%x," "dpc_flags=%lx, status=%x allowed=%d\n" , ha->host_no, - cmd, jiffies, cmd->request->timeout /HZ , + cmd, jiffies,blk_req (cmd)->timeout /HZ , ha->dpc_flags, cmd->result, cmd->allowed)); rval =qla4xxx_isp_check_reg (ha);
@@ -9349,7 +9349,7 @@ static int qla4xxx_eh_target_reset(struct scsi_cmnd *cmd)DEBUG2 (printk (KERN_INFO "scsi%ld: TARGET_DEVICE_RESET cmd=%p jiffies = 0x%lx, " "to=%x,dpc_flags=%lx, status=%x allowed=%d\n" , - ha->host_no, cmd, jiffies, cmd->request->timeout /HZ , + ha->host_no, cmd, jiffies,blk_req (cmd)->timeout /HZ , ha->dpc_flags, cmd->result, cmd->allowed)); rval =qla4xxx_isp_check_reg (ha);
Bart Van Assche
maintainerPATCH 38/50 qlogicpti: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/qlogicpti.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qlogicpti.c +1 -1
@@ -890,7 +890,7 @@ static inline void cmd_frob(struct Command_Entry *cmd, struct scsi_cmnd *Cmnd, cmd->control_flags |=CFLAG_WRITE ; else cmd->control_flags |= CFLAG_READ; - cmd->time_out = Cmnd->request->timeout/HZ ; + cmd->time_out =blk_req (Cmnd)->timeout /HZ ;memcpy (cmd->cdb, Cmnd->cmnd, Cmnd->cmd_len); }
Bart Van Assche
maintainerPATCH 39/50 scsi_debug: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/scsi_debug.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/scsi/scsi_debug.c +7 -6
@@ -4705,7 +4705,7 @@ static int resp_rwp_zone(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)static struct sdebug_queue *get_queue (struct scsi_cmnd *cmnd) {u16 hwq; -u32 tag =blk_mq_unique_tag (cmnd->request); +u32 tag =blk_mq_unique_tag (blk_req (cmnd)); hwq =blk_mq_unique_tag_to_hwq (tag);
@@ -4718,7 +4718,7 @@ static struct sdebug_queue *get_queue(struct scsi_cmnd *cmnd)static u32 get_tag (struct scsi_cmnd *cmnd) { -return blk_mq_unique_tag (cmnd->request); +return blk_mq_unique_tag (blk_req (cmnd)); }/* Queued (deferred) command completions converge here. */
@@ -5367,7 +5367,7 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, {bool new_sd_dp;bool inject = false; -bool hipri = (cmnd->request->cmd_flags &REQ_HIPRI ); +bool hipri =blk_req (cmnd)->cmd_flags &REQ_HIPRI ;int k, num_in_q, qdepth;unsigned long iflags;u64 ns_from_boot =0 ;
@@ -5570,8 +5570,9 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip,if (sdebug_statistics) sd_dp->issuing_cpu =raw_smp_processor_id ();if (unlikely (sd_dp->aborted)) { -sdev_printk (KERN_INFO , sdp,"abort request tag %d\n" , cmnd->request->tag); -blk_abort_request (cmnd->request); +sdev_printk (KERN_INFO , sdp,"abort request tag %d\n" , +blk_req (cmnd)->tag); +blk_abort_request (blk_req (cmnd));atomic_set (&sdeb_inject_pending,0 ); sd_dp->aborted = false; }
@@ -7397,7 +7398,7 @@ static int scsi_debug_queuecommand(struct Scsi_Host *shost, (u32)cmd[k]); }sdev_printk (KERN_INFO , sdp,"%s: tag=%#x, cmd %s\n" , my_name, -blk_mq_unique_tag (scp->request), b); +blk_mq_unique_tag (blk_req (scp)), b); }if (unlikely (inject_now && (sdebug_opts &SDEBUG_OPT_HOST_BUSY )))return SCSI_MLQUEUE_HOST_BUSY ;
Bart Van Assche
maintainerPATCH 40/50 smartpqi: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/smartpqi/smartpqi_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/smartpqi/smartpqi_init.c +2 -2
@@ -5569,7 +5569,7 @@ static inline u16 pqi_get_hw_queue(struct pqi_ctrl_info *ctrl_info, {u16 hw_queue; - hw_queue =blk_mq_unique_tag_to_hwq (blk_mq_unique_tag (scmd->request)); + hw_queue =blk_mq_unique_tag_to_hwq (blk_mq_unique_tag (blk_req (scmd)));if (hw_queue > ctrl_info->max_hw_queue_index) hw_queue =0 ;
@@ -5578,7 +5578,7 @@ static inline u16 pqi_get_hw_queue(struct pqi_ctrl_info *ctrl_info,static inline bool pqi_is_bypass_eligible_request (struct scsi_cmnd *scmd) { -if (blk_rq_is_passthrough (scmd->request)) +if (blk_rq_is_passthrough (blk_req (scmd)))return false;return scmd->SCp.this_residual ==0 ;
Bart Van Assche
maintainerPATCH 41/50 snic: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/snic/snic_scsi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/scsi/snic/snic_scsi.c +5 -5
@@ -33,7 +33,7 @@#include "snic_io.h" #include "snic.h" -#define snic_cmd_tag (sc) (((struct scsi_cmnd *) sc)->request->tag) +#define snic_cmd_tag (sc) (blk_req(sc)->tag)const char *snic_state_str[] = { [SNIC_INIT ] ="SNIC_INIT" ,
@@ -1636,7 +1636,7 @@ snic_abort_cmd(struct scsi_cmnd *sc)u32 start_time = jiffies;SNIC_SCSI_DBG (snic->shost,"abt_cmd:sc %p :0x%x :req = %p :tag = %d\n" , - sc, sc->cmnd[0 ], sc->request, tag); + sc, sc->cmnd[0 ],blk_req (sc), tag);if (unlikely (snic_get_state (snic) !=SNIC_ONLINE )) { SNIC_HOST_ERR(snic->shost,
@@ -2152,7 +2152,7 @@ snic_device_reset(struct scsi_cmnd *sc)int dr_supp =0 ;SNIC_SCSI_DBG (shost,"dev_reset:sc %p :0x%x :req = %p :tag = %d\n" , - sc, sc->cmnd[0 ], sc->request, + sc, sc->cmnd[0 ],blk_req (sc),snic_cmd_tag (sc)); dr_supp =snic_dev_reset_supported (sc->device);if (!dr_supp) {
@@ -2387,7 +2387,7 @@ snic_host_reset(struct scsi_cmnd *sc)SNIC_SCSI_DBG (shost,"host reset:sc %p sc_cmd 0x%x req %p tag %d flags 0x%llx\n" , - sc, sc->cmnd[0 ], sc->request, + sc, sc->cmnd[0 ],blk_req (sc),snic_cmd_tag (sc),CMD_FLAGS (sc)); ret =snic_reset (shost, sc);
@@ -2494,7 +2494,7 @@ snic_scsi_cleanup(struct snic *snic, int ex_tag) sc->result =DID_TRANSPORT_DISRUPTED <<16 ;SNIC_HOST_INFO (snic->shost,"sc_clean: DID_TRANSPORT_DISRUPTED for sc %p, Tag %d flags 0x%llx rqi %p duration %u msecs\n" , - sc, sc->request->tag,CMD_FLAGS (sc), rqi, + sc,blk_req (sc)->tag,CMD_FLAGS (sc), rqi,jiffies_to_msecs (jiffies - st_time));/* Update IO stats */
Bart Van Assche
maintainerPATCH 42/50 stex: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/stex.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/stex.c +3 -3
@@ -543,7 +543,7 @@ stex_ss_send_cmd(struct st_hba *hba, struct req_msg *req, u16 tag) msg_h = (struct st_msg_header *)req -1 ;if (likely (cmd)) { msg_h->channel = (u8 )cmd->device->channel; - msg_h->timeout =cpu_to_le16 (cmd->request->timeout/HZ ); + msg_h->timeout =cpu_to_le16 (blk_req (cmd)->timeout /HZ ); } addr = hba->dma_handle + hba->req_head * hba->rq_size; addr += (hba->ccb[tag].sg_count+4 )/11 ;
@@ -693,7 +693,7 @@ stex_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) cmd->scsi_done = done; - tag = cmd->request->tag; + tag =blk_req (cmd)->tag;if (unlikely (tag >= host->can_queue))return SCSI_MLQUEUE_HOST_BUSY ;
@@ -1249,7 +1249,7 @@ static int stex_abort(struct scsi_cmnd *cmd) {struct Scsi_Host *host = cmd->device->host;struct st_hba *hba = (struct st_hba *)host->hostdata; -u16 tag = cmd->request->tag; +u16 tag =blk_req (cmd)->tag;void __iomem *base;u32 data;int result =SUCCESS ;
Bart Van Assche
maintainerPATCH 43/50 sun3_scsi: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/sun3_scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/sun3_scsi.c +1 -1
@@ -336,7 +336,7 @@ static int sun3scsi_dma_xfer_len(struct NCR5380_hostdata *hostdata, {int wanted_len = cmd->SCp.this_residual; -if (wanted_len <DMA_MIN_SIZE ||blk_rq_is_passthrough (cmd->request)) +if (wanted_len <DMA_MIN_SIZE ||blk_rq_is_passthrough (blk_req (cmd)))return 0 ;return wanted_len;
Bart Van Assche
maintainerPATCH 44/50 sym53c8xx: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/sym53c8xx_2/sym_glue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/sym53c8xx_2/sym_glue.c +2 -2
@@ -502,8 +502,8 @@ static int sym53c8xx_queue_command_lck(struct scsi_cmnd *cmd,* Shorten our settle_time if needed for * this command not to time out. */ -if (np->s.settle_time_valid && cmd->request->timeout) { -unsigned long tlimit = jiffies + cmd->request->timeout; +if (np->s.settle_time_valid &&blk_req (cmd)->timeout) { +unsigned long tlimit = jiffies +blk_req (cmd)->timeout; tlimit -=SYM_CONF_TIMER_INTERVAL *2 ;if (time_after (np->s.settle_time, tlimit)) { np->s.settle_time = tlimit;
Bart Van Assche
maintainerPATCH 45/50 ufs: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/ufs/ufshcd.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/scsi/ufs/ufshcd.c +11 -11
@@ -387,16 +387,16 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag,* Currently we only fully trace read(10) and write(10) * commands */ -if (cmd->request && cmd->request->bio) - lba = cmd->request->bio->bi_iter.bi_sector; +if (blk_req (cmd) &&blk_req (cmd)->bio) + lba =blk_req (cmd)->bio->bi_iter.bi_sector; transfer_len =be32_to_cpu ( lrbp->ucd_req_ptr->sc.exp_data_transfer_len);if (opcode ==WRITE_10 ) group_id = lrbp->cmd->cmnd[6 ]; }else if (opcode ==UNMAP ) { -if (cmd->request) { +if (blk_req (cmd)) { lba =scsi_get_lba (cmd); - transfer_len =blk_rq_bytes (cmd->request); + transfer_len =blk_rq_bytes (blk_req (cmd)); } } }
@@ -2617,11 +2617,11 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) hba =shost_priv (host); - tag = cmd->request->tag; + tag =blk_req (cmd)->tag;if (!ufshcd_valid_tag (hba, tag)) {dev_err (hba->dev, -"%s: invalid command tag %d: cmd=0x%p, cmd->request=0x%p" , - __func__, tag, cmd, cmd->request); +"%s: invalid command tag %d: cmd=0x%p, blk_req=0x%p" , + __func__, tag, cmd,blk_req (cmd));BUG (); }
@@ -2656,7 +2656,7 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) lrbp->lun =ufshcd_scsi_to_upiu_lun (cmd->device->lun); lrbp->intr_cmd = !ufshcd_is_intr_aggr_allowed (hba) ? true : false; -ufshcd_prepare_lrbp_crypto (cmd->request, lrbp); +ufshcd_prepare_lrbp_crypto (blk_req (cmd), lrbp); lrbp->req_abort_skip = false;
@@ -6903,12 +6903,12 @@ static int ufshcd_abort(struct scsi_cmnd *cmd) host = cmd->device->host; hba =shost_priv (host); - tag = cmd->request->tag; + tag =blk_req (cmd)->tag; lrbp = &hba->lrb[tag];if (!ufshcd_valid_tag (hba, tag)) {dev_err (hba->dev, -"%s: invalid command tag %d: cmd=0x%p, cmd->request=0x%p" , - __func__, tag, cmd, cmd->request); +"%s: invalid command tag %d: cmd=0x%p, blk_req=0x%p" , + __func__, tag, cmd,blk_req (cmd));BUG (); }
Bart Van Assche
maintainerPATCH 46/50 virtio_scsi: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/virtio_scsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/virtio_scsi.c +2 -2
@@ -521,7 +521,7 @@ static void virtio_scsi_init_hdr_pi(struct virtio_device *vdev,struct virtio_scsi_cmd_req_pi *cmd_pi, struct scsi_cmnd *sc) { - struct request *rq = sc->request; + struct request *rq = blk_req(sc);struct blk_integrity *bi;virtio_scsi_init_hdr (vdev, (struct virtio_scsi_cmd_req *)cmd_pi, sc);
@@ -545,7 +545,7 @@ static void virtio_scsi_init_hdr_pi(struct virtio_device *vdev,static struct virtio_scsi_vq *virtscsi_pick_vq_mq (struct virtio_scsi *vscsi,struct scsi_cmnd *sc) { -u32 tag =blk_mq_unique_tag (sc->request); +u32 tag =blk_mq_unique_tag (blk_req (sc));u16 hwq =blk_mq_unique_tag_to_hwq (tag);return &vscsi->req_vqs[hwq];
Bart Van Assche
maintainerPATCH 47/50 xen-scsifront: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/scsi/xen-scsifront.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/xen-scsifront.c +1 -1
@@ -212,7 +212,7 @@ static int scsifront_do_request(struct vscsifrnt_info *info,memcpy (ring_req->cmnd, sc->cmnd, sc->cmd_len); ring_req->sc_data_direction = (uint8_t )sc->sc_data_direction; - ring_req->timeout_per_command = sc->request->timeout /HZ ; + ring_req->timeout_per_command =blk_req (sc)->timeout /HZ ;for (i =0 ; i < (shadow->nr_segments & ~VSCSIIF_SG_GRANT ); i++) ring_req->seg[i] = shadow->seg[i];
Bart Van Assche
maintainerPATCH 48/50 tcm_loop: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/target/loopback/tcm_loop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/target/loopback/tcm_loop.c +2 -2
@@ -183,7 +183,7 @@ static int tcm_loop_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *sc)memset (tl_cmd,0 ,sizeof (*tl_cmd)); tl_cmd->sc = sc; - tl_cmd->sc_cmd_tag = sc->request->tag; + tl_cmd->sc_cmd_tag =blk_req (sc)->tag;tcm_loop_target_queue_cmd (tl_cmd);return 0 ;
@@ -249,7 +249,7 @@ static int tcm_loop_abort_task(struct scsi_cmnd *sc) tl_hba = *(struct tcm_loop_hba **)shost_priv (sc->device->host); tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; ret =tcm_loop_issue_tmr (tl_tpg, sc->device->lun, - sc->request->tag,TMR_ABORT_TASK ); +blk_req (sc)->tag,TMR_ABORT_TASK );return (ret ==TMR_FUNCTION_COMPLETE ) ?SUCCESS :FAILED ; }
Bart Van Assche
maintainerPATCH 49/50 usb-storage: Use blk_req() instead of scsi_cmnd.request
In reply to Bart Van AsschePrepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality.
--- drivers/usb/storage/transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/storage/transport.c +1 -1
@@ -551,7 +551,7 @@ static void last_sector_hacks(struct us_data *us, struct scsi_cmnd *srb)/* Did this command access the last sector? */ sector = (srb->cmnd[2 ] <<24 ) | (srb->cmnd[3 ] <<16 ) | (srb->cmnd[4 ] <<8 ) | (srb->cmnd[5 ]); - disk = srb->request->rq_disk; + disk =blk_req (srb)->rq_disk;if (!disk) goto done; sdkp =scsi_disk (disk);
Re: [PATCH 49/50] usb-storage: Use blk_req() instead of scsi_cmnd.request
Quoted 5 lines · Bart Van Assche
Prepare for removal of the request pointer by using
blk_req()instead. This patch does not change any functionality.Signed-off-by Bart Van Assche <[email protected]>---
Quoted 16 lines
drivers/usb/storage/transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/storage/transport.c +1
-1@@ -551,7 +551,7 @@ static void last_sector_hacks(struct us_data *us, struct scsi_cmnd *srb)/* Did this command access the last sector? */ sector = (srb->cmnd[2 ] <<24 ) | (srb->cmnd[3 ] <<16 ) | (srb->cmnd[4 ] <<8 ) | (srb->cmnd[5 ]); - disk = srb->request->rq_disk; + disk =blk_req (srb)->rq_disk;if (!disk) goto done; sdkp =scsi_disk (disk);
Bart Van Assche
maintainerPATCH 50/50 core: Remove the request member from struct scsi_cmnd
In reply to Bart Van AsscheSince all scsi_cmnd.request users are gone, remove this pointer from the scsi_cmnd structure.
--- drivers/scsi/scsi_error.c | 1 - drivers/scsi/scsi_lib.c | 1 - include/scsi/scsi_cmnd.h | 3 --- 3 files changed, 5 deletions(-)
drivers/scsi/scsi_error.c +0 -1
@@ -2390,7 +2390,6 @@ scsi_ioctl_reset(struct scsi_device *dev, int __user *arg) scmd = (struct scsi_cmnd *)(rq +1 );scsi_init_command (dev, scmd); - scmd->request = rq; scmd->cmnd =scsi_req (rq)->cmd; scmd->scsi_done = scsi_reset_provider_done_command;
drivers/scsi/scsi_lib.c +0 -1
@@ -1534,7 +1534,6 @@ static blk_status_t scsi_prepare_cmd(struct request *req)scsi_init_command (sdev, cmd); - cmd->request = req; cmd->tag = req->tag; cmd->prot_op =SCSI_PROT_NORMAL ;if (blk_rq_bytes (req))
include/scsi/scsi_cmnd.h +0 -3
@@ -111,9 +111,6 @@ struct scsi_cmnd {reconnects. Probably == sector size */ -struct request *request;/* The command we are -working on */ -unsigned char *sense_buffer;/* obtained by REQUEST SENSE when * CHECK CONDITION is received on original