From patchwork Fri May 14 21:32:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439221 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 257D8C433B4 for ; Fri, 14 May 2021 21:34:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 02CD1613C5 for ; Fri, 14 May 2021 21:34:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232927AbhENVfW (ORCPT ); Fri, 14 May 2021 17:35:22 -0400 Received: from mail-pl1-f180.google.com ([209.85.214.180]:35822 "EHLO mail-pl1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232855AbhENVfU (ORCPT ); Fri, 14 May 2021 17:35:20 -0400 Received: by mail-pl1-f180.google.com with SMTP id t21so109424plo.2 for ; Fri, 14 May 2021 14:34:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/UIWHmvdwtfrOIscDc0heussLtIDhZOhV+XOUIj5B2c=; b=c9E3u4pMB2+D+jP4M9X6MPtSDgEUhX2anVD9FDiZOa3cEgDRfR2tQuT8vG5hB2OEiT zSXNRbb8nlHVkafcl/JReARleSTf4Ag+rR8GcZ/MEV1KoDX5fG9AgsAUp1foLRvak9Cl dx4eXRSI7o/wklMWIQ61f0l/MoRZyoXtHDDVmnKAnH/ePJm5P11a9sJn8QAfDVMq/EZG 1gzc6KhLXTvFV5HJ0cTUCG4c+HDO21b6IfkCY79COKPZVZ8K3NyNu5ut36mKSkwtrL8z V7T+MxOXnBedYR6tXUN1Ov2cWI9xHsGTws6TLJN/sOoIqaVWrEd8Jpt14UkveVZfsK3U 5/Xg== X-Gm-Message-State: AOAM532Zrnz0wjZLE9bpeaSibLsQY+8sXjM0oyLjrA1JVHvUshzBVuEn 85vulgLqq2vtgwC9ZJlR3js= X-Google-Smtp-Source: ABdhPJyQ2yxYNy8gWjcbYCwI/Lw0JYsf0uhQE54hxrFE8wpEGUFfV6QxNGgeEZdvO8V3QC9Ci/mQyA== X-Received: by 2002:a17:90a:71c7:: with SMTP id m7mr13410436pjs.9.1621028047656; Fri, 14 May 2021 14:34:07 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.34.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:34:06 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Christoph Hellwig , Hannes Reinecke , Ming Lei , "James E.J. Bottomley" Subject: [PATCH 01/50] core: Introduce the blk_req() function Date: Fri, 14 May 2021 14:32:16 -0700 Message-Id: <20210514213356.5264-2-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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. Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Ming Lei Signed-off-by: Bart Van Assche --- include/scsi/scsi_cmnd.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index fed024f4c02a..f5825be7ee76 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -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. From patchwork Fri May 14 21:33:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439195 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DBEFC433B4 for ; Fri, 14 May 2021 21:35:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E424761446 for ; Fri, 14 May 2021 21:35:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233434AbhENVg4 (ORCPT ); Fri, 14 May 2021 17:36:56 -0400 Received: from mail-pg1-f181.google.com ([209.85.215.181]:40891 "EHLO mail-pg1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233422AbhENVgu (ORCPT ); Fri, 14 May 2021 17:36:50 -0400 Received: by mail-pg1-f181.google.com with SMTP id j12so250912pgh.7 for ; Fri, 14 May 2021 14:35:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9eNLBbWyJdAEstBuikUSsfFCEsoVQw3ceJKTmdTdJRE=; b=nE+/NjTZ8Ii5XjhaaWzXhaYVhChtItA7OV+NV3gu23/HN0T/CEs/yqGoC7NRE9AbMg eYiNx806pfWhF+4Pea/ULgmc4gnwZ68mMQbUNjPDJq7LIMkZHASMFyjAaZJ2XhdHttmN ZO5pF5wMpqnXM5QUJLFId9TdMKFymGrdXLep4b0enZUUcBHuDBHyH95z431mDsaDWESa qpQvybmg4evSSH5u14TG8Q7po/GUapCQ1hQ61bRtsk3uCiEWL9a2V5VmeeILhF1hX1Dv h4P33oqa+qzg7vnHapN2u8NCeM8W4e+neJ7kMSxdgDXduJ01C+RW6PbqIK/yrwNDT663 bgBg== X-Gm-Message-State: AOAM530RU0W/wgheZeIhjZ1RAR1hpoCMfeU2BhEDuEgIWS+mxxa4JRJY XoQLlJbEdhmdzwgBARA7RFc= X-Google-Smtp-Source: ABdhPJz+uedlSOxbqFYr0UCJcjUUHTywq1NPNjsedfn1/+7wrXNDdQ2itnccrEwz43sRAvya3KeisQ== X-Received: by 2002:a63:2bd0:: with SMTP id r199mr49161990pgr.395.1621028137597; Fri, 14 May 2021 14:35:37 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.35.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:35:37 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Christoph Hellwig , Hannes Reinecke , Ming Lei , "James E.J. Bottomley" Subject: [PATCH 02/50] core: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:33:08 -0700 Message-Id: <20210514213356.5264-54-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Prepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality. Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Ming Lei Signed-off-by: Bart Van Assche --- 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(-) diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index e9e2f0e15ac8..a226f2d380a3 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -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) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index d8fafe77dbbe..8846e5066f92 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -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; diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 532304d42f00..e88ce8f747ee 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -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) diff --git a/drivers/scsi/scsi_logging.c b/drivers/scsi/scsi_logging.c index 8ea44c6595ef..706986e7f5ef 100644 --- a/drivers/scsi/scsi_logging.c +++ b/drivers/scsi/scsi_logging.c @@ -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; diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index f5825be7ee76..a68521e6ce57 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -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) diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index ac6ab16abee7..2614e4a6a01e 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -265,13 +265,15 @@ sdev_prefix_printk(const char *, const struct scsi_device *, const char *, __printf(3, 4) void scmd_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 { From patchwork Fri May 14 21:32:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439220 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEC6AC433B4 for ; Fri, 14 May 2021 21:34:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C07C3613C5 for ; Fri, 14 May 2021 21:34:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232956AbhENVf1 (ORCPT ); Fri, 14 May 2021 17:35:27 -0400 Received: from mail-pl1-f174.google.com ([209.85.214.174]:43769 "EHLO mail-pl1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232855AbhENVfY (ORCPT ); Fri, 14 May 2021 17:35:24 -0400 Received: by mail-pl1-f174.google.com with SMTP id v12so91424plo.10 for ; Fri, 14 May 2021 14:34:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=e1DN+xXfpZr3JlML+Pyq4Pi3tSk9QmkyYcgqp3sJ1g8=; b=RRRAI2Nuuiug1oo/3radbvH50EKjnGX4m1aTNWi1QbQiu5vXy6Bt9ARDbibfEpCJyH XuDK/z2oEhMU0pllsAHvoariW6jzNxeBk43yi8C/KGUmcKySQBeV2ps2SbdHJT2jG+dV GHlkt7nlrvGHuVlTaVGVs1+b9Y/GAJ3Zrejz9R22rhJK0UoMe15YuUwZ2OKWQ+DENlnV BQVo4QlLFntcu4ZmpRDZpw21mkj74BMKdD8aKKzQ8U2UhEYcRK6bfdI1yxrFSglgoUvG DBNxqxuhUlePgehHszQWB3lLr6mLBgx4yMNmRVdWTCht4ODqvFmu1VPmwGoi7THmRnk8 m7pg== X-Gm-Message-State: AOAM531PWmX88j+TvXlFtDBGUXG0yjISqrjSM3Gdv6m3KTI6B4xU6D5F w6W0Wf1bPObwvtmF3usVTnA= X-Google-Smtp-Source: ABdhPJwT2FTzP99WIsMfK6rmpxax1fFl/2FqjP82CuKyoI7GClfL6FAJ5RkijJysQSmKpTlbzaw15g== X-Received: by 2002:a17:90a:474f:: with SMTP id y15mr11418989pjg.108.1621028051099; Fri, 14 May 2021 14:34:11 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.34.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:34:10 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Christoph Hellwig , Hannes Reinecke , Ming Lei , "James E.J. Bottomley" Subject: [PATCH 03/50] sd: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:32:18 -0700 Message-Id: <20210514213356.5264-4-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Prepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality. Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Ming Lei Signed-off-by: Bart Van Assche --- drivers/scsi/sd.c | 32 ++++++++++++++++---------------- drivers/scsi/sd_zbc.c | 10 +++++----- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index cb3c37d1e009..0886b4dbef32 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -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; diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c index e45d8d94574c..0fc26fbc5a3c 100644 --- a/drivers/scsi/sd_zbc.c +++ b/drivers/scsi/sd_zbc.c @@ -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 && From patchwork Fri May 14 21:33:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439194 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 622F1C433ED for ; Fri, 14 May 2021 21:35:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4704561442 for ; Fri, 14 May 2021 21:35:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233451AbhENVg7 (ORCPT ); Fri, 14 May 2021 17:36:59 -0400 Received: from mail-pl1-f176.google.com ([209.85.214.176]:40725 "EHLO mail-pl1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233465AbhENVgx (ORCPT ); Fri, 14 May 2021 17:36:53 -0400 Received: by mail-pl1-f176.google.com with SMTP id n3so99570plf.7 for ; Fri, 14 May 2021 14:35:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hjjWgcGg3lNUdfmXQnaHe/oiHj8x1ZBHAFqCm8zQryA=; b=jq143bmQ83PSocvx8/IPdWIprfaDrN+kuScP36G+smXPBk5E+U+4sw1KyfvbIj8M6W Y0acqxPerYMrUuTGMPQwjHQoxxSNCUtjNU6J8C2L1eujV7WI3ysqm+Xwhfn/WBHEbNJJ 8QgHDjc9HAHW4axoGeupLw/rq+nQeerGYVEwrTkubQf7mhLlhbwZQFyNfOQcSvY4Mn82 oLiuOW/5OOLGOrSv19HSVhIym1aw6YAA6IOSTjAO67PdOcB+Sx65VYOIThEOxvsqb8sz XMmxTgBXZl1amO71GOSkF7HCY2j/hojoZhN7biaaZz8yQMv4Z19eUwVtVXshThkYZZx8 JHBw== X-Gm-Message-State: AOAM530qS/hvpfZZIOHRquYvGcx/W2urir4hClfNOQcbz1+dDPcR2X/+ JDSyjne24b5DiqcD4cBukPs= X-Google-Smtp-Source: ABdhPJzkFGI6U9GsFQztMGc1gw4eHMnJYQEdjPrENu9NC3u467Zg8pZFSwa5weMp79T73lqht8tfPA== X-Received: by 2002:a17:902:109:b029:ec:9f64:c53d with SMTP id 9-20020a1709020109b02900ec9f64c53dmr47132412plb.83.1621028141134; Fri, 14 May 2021 14:35:41 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.35.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:35:40 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Christoph Hellwig , Hannes Reinecke , Ming Lei , Jens Axboe , "James E.J. Bottomley" Subject: [PATCH 04/50] sr: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:33:10 -0700 Message-Id: <20210514213356.5264-56-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Prepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality. Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Ming Lei Signed-off-by: Bart Van Assche --- drivers/scsi/sr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index e4633b84c556..5a23f4ca8698 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -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); From patchwork Fri May 14 21:33:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439193 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C2F6C433ED for ; Fri, 14 May 2021 21:35:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2B563613C5 for ; Fri, 14 May 2021 21:35:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233592AbhENVhF (ORCPT ); Fri, 14 May 2021 17:37:05 -0400 Received: from mail-pg1-f181.google.com ([209.85.215.181]:36480 "EHLO mail-pg1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233524AbhENVg7 (ORCPT ); Fri, 14 May 2021 17:36:59 -0400 Received: by mail-pg1-f181.google.com with SMTP id c21so264026pgg.3 for ; Fri, 14 May 2021 14:35:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IH/r9AOycjnWvxZ4S6rtMcxkeQP9ikVB0ZSiMJZU0ak=; b=dKkMdOwtRWEF04nM8Czumpp/o6hNGPTSIIJ5lzT41p2mZiSuXs7vuHTQmZtBi/E82n hPTqDxiJbE8Wfn624ITIcgbo4xg58wlpRJJzZBctQCURxDZpLjTPg77QspvuMzgAZh6w yjqJ/pneUXnCng38ZqhVHLwJ8TjANvXC1AA1oGdeHKCyV3nCdEVFeuKVUMxhoN3grVyS F9BsIUh5e+DAFHbf8rPVrbtdd5PbvTKf6sVuSpNQQCiwQIE1hxUBjJp5uzkFQA5M368X xHAMUlgXXTkRLId38mKPgfjN2vQQdsr/1SJIVVDRRSGh2gRHGu3CLg8Xw4xNj8QnZ07o 2qAg== X-Gm-Message-State: AOAM531yvPVO4ocrpsKFkmQAkEYSURXrl+WRYUf5dukoh3Le6sRCw8AU 15DRWYzKjLPewIb1WX9i0hY= X-Google-Smtp-Source: ABdhPJzDqHTbJ5nW7QiIDc0ztLXXP+KkL4C+pUjhji6c5VJ1gGZtD5dPANfQSLZCD8U91Kur7PumJA== X-Received: by 2002:a63:ed4d:: with SMTP id m13mr48709584pgk.433.1621028146092; Fri, 14 May 2021 14:35:46 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.35.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:35:45 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Jens Axboe , Christoph Hellwig , Hannes Reinecke , Ming Lei Subject: [PATCH 07/50] ata: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:33:13 -0700 Message-Id: <20210514213356.5264-59-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Prepare for removal of the request pointer by using blk_req() instead. This patch does not change any functionality. Cc: Jens Axboe Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Ming Lei Signed-off-by: Bart Van Assche --- drivers/ata/libata-eh.c | 5 ++--- drivers/ata/libata-scsi.c | 10 +++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index bb3637762985..4b007c9adfcb 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -912,7 +912,7 @@ void ata_qc_schedule_eh(struct ata_queued_cmd *qc) * Note that ATA_QCFLAG_FAILED is unconditionally set after * this function completes. */ - blk_abort_request(qc->scsicmd->request); + blk_abort_request(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; } diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index fd8b6febbf70..108c2f0b3e17 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -627,7 +627,7 @@ static struct ata_queued_cmd *ata_scsi_qc_new(struct ata_device *dev, { struct ata_queued_cmd *qc; - qc = ata_qc_new_init(dev, cmd->request->tag); + qc = ata_qc_new_init(dev, 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)) { From patchwork Fri May 14 21:33:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439192 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84437C43461 for ; Fri, 14 May 2021 21:35:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6A94261490 for ; Fri, 14 May 2021 21:35:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233524AbhENVhG (ORCPT ); Fri, 14 May 2021 17:37:06 -0400 Received: from mail-pg1-f181.google.com ([209.85.215.181]:42971 "EHLO mail-pg1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233480AbhENVhA (ORCPT ); Fri, 14 May 2021 17:37:00 -0400 Received: by mail-pg1-f181.google.com with SMTP id z4so246350pgb.9 for ; Fri, 14 May 2021 14:35:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Hnj1CAegSg+E8lSbWvNGlsAIyJElNAUfG3sSIJO2hUQ=; b=eQU6svEchdy/Dzw80iHsgSe8tgSI9nAbN7hbdtE4X8mIf3+MBqvJfTNJBKSaBNvQ5n BKk7t+c1GM6IqX2IjNm0QehLlArfIn9ocDYR6GWGZ7Og6rDzQZ4Qp8bTH7MIlrSf1gjN yOEY3D6kw58Wskl2m3pF578pEcc5c35wJ72uaGyqqVEYXTW0NVfB2MLKN1k3UZh3DDKr FGvkkKmmWUs6AROLWQi7zB1LzUwyp5/yS2xz4zADXrJxFH0x9r9RyJByhv+nzVPjH+QH QJXyh5MIO7hCGrczcf37zRKEFHoT+OWeKVswL3zeNIIzAmFnDjamVqhurbsltPpI+t+6 KqYg== X-Gm-Message-State: AOAM533fiAiNxPwRRm0RgXhiX1vmpARtA5S+okJSpe+Wn8OlAXT2ta+/ GCAXwBVZEzR4VmF2/lrQlCp+BMCDm8Giiw== X-Google-Smtp-Source: ABdhPJyikEulo8kOVrT1f3dDISvgIbyiTtKlizcHWfPvKDYQ8PKBqdr6HSkIieHj5xW8EY/GunJuSg== X-Received: by 2002:a63:3f8f:: with SMTP id m137mr28791680pga.56.1621028147626; Fri, 14 May 2021 14:35:47 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.35.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:35:47 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Sagi Grimberg , Max Gurtovoy , Doug Ledford , Jason Gunthorpe Subject: [PATCH 08/50] rdma/iser: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:33:14 -0700 Message-Id: <20210514213356.5264-60-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/infiniband/ulp/iser/iser_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/ulp/iser/iser_memory.c b/drivers/infiniband/ulp/iser/iser_memory.c index afec40da9b58..37c5cffaeaa1 100644 --- a/drivers/infiniband/ulp/iser/iser_memory.c +++ b/drivers/infiniband/ulp/iser/iser_memory.c @@ -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. From patchwork Fri May 14 21:32:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439217 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F9FAC433B4 for ; Fri, 14 May 2021 21:34:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5078461446 for ; Fri, 14 May 2021 21:34:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233028AbhENVfh (ORCPT ); Fri, 14 May 2021 17:35:37 -0400 Received: from mail-pl1-f171.google.com ([209.85.214.171]:34311 "EHLO mail-pl1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233018AbhENVfd (ORCPT ); Fri, 14 May 2021 17:35:33 -0400 Received: by mail-pl1-f171.google.com with SMTP id h7so111378plt.1 for ; Fri, 14 May 2021 14:34:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/xwVNWxEkfoxLUwXj2D3n0bcSpzVFbgjluocNlb2IDo=; b=GlCyzelVcsU85pjUXIExGesGPmNsPUlDtNJmR5HMHk01jzcGZ0dKOZfvPh0sMctD2F 5hfQtJ4QzaZRlKzp4xR0GGyIts9T/lfjMXnmmXWwj86xtqg51PRtUfipmy2nXH6lfs06 QARNOW317v6FwtxV0twnPaA06UnvBo3MCwOvsk0cW+txFjot4t6eVGXeFBZRtdEqg2vK 8DeBfLrepXIWPpa2PgOPlnVEnjSnImgxA2j3I08eYByvLkK5AIH3VYOPUBcVHr6T5RMc p8/b9WtrP4gSLxWvnQ+4EaK1uBfKCevYTn2xF+BTuDfC+kmSitz7AsoktoQP8ANo3KWC 8oAg== X-Gm-Message-State: AOAM530q61cZH1HX19+lwnuVFyIn/FszcRq/3UoDeSwgWvqiPmrgpPop 2UnLkOHvTMgMCk95vAWSjjHd/9BmTM8= X-Google-Smtp-Source: ABdhPJzwGG1T2XXbT4t+1dG+jlcvonpMauY+L7i96kFjIv9slA+SIRK40Ij44wB9SXBIXBA2UDypYw== X-Received: by 2002:a17:90b:4d82:: with SMTP id oj2mr9060475pjb.61.1621028060656; Fri, 14 May 2021 14:34:20 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.34.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:34:19 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Doug Ledford , Jason Gunthorpe Subject: [PATCH 09/50] rdma/srp: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:32:24 -0700 Message-Id: <20210514213356.5264-10-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/infiniband/ulp/srp/ib_srp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 31f8aa2c40ed..0575f5f3ae53 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -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; From patchwork Fri May 14 21:33:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439191 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1804C43460 for ; Fri, 14 May 2021 21:35:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9949561440 for ; Fri, 14 May 2021 21:35:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233552AbhENVhK (ORCPT ); Fri, 14 May 2021 17:37:10 -0400 Received: from mail-pl1-f173.google.com ([209.85.214.173]:42542 "EHLO mail-pl1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233551AbhENVhD (ORCPT ); Fri, 14 May 2021 17:37:03 -0400 Received: by mail-pl1-f173.google.com with SMTP id v13so94816ple.9 for ; Fri, 14 May 2021 14:35:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=geElLRMks0iQAYLilw8v93f07YLDAo8etaoW0tK14Ig=; b=jKee2BMg7hxT1hAI0fSWTNrV4QdP5is7i1+/UElOwWMAxDVRtxJIG2jtOIQcwwm0sl PzXtZ6fSfSKquy8n4A1hUlKuyP6nJXZbxHfN2TRPm1Y+0wfSySOvYrDXvZ6bcq6FL5br OQD8RTOSH/QeOsXnbHZSigYXYXeRgqYwkYG3FDydOWAnB6c6yZe3ssSLa8PtceF3O06Q hXjFqWL1DPOCcwmJoyGYK6/LIeh70+KTxPLCYtzqqkltBYMNSbfNqZs4rGHqSY9mlTqP 8U7U/Nk0+2SXOD5JvTrSNmGtcAYJS92vA/r9/cFz0YwYOuJ2+mAgjx+bC0wRftvPul4o fBqw== X-Gm-Message-State: AOAM533q74Ixs8A4XWz7DMJpX2UiGBY8NFxXsDRvGt1KB9pC0aR9NSdn VaHSqouO02RJA8mJWpHqRdw= X-Google-Smtp-Source: ABdhPJzFGK6L5DtscySZYHpJ3zaikvOyau4UcJpEm3GTqZLevrsORGYKKkgLGAUEvdPT1iXJ00qAWA== X-Received: by 2002:a17:903:2287:b029:ef:671e:c943 with SMTP id b7-20020a1709032287b02900ef671ec943mr19840684plh.35.1621028150739; Fri, 14 May 2021 14:35:50 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.35.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:35:50 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Steffen Maier , Benjamin Block , Heiko Carstens , Vasily Gorbik , Christian Borntraeger Subject: [PATCH 10/50] zfcp: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:33:16 -0700 Message-Id: <20210514213356.5264-62-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 Acked-by: Benjamin Block --- drivers/s390/scsi/zfcp_fsf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 2e4804ef2fb9..ac9223a7677d 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -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)); } /** From patchwork Fri May 14 21:32:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439216 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BE88C43460 for ; Fri, 14 May 2021 21:34:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E38F761446 for ; Fri, 14 May 2021 21:34:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233038AbhENVfi (ORCPT ); Fri, 14 May 2021 17:35:38 -0400 Received: from mail-pj1-f46.google.com ([209.85.216.46]:53012 "EHLO mail-pj1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232930AbhENVfg (ORCPT ); Fri, 14 May 2021 17:35:36 -0400 Received: by mail-pj1-f46.google.com with SMTP id q6so532710pjj.2 for ; Fri, 14 May 2021 14:34:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DbVDOQUJOMiGJw0iWPNpt0I6b61hnveg3Q65/SZVxdI=; b=Jc8hZruYx29rC800fhSHs8A2iMm8+/gAFtNPE2SCb/B2Wpmz+hLNvi1VEf8NHIZfbO bzVYLzJNLTWNrRaNqQG5HqmAZE1RylcKSNjbRwhhZs1kxN2rQObhjn5rnL9/ESkjDZUw 3IkgqFKG5r01UFrJsCzJdAGiTXq3zqbDnGIQ749sKfNmtD2F2nCf3N9s6Kjmz+haYbkr f9cMIetBPePXUfUWIdxEAkOkpSG6wb49X3rxcB3yPHV39VV+XW3Qn4t6s06bsrMJ5bkF 3i2QJXn47qvclDzuHcjEBKwIudBWoCgSLMWzdmKQ39xoRhn3AGDAncvfLNRLsGIYoZbu Kuzw== X-Gm-Message-State: AOAM530B/MGNNnMuD3XWFgZHoO9cMxOrrwga3L11wOa32S/U0sUgbr51 9pEHWjMO0W1kLljwk4w/3Mg= X-Google-Smtp-Source: ABdhPJzYlaf9AOOAg7VMuUEZQu5xU4QyinExnnleC6IOOFu3OOPYuDfX8iV6Gm8Rpk2FHyrnvYaumw== X-Received: by 2002:a17:90b:1a92:: with SMTP id ng18mr55334610pjb.213.1621028063690; Fri, 14 May 2021 14:34:23 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.34.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:34:23 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , "James E.J. Bottomley" Subject: [PATCH 11/50] 53c700: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:32:26 -0700 Message-Id: <20210514213356.5264-12-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/53c700.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c index 77ccb96e5ed4..8dd686484857 100644 --- a/drivers/scsi/53c700.c +++ b/drivers/scsi/53c700.c @@ -1823,7 +1823,7 @@ NCR_700_queuecommand_lck(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *) if ((hostdata->tag_negotiated & (1<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 { From patchwork Fri May 14 21:33:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439190 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53CF2C433ED for ; Fri, 14 May 2021 21:36:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 389CB61440 for ; Fri, 14 May 2021 21:36:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233645AbhENVhQ (ORCPT ); Fri, 14 May 2021 17:37:16 -0400 Received: from mail-pg1-f182.google.com ([209.85.215.182]:45022 "EHLO mail-pg1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233480AbhENVhG (ORCPT ); Fri, 14 May 2021 17:37:06 -0400 Received: by mail-pg1-f182.google.com with SMTP id y32so237569pga.11 for ; Fri, 14 May 2021 14:35:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gqOY8NOf3A/uVe1kfrH5HeRCTEoAD33kBspCQvlgDPI=; b=i2KC5ZTr6bEqkMNbuzunPkQ3nDmU7Ke1t0oeo25pBQtlkfYdFw0pjY1Cw13NzIa5I7 EiGlKU21uUZfq2owgf1lB/b3jFDafuRuLIxApDZr0cEHWukn4qImzU7ibU15Q7tXg81x +Sum/e5SrmmFwSgr6Q1Cq2HD6x1sYmtrrn6iLx2baOSKGY4pTqbznhE6TzOkSTcVLGcc bSSSGOy5Wzxl70XfZPX5p/HeoScUCd/m31mH4D8vutxPg1ukcS5PicAbQZGf5o2VnhM5 2uS4o8ZtCqexUB0BMHpNTdEP8Y/ymts0MdBlvYn8mqo7jjhSkRiDRcrSRTMbnv+tscv/ U12w== X-Gm-Message-State: AOAM533MSqVTYe3faSQpkIopeK3FlHTyG7P8Lf0x53zPqm1WFFei4TfH 2iHH8db/mmQL9zVLDURnHFw= X-Google-Smtp-Source: ABdhPJyh5vzTlBpClgCZajCM7BMYG6YtWNjfwzEd+gK6blpLY25POVffSJ69Ma+golRMRvFl7Huxcw== X-Received: by 2002:a65:644d:: with SMTP id s13mr47957693pgv.362.1621028153684; Fri, 14 May 2021 14:35:53 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.35.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:35:53 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Finn Thain , Michael Schmitz , "James E.J. Bottomley" Subject: [PATCH 12/50] NCR5380: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:33:18 -0700 Message-Id: <20210514213356.5264-64-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/NCR5380.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index 2ddbcaa667d1..cfeadbd98669 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c @@ -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 From patchwork Fri May 14 21:32:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439215 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AAD3C433ED for ; Fri, 14 May 2021 21:34:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 76DC161442 for ; Fri, 14 May 2021 21:34:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233048AbhENVfm (ORCPT ); Fri, 14 May 2021 17:35:42 -0400 Received: from mail-pj1-f42.google.com ([209.85.216.42]:42796 "EHLO mail-pj1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233045AbhENVfj (ORCPT ); Fri, 14 May 2021 17:35:39 -0400 Received: by mail-pj1-f42.google.com with SMTP id j6-20020a17090adc86b02900cbfe6f2c96so474078pjv.1 for ; Fri, 14 May 2021 14:34:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GvsrBHqxeTpj5yobzDPB/XspzX453ScHpA5H8S53VJU=; b=HFM1DZC0s5shmjpCz1+YVbsnCoU7afi6m85/qM0hnuPdEACufeFuZJPUPCi/vAoEgO EKmmUWjJ7YuVzn9uT1hIn+/Kl+qCBG0D1RZpg/Rqx9LfOcGP1gbDEwBlcEWmYFCfnpd6 9lyXZO7twm1H+l2pvBJBlidQKSFfe9wou+oLyZFzy/mO9GNEBigVtaxxDH6BXPIVIIDr f6hkfgM+A1NL4OvTUTrNkBJMprqwTwlO/3EFhpowQbyTnumD/1wNegxCSt2jfTCZyATx 9rSM9t7oHg7L+jepq2ROeaHPWRWlAhfi6CE/lY/WuzZ5y/C9CwOK6ZZ0CY9gxO977mox Qc5Q== X-Gm-Message-State: AOAM531TQf86hqGTaJdTlrDOcVdxKNrgcjGKhOpVjAwT1mnmAADsFKns mmAdy7ReotiQk64LXK9NGG4= X-Google-Smtp-Source: ABdhPJwZn36k16+7GVqgrLm0AiLtNZntnDgKPZmor+Z9vSLJwvwng0WVOMcb793FmFHV+ED9Q8Q0YQ== X-Received: by 2002:a17:902:264:b029:eb:3d3a:a09c with SMTP id 91-20020a1709020264b02900eb3d3aa09cmr47176973plc.0.1621028066790; Fri, 14 May 2021 14:34:26 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:34:26 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Adaptec OEM Raid Solutions , "James E.J. Bottomley" Subject: [PATCH 13/50] aacraid: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:32:28 -0700 Message-Id: <20210514213356.5264-14-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/aacraid/aachba.c | 2 +- drivers/scsi/aacraid/commsup.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index 46b8dffce2dd..73570f8e89e0 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -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 diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index 54eb4d41bc2c..4745c0622e53 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -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 From patchwork Fri May 14 21:33:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439189 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2EB4C433B4 for ; Fri, 14 May 2021 21:36:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C924961442 for ; Fri, 14 May 2021 21:36:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233625AbhENVhT (ORCPT ); Fri, 14 May 2021 17:37:19 -0400 Received: from mail-pg1-f174.google.com ([209.85.215.174]:39904 "EHLO mail-pg1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233491AbhENVhI (ORCPT ); Fri, 14 May 2021 17:37:08 -0400 Received: by mail-pg1-f174.google.com with SMTP id s22so254882pgk.6 for ; Fri, 14 May 2021 14:35:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2DWgJ7rrYJ2TaqSweWO5hb7eNOrBJhRnfEehynKbfH4=; b=e47nVQlDFObUeJr8IFd1YqNmeue6rG006jNhRJtpxgrKD2Nk3kUW9fKPFlb/ZP8e1G bcnuU3ca2a6LIzjK0aY+utDRkxevtHGDF5igUsw7GDcaAhUSQJjJLv/LOYHXKCGwAoiA pHujGGjT80ukXHdQmVgxU1dlAu+zinrD/pPAwftI4S2jX67uRKDB9o8NRVW+GAZrz90w b61hCObxn7NfUH0x1066pU6hx+KhO5ZoFydTlAWcEQcX9m9clOuODlb1CWsyaOBvaSM4 w+Wo7Y4/7GhK1Rj8k2blI5e4FCcCLOV2FoQjN1wZMkS2LgZGsDjLqdc4t+NlVbxDBHaU FiOA== X-Gm-Message-State: AOAM533SvKZQQPL0yha/fSnZteJZKCUU8VPDBWstQniXy+O0IocN9UFq YxvAahFxuC+lqIeyehcGyrE= X-Google-Smtp-Source: ABdhPJwY3OwdVRfMhlOwCrOIkGAeleuClujpBr1bkdZUYt8ija9yMxzjpfyYSb493vj4DnErgJZRlg== X-Received: by 2002:a65:550e:: with SMTP id f14mr20907385pgr.160.1621028156616; Fri, 14 May 2021 14:35:56 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.35.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:35:56 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Matthew Wilcox , Hannes Reinecke , "James E.J. Bottomley" Subject: [PATCH 14/50] advansys: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:33:20 -0700 Message-Id: <20210514213356.5264-66-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/advansys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 800052f10699..e9ec10c466f3 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -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; From patchwork Fri May 14 21:32:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439214 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58EEFC43461 for ; Fri, 14 May 2021 21:34:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3B1D2613C5 for ; Fri, 14 May 2021 21:34:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230309AbhENVfq (ORCPT ); Fri, 14 May 2021 17:35:46 -0400 Received: from mail-pj1-f47.google.com ([209.85.216.47]:53017 "EHLO mail-pj1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233018AbhENVfl (ORCPT ); Fri, 14 May 2021 17:35:41 -0400 Received: by mail-pj1-f47.google.com with SMTP id q6so532807pjj.2 for ; Fri, 14 May 2021 14:34:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yIIFvRIv7OLSpsGdeLExpFVQyXxiBLPv0iUfrznOEYQ=; b=hlSgRwIvur/iNVxVEr+e/sRSpyX3Ew//nXd1hFl9BDcpmhtevgM3nkxlHzDX/068lx TbCrxkYeBJMc/itHNT5wqZG4iYHB8Bs4EA+66aeumV9hoqKFYufJ0n6bMnhw178jESmM DINyJ++v8aY0mP6v8bJYym0fgc9cqErXkfieCHvUZ07gBwthZXH6UAd+ZGQNnRGHCEqx Lo7LIfNMcJYOtWdfOKyCC3pa0Q1rR24gtDrnrqWdloIyUIaSIAcnZGxwQ8dEb1iG5b2J stesc6DMwiXck4Kj1bKGwkOTh8sAgahCzXNd85FcLmw4uPIf2wgkjU9KcVSa0KdUhi1j UKaA== X-Gm-Message-State: AOAM533Rv46444cCBuVSnwcceOx7UyryUhYxVOHKLl6miL4vNbVjbthy ezAKeVmB2wx2NFQUsl7k4a7EnASETCgIVA== X-Google-Smtp-Source: ABdhPJzX5mblcoTFuAxrkL6OnizStP0N9bB7QWWdHHQSnSOMjr+L+cksqufpLjTJoCAqXG1wpGgxUQ== X-Received: by 2002:a17:902:c784:b029:ef:b14e:2b0b with SMTP id w4-20020a170902c784b02900efb14e2b0bmr5973434pla.64.1621028069885; Fri, 14 May 2021 14:34:29 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.34.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:34:29 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Nilesh Javali , Manish Rangankar , GR-QLogic-Storage-Upstream@marvell.com, "James E.J. Bottomley" Subject: [PATCH 15/50] bnx2i: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:32:30 -0700 Message-Id: <20210514213356.5264-16-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/bnx2i/bnx2i_hwi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c index 43e8a1dafec0..70e9a8e6329d 100644 --- a/drivers/scsi/bnx2i/bnx2i_hwi.c +++ b/drivers/scsi/bnx2i/bnx2i_hwi.c @@ -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; From patchwork Fri May 14 21:33:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439188 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EBC8C433B4 for ; Fri, 14 May 2021 21:36:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0296B6143F for ; Fri, 14 May 2021 21:36:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233465AbhENVhZ (ORCPT ); Fri, 14 May 2021 17:37:25 -0400 Received: from mail-pf1-f180.google.com ([209.85.210.180]:42890 "EHLO mail-pf1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233595AbhENVhO (ORCPT ); Fri, 14 May 2021 17:37:14 -0400 Received: by mail-pf1-f180.google.com with SMTP id h127so643205pfe.9 for ; Fri, 14 May 2021 14:36:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=42ckW6LU8oo00tgEtvvvObYtPpqzKDgelcuguXzF2mk=; b=VnqV1CrcYu+tyzKhd6K55D9yEVQOCCSLl4LJS6IAkipMEMsS9bwcNkQ1dy2rfbimP7 +5VGslPJQ+tb0mmepd9h/UN4/zU2ZbiJ2Ir7ORAI7Y0cvJKcQSgGsKUMg4+IgA85PkjA Sa8hkVoAynBvp+SSwDrjSxo2ENJ3Tyo2Fd1WRKI38Mje7tNdngBX8Ri32usS/uOU026l MQggwWqTqhuNLuGo9edn5cBsGwj9RDl6vVr65KackarqYYWOSjAID58SzTOktzarBMgQ eppt0FY9xLJydMDkeYVLZUQHzy1qYz8N2TVNpkN2M9er3ADZIF/344TA6eJrcuxCxnjR Ld8w== X-Gm-Message-State: AOAM531F8lACngmvolgLtv5M2IYSS9U1oW1k5Vm+vRM7CmOugYYB96/u Z/P5ZgYghmGTv4XMTVZTBhVkbTUtruK/ZA== X-Google-Smtp-Source: ABdhPJxE0EV0Z8PUZTxCENHWt/rseFaAqD0JRfsIAhMnk3syLVMjXdV6QDig/iL0EbzmNqFARbBIIg== X-Received: by 2002:a63:231a:: with SMTP id j26mr8148261pgj.77.1621028161580; Fri, 14 May 2021 14:36:01 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.36.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:36:01 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , "James E.J. Bottomley" , Colin Ian King , Jiapeng Chong Subject: [PATCH 16/50] csiostor: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:33:22 -0700 Message-Id: <20210514213356.5264-68-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/csiostor/csio_scsi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/csiostor/csio_scsi.c b/drivers/scsi/csiostor/csio_scsi.c index 56b9ad0a1ca0..234e0baec091 100644 --- a/drivers/scsi/csiostor/csio_scsi.c +++ b/drivers/scsi/csiostor/csio_scsi.c @@ -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; } } From patchwork Fri May 14 21:32:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439213 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 885B4C433ED for ; Fri, 14 May 2021 21:34:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6D5C8613C5 for ; Fri, 14 May 2021 21:34:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233043AbhENVft (ORCPT ); Fri, 14 May 2021 17:35:49 -0400 Received: from mail-pj1-f52.google.com ([209.85.216.52]:33741 "EHLO mail-pj1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232930AbhENVfr (ORCPT ); Fri, 14 May 2021 17:35:47 -0400 Received: by mail-pj1-f52.google.com with SMTP id b13-20020a17090a8c8db029015cd97baea9so1961866pjo.0 for ; Fri, 14 May 2021 14:34:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=y6UYooSiQef4zit3Gqi6nc76HmL0lSxvqul04f7IY2Q=; b=rXOgOYhWKXG+KmWpb/Vqfc2B2H8VgNUWrs5TKMzjc+FQsLYtcwBaQXHOeHn4See2/V FHyk26JUvcOPhZQDXzDi466NtmwZkXrbvsaS88HzzqeVgePi19qBTKxMBaHrZjHXdM54 4+byw1AwHdUE2hRbNV414vfp7/GTp7J9urw9yAPyqffhrAyh59RB5rPOm2Zl/YU1Ycth 7ssAOhtN+k/iFic8Yh6zl/khaHyN1tNwuN7iDMbcS2i3pbmkMYdX2IrR6uuWeW+1D9Nj t17e88IP88TebYcrJw0Q5ZbH89+wtJmsNC3HFIVL/X6u8mqk6MC+drMv74FDAFjDbWbM NqBg== X-Gm-Message-State: AOAM531mji0KpDSlbbghSr0o6+/Ck1+T1B9lP1vfvvMR3ikpPFJQnN/r gsVD2qsrjqjqBTnNIlN/cVk= X-Google-Smtp-Source: ABdhPJwbDGTn/xMtpEdl6IXInXfnz7hIjdxgH/bgfDJMdsH8mZ0J49tAfdH5xxxWRTmOeDeCd/NGAg== X-Received: by 2002:a17:902:d488:b029:f0:a4e2:7421 with SMTP id c8-20020a170902d488b02900f0a4e27421mr4120864plg.53.1621028074600; Fri, 14 May 2021 14:34:34 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.34.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:34:34 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , "Manoj N. Kumar" , "Matthew R. Ochs" , Uma Krishnan , "James E.J. Bottomley" Subject: [PATCH 17/50] cxlflash: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:32:32 -0700 Message-Id: <20210514213356.5264-18-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/cxlflash/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index 222593bc2afe..c3f5df2f3509 100644 --- a/drivers/scsi/cxlflash/main.c +++ b/drivers/scsi/cxlflash/main.c @@ -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: From patchwork Fri May 14 21:33:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439187 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38579C433ED for ; Fri, 14 May 2021 21:36:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1816D6143F for ; Fri, 14 May 2021 21:36:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233603AbhENVh0 (ORCPT ); Fri, 14 May 2021 17:37:26 -0400 Received: from mail-pg1-f181.google.com ([209.85.215.181]:40920 "EHLO mail-pg1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232343AbhENVhR (ORCPT ); Fri, 14 May 2021 17:37:17 -0400 Received: by mail-pg1-f181.google.com with SMTP id j12so251654pgh.7 for ; Fri, 14 May 2021 14:36:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dM+WIxPnyXTYFBr8o0gTRnqx905xvNYXXAsx5ozXOmk=; b=oBw8bzD+SAUzrNFBSPoCv1imX2YnAbs6JUJjmOc7iRXyr3AjMwUJMo9bOIXOHr9W3c ChDJYyMrIRLAQNAAFiDxWmNB+M0dCQUeTZTOMi08hKaCqZGmVpO8/0EAJLOYKBwKrHOx Tn6T1RLsI7d03FBFZGnuP2AWKDZSOX7caUx0y5j2qRV+99OYNCm3BIbJLVkNqyzQHMZ3 NDQ7I4p2SgOQ6HnBduE1c9SW7CAreYlE9lFS3vykLmAav8UE/BjKgL/3/w8tD2WHuQ+N eTaAOFA3yFtuUAxMnOMSP5MVqKoEXIJwR5pwMjetjfES8ni+ltXc4wTGtW7HBMX0afIF sLbQ== X-Gm-Message-State: AOAM532zko3JzVKwd/JKo55QtfTX8VHFV6BFzDt8WtIj4xQ3MqCayAbF Bq1YwAUJGRP7dxs29w6flu4= X-Google-Smtp-Source: ABdhPJz2ooIqu2qGR5F4WQ+tpGHQAroY1jBrvyz3a5hJTxTopvub4YI/CJffl416AOUBiygquBz0Ww== X-Received: by 2002:a63:fb4c:: with SMTP id w12mr48962138pgj.337.1621028164606; Fri, 14 May 2021 14:36:04 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:36:04 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Adaptec OEM Raid Solutions , "James E.J. Bottomley" Subject: [PATCH 18/50] dpt_i2o: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:33:24 -0700 Message-Id: <20210514213356.5264-70-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/dpt_i2o.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index a18a4a08f049..75fbbd939b4a 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c @@ -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); From patchwork Fri May 14 21:32:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439212 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1B75C43460 for ; Fri, 14 May 2021 21:34:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C3C6461442 for ; Fri, 14 May 2021 21:34:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233090AbhENVfv (ORCPT ); Fri, 14 May 2021 17:35:51 -0400 Received: from mail-pf1-f182.google.com ([209.85.210.182]:37721 "EHLO mail-pf1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbhENVft (ORCPT ); Fri, 14 May 2021 17:35:49 -0400 Received: by mail-pf1-f182.google.com with SMTP id c13so658365pfv.4 for ; Fri, 14 May 2021 14:34:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/uhZ4sQ8r6Nq3O36Cd68M5CqF7+kJz1r4WpZqlrf3MM=; b=YJaahaPY+05V3zNUGr4L7ag/ym+44hkW90aC4wZXvBLem4ysgA8MQ+Md3O+RwztyRW 2g4zFDK5Yc71UVOlF1UFyc4Yf0dT8Av6aVWzPtuc481dKufAQUhkrZ13k2kdBRjw+IJL E/ZmXx87rIirFYPlfa025oJyL1PJa3Qqx+MMbOUujvpO+UfhVyonN28W9CLkZdMb1r6S 8rMmVj/9ImW2l38R58e2WFk2jM25oDLdDSqOxJBeSbYSks3AaQIjdW9geLm7urbrC0V1 nw8qmtoYhWIUuaQrmCijWZQQZoW+p7HvrhgvRlcwAtV+wLQkyy/WCepxFF83WiTTJMtU p6NA== X-Gm-Message-State: AOAM533NN5N+tGmWpflMXk7K3CrrxKf58u1NtWf/ImTGdouVOlVUu73h MSCxYwwRlI8DYUqPtg66igk= X-Google-Smtp-Source: ABdhPJyFvZKKa7ze3dduJU4QfGV7wGBLbItTJZmn+XDhxJLBI9cobuYEmO/AzJZUOOB8h0wWTIpTTQ== X-Received: by 2002:a65:618c:: with SMTP id c12mr48985747pgv.296.1621028077709; Fri, 14 May 2021 14:34:37 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.34.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:34:37 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Satish Kharat , Sesidhar Baddela , Karan Tilak Kumar , "James E.J. Bottomley" Subject: [PATCH 19/50] fnic: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:32:34 -0700 Message-Id: <20210514213356.5264-20-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/fnic/fnic_scsi.c | 40 ++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c index 762cc8bd2653..5a0dcea64ad3 100644 --- a/drivers/scsi/fnic/fnic_scsi.c +++ b/drivers/scsi/fnic/fnic_scsi.c @@ -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 | From patchwork Fri May 14 21:33:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439186 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BA7BC433ED for ; Fri, 14 May 2021 21:36:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0E5C26143F for ; Fri, 14 May 2021 21:36:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233422AbhENVhi (ORCPT ); Fri, 14 May 2021 17:37:38 -0400 Received: from mail-pj1-f54.google.com ([209.85.216.54]:55129 "EHLO mail-pj1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233489AbhENVhV (ORCPT ); Fri, 14 May 2021 17:37:21 -0400 Received: by mail-pj1-f54.google.com with SMTP id g24so522300pji.4 for ; Fri, 14 May 2021 14:36:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CNhwrprZYmWxuMGbVuPnCv7S9U3K7+lKJs/YESFzhnc=; b=ZVwhqli/cIiULE2sZtOvkYD6DDAIXiLGPxcHEmEOZHElQnOMubbsRiZl+ZW0X9NPLk TId3Qq+HdRduqRPaEF3P9OMP9WK7fRh2u1wZ1PlJYvEUYhQMmoOxKkak8qXHY7+RwTXp 8a1caEe1NQJTe3R9bCFxxya6S0jHXd6LJmj7/EKmQBoN1rQQmwWOt+22vLzBiE0NJODd gPgVOLkfRqbPBPvPhBPa2LsZT7H/sjH+JJb3hb+QDCN+hg8AfYha9/GsQr/eUoYgVmLD BKOOlYIwUD2izVoVR2d/r1qH8Gq8E1ejDNjB0iP3aA69Qoc3oczF3HeK0YpQMSEGrJaG BuTw== X-Gm-Message-State: AOAM532SyMVAnoERQrjhfjIkckka2QlLLwNzA1tB16fp4AmrgYyOKFyC kH8MqCwIzmKWhbKPjBsIS6w= X-Google-Smtp-Source: ABdhPJwep5cKFpRJBJV17zTwGfLpw1RA478RAlwjBMjDavnOaytyh7ZFvwRH12k+vWR01ApCqfHp5Q== X-Received: by 2002:a17:90a:474f:: with SMTP id y15mr11426093pjg.108.1621028167661; Fri, 14 May 2021 14:36:07 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.36.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:36:07 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , John Garry , "James E.J. Bottomley" Subject: [PATCH 20/50] hisi_sas: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:33:26 -0700 Message-Id: <20210514213356.5264-72-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 Acked-by: John Garry --- 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(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 5a204074099c..9a93a3374d65 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -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 { diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 499c770d405c..ed02eecd606d 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -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: From patchwork Fri May 14 21:32:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439211 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2519C433ED for ; Fri, 14 May 2021 21:34:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B8745613C5 for ; Fri, 14 May 2021 21:34:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233077AbhENVfz (ORCPT ); Fri, 14 May 2021 17:35:55 -0400 Received: from mail-pg1-f175.google.com ([209.85.215.175]:43752 "EHLO mail-pg1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233101AbhENVfx (ORCPT ); Fri, 14 May 2021 17:35:53 -0400 Received: by mail-pg1-f175.google.com with SMTP id k15so239296pgb.10 for ; Fri, 14 May 2021 14:34:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6CTnkeKhcotq5OMfqrz/2VKArxZCP+Flz3k3xUHSvnE=; b=BRTaSjUDeTxRLSG6oRErSYRRSJ+A0nZAmBQKqhmDRFXOQtiFRRmWfmkE6zHxG2vkkU x4PL2zzGXEHtnj0ZN0fxtD/fh3TierHu2qRm+9sLok7RjKj3nM2Ztop+nJvrMJIufx5Y AiJoE/9QwSy5hUsV9RIu3BvLIdKKK8nMGQbCqbycx4XNpliyepqvWzMWe8dWmA9lvRK+ WHsjvjO7FtW21TUFNlxhoMFtrpfl/PdgNXNA1eVfd/c6s41nQLQnXmNgODnlvm1NskPz 0D3Nr9mejXYoLJaKevpn66lShgX6ESbOvr9NCE/GBcNeCEFnI/OGiIT9C7WBXw780bfh X3QA== X-Gm-Message-State: AOAM5319g6X64ZhIiG8scg38aBAXMfhKvAgEY9Dnd25Z7fGWAEaMZRmP qXURGHJBUNiepS8a2xK2GlI= X-Google-Smtp-Source: ABdhPJx80quJ3b87xUeyczLFwU4RPILHMZMlRXsjXMkV41/b/fHDVvRLZ1AdxayZzW5RXD831ZUbmw== X-Received: by 2002:a63:ba5b:: with SMTP id l27mr49480016pgu.343.1621028080734; Fri, 14 May 2021 14:34:40 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.34.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:34:40 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Don Brace , "James E.J. Bottomley" Subject: [PATCH 21/50] hpsa: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:32:36 -0700 Message-Id: <20210514213356.5264-22-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/hpsa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index f135a10f582b..9fcbe9a84de6 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -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; From patchwork Fri May 14 21:33:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439185 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A21BBC433B4 for ; Fri, 14 May 2021 21:36:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 809066143F for ; Fri, 14 May 2021 21:36:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233551AbhENVhj (ORCPT ); Fri, 14 May 2021 17:37:39 -0400 Received: from mail-pg1-f172.google.com ([209.85.215.172]:34386 "EHLO mail-pg1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233591AbhENVhX (ORCPT ); Fri, 14 May 2021 17:37:23 -0400 Received: by mail-pg1-f172.google.com with SMTP id l70so268802pga.1 for ; Fri, 14 May 2021 14:36:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aBpDebaAugL9JvWwPHRHrVAjzLTctYjhzrp2WXlm6a4=; b=PyhPvzMxNwnuHRx7cdW2xewokgZgqoxKATQf2AY/i3IS/gyzSyiFwb6Sr+Ycn3mMVy NQutUooSq8OCLksOKGnH4cCmqYy4aPM6xaAuIr/6XRXj+yGN1C81pQ/9OzYrRYs5IL21 7p1rNaFim20HlFVvZ8aFvb3RLABq5gz5DWPsBfy90DA2hJMZ+v9jVz/LNoxI59cxBZtW YyG3CLA08YwboisZlHJDCh3gFzqrh0MvVDQxPBq67GrhWwxwjTtMhzXSYIm9S5e9mSEl r+hTi4VTztFipP+HeNfjieap5HRfrhuJdnx8FSa1lQXp5oleVtjVLeueoLTALZE6EdmA neSg== X-Gm-Message-State: AOAM530IZ4bOCrnNmouhBDuEf8xt0SQV4eFgVIWSBaEi5MJMF7Q8A00W jSR0aV0+4174aKbQ3XDEaDg= X-Google-Smtp-Source: ABdhPJxC/kUcoc4/H1dgBLFzLF51YIZEi/sNh1aWzxM9LMBNSMcvQtMD0D9C/j+m/XjDvQtI0FOD6g== X-Received: by 2002:a63:b211:: with SMTP id x17mr41251582pge.106.1621028170662; Fri, 14 May 2021 14:36:10 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.36.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:36:10 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Tyrel Datwyler , Michael Ellerman , "James E.J. Bottomley" Subject: [PATCH 22/50] ibmvfc: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:33:28 -0700 Message-Id: <20210514213356.5264-74-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/ibmvscsi/ibmvfc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index 6540d48eb0e8..e8b4f72f9161 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -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; From patchwork Fri May 14 21:33:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439184 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97421C433ED for ; Fri, 14 May 2021 21:36:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7B1B361029 for ; Fri, 14 May 2021 21:36:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233642AbhENVhn (ORCPT ); Fri, 14 May 2021 17:37:43 -0400 Received: from mail-pj1-f47.google.com ([209.85.216.47]:46809 "EHLO mail-pj1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233639AbhENVh0 (ORCPT ); Fri, 14 May 2021 17:37:26 -0400 Received: by mail-pj1-f47.google.com with SMTP id pi6-20020a17090b1e46b029015cec51d7cdso458310pjb.5 for ; Fri, 14 May 2021 14:36:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=39CFdvPUx2YylU5fmmA6ia5kiG8IPH28yP2o/gwmaNE=; b=El34IGpWecKy6+ahaqHgUiSI30A2T2W4failC1KIhfSsQESDtehJCoIURHmvAiNBmh HyRdvicrRUmaqssIr3fx6XrxT65S5MYmqIMbnv+jpihge0/cSFh2tYx4kT/KHER1J5cl oNsG+1+3MPdtdI1vy+UL0VHCiZI4rWvZ5pYpC2cvcz0bzQYhn0iIaSZjIKKBTUGZzW7+ Gid6nDwK43G1NQNCP14hh9iSkSQwbWqdpm3ZDNNVc8Cby0JAGcuxwMRLzedV8T/QgOwQ mPt02Iazn3VJE3HUJBgpguOsefT5KsjfhQ5R9HBBzco4eOpwgWcbp5s084x0XSGzy7Ib jYGQ== X-Gm-Message-State: AOAM5328rvxW4D9HLCziSGzab8UuTsJiBhwqxwBAriwe7S+KiuViEiu0 o6FOxSvgyWP1uwDNHuHK9OI= X-Google-Smtp-Source: ABdhPJxdCKiNAoRbIvA4YqJd0EOTeQ8ZXOnpc9+bhIy2+ih6V0rgbn6heNZsiAYsUXaRlu3l9EdPbw== X-Received: by 2002:a17:902:e5cb:b029:ed:64d5:afee with SMTP id u11-20020a170902e5cbb02900ed64d5afeemr47444536plf.41.1621028173583; Fri, 14 May 2021 14:36:13 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.36.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:36:13 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Adaptec OEM Raid Solutions , "James E.J. Bottomley" Subject: [PATCH 24/50] ips: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:33:30 -0700 Message-Id: <20210514213356.5264-76-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/ips.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index bc33d54a4011..6bcc655d1f15 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c @@ -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) { From patchwork Fri May 14 21:32:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439209 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4489CC433B4 for ; Fri, 14 May 2021 21:34:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 294F861454 for ; Fri, 14 May 2021 21:34:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233159AbhENVgE (ORCPT ); Fri, 14 May 2021 17:36:04 -0400 Received: from mail-pj1-f49.google.com ([209.85.216.49]:40563 "EHLO mail-pj1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230523AbhENVgD (ORCPT ); Fri, 14 May 2021 17:36:03 -0400 Received: by mail-pj1-f49.google.com with SMTP id b9-20020a17090a9909b029015cf9effaeaso2319519pjp.5 for ; Fri, 14 May 2021 14:34:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YjbCN+/ijmvuqqPceQBK4jOlOh9NBJBvK5kjlObAKoI=; b=IFiBbzmELjUCYPFlqJuB9JLqjTCmQxxN6fH6DjRDqA+TsKBxASZgYxvedGxHEGmbaC 8utjnxYM8pbRFjPaITTFYaFzpxgzzFfXMEQKXWlwMVjXKixmb1uu9HbKAnzedRXxcPmr +hpoNF1GATdrXccbHWJ0ASENLp037vw5wgHwR/JEl4ewj8HlRquq96qzrlHRpZr/wu6R qi7op9U/H5VAWx3xOgYnMbhApctvo2phnY6NalpsEDz8Y5srb2Sf4tr08QzACv3P2evS vGKybl91ZkgLH8SO7h01BPlQ1VInmtX2+qO4ps2e/VowvDPcqZPT9ck4DF+8gnA4am5c OHAw== X-Gm-Message-State: AOAM5309csaU5cp8dVg8CQBRkjlZuCjWyIvcfmTMCqw0CRQxnu6NZTnw x6YEC7IG62L9k+Oem5d7C4w= X-Google-Smtp-Source: ABdhPJzHpQx7XPMLGpEX2Kjy7mYppNz82ghckoJTfme596KplHJYjj4vUvvWZoquYJJEJq8RDHyEvw== X-Received: by 2002:a17:90b:1c05:: with SMTP id oc5mr9735345pjb.38.1621028090603; Fri, 14 May 2021 14:34:50 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.34.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:34:50 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , "James E.J. Bottomley" , John Garry , Jason Yan , Luo Jiaxing , Liu Shixin , Jolly Shah , "Gustavo A. R. Silva" Subject: [PATCH 25/50] libsas: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:32:40 -0700 Message-Id: <20210514213356.5264-26-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/libsas/sas_ata.c | 2 +- drivers/scsi/libsas/sas_scsi_host.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index e9a86128f1f1..6736e69f4062 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c @@ -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; } diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index 1bf939818c98..438f14f7c1a0 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c @@ -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) From patchwork Fri May 14 21:32:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439208 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2410C433B4 for ; Fri, 14 May 2021 21:34:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B6BAE613C5 for ; Fri, 14 May 2021 21:34:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233172AbhENVgI (ORCPT ); Fri, 14 May 2021 17:36:08 -0400 Received: from mail-pj1-f54.google.com ([209.85.216.54]:37567 "EHLO mail-pj1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233214AbhENVgG (ORCPT ); Fri, 14 May 2021 17:36:06 -0400 Received: by mail-pj1-f54.google.com with SMTP id gb21-20020a17090b0615b029015d1a863a91so2316005pjb.2 for ; Fri, 14 May 2021 14:34:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Tnpr5ZI5CEPQwncjPhMvgusGoxvKu/oYRb+BORLty1A=; b=b1+TreBxRve6drmZzTds3W2RmPn7y0ltnb8TXZn4L86xmcIYB51lrETu6Mu+YWzTx1 7IXVVs4sbdMBcTzcO0tXWpf8irfLnAiiRVJMpIq/2cKKicL/jwdeUshGs+mDd7YsG9na QWGfIulKXQJyp4Oh8mjSbEQw1iFzG2fWhHYgo0BcwSAcy4MaY8M8IuWufONzn+teB4Fr +1kFFKwiAzJ+QCXrb6NBg7zp66+BIqkScIrQuKDDV/jFphALYcpTndqk2K43gsogD89R IRh9x/r/IKQmJpCNeqqF6srAHlEF3mMymJPMn3D5NRIXzpq8/FXohi/xiLnYBJTOHaPW DPOQ== X-Gm-Message-State: AOAM531OhC6uFNbx10voWA4QdpaPcUpI42zlTFpAifxcyBRP8p0FC36O V030bpiaOjc8W5XrHhK+CiA= X-Google-Smtp-Source: ABdhPJwg9dskad7gD0LH6FEpO0YBPVkBVrMwj/nedP1E3iOFRThhkJWHTcq3slYdeISfn8GoakqxZg== X-Received: by 2002:a17:90a:c297:: with SMTP id f23mr54205825pjt.197.1621028093856; Fri, 14 May 2021 14:34:53 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.34.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:34:53 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Kashyap Desai , Sumit Saxena , Shivasharan S , "James E.J. Bottomley" Subject: [PATCH 27/50] megaraid: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:32:42 -0700 Message-Id: <20210514213356.5264-28-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/megaraid/megaraid_sas_base.c | 4 ++-- drivers/scsi/megaraid/megaraid_sas_fusion.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 8ed347eebf07..94218c573c0e 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -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); } /* diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 2221175ae051..5a28d6b96eb2 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -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); } From patchwork Fri May 14 21:32:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439207 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82A75C433B4 for ; Fri, 14 May 2021 21:35:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 63B69613C5 for ; Fri, 14 May 2021 21:35:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233266AbhENVgN (ORCPT ); Fri, 14 May 2021 17:36:13 -0400 Received: from mail-pg1-f179.google.com ([209.85.215.179]:36423 "EHLO mail-pg1-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233268AbhENVgJ (ORCPT ); Fri, 14 May 2021 17:36:09 -0400 Received: by mail-pg1-f179.google.com with SMTP id c21so262730pgg.3 for ; Fri, 14 May 2021 14:34:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=a3coYQIcBTlo1XaJGE3yro/uqrzUQPfOtJ8NMxeL2f4=; b=bo71krpr5lpdGS+rzi/mKViran/TFF+xN4cjmtLELlRrGd21BXrhujCHZLdbk2N/Qy p5NddVyD4qFMKrgYms+dZZAdnqGo7qhpzY/pfWVejYXlw3p8oNKwDsnUAHoWylC6aapy E3AmU2EmtMNJwvtBVCKxl+R1MIIeVWN4RkZqOOWlDp+2beHdpPinR1OfY3UQBahdY/Mz J2tjzRBNoGE53gUiCG/pf/mk5vg6sR+cyiEFaWoO1IbuQWxEgDDA5a1HqIqlMqjMLrwe PTz9aGkLzEUgc4cznJ4B1kh3/pRN72rdyRyNxUtEzV8zqImH1HihEWuAD3zGOIFOiNOY c7kQ== X-Gm-Message-State: AOAM532Q5tgf5RbSxGbsBmfushDJ6lg3kyIUk55B1/DCnAfbBwpZ5LDb FAQF5NaIM/Gy551Ul+pGujC830GMQUJKSQ== X-Google-Smtp-Source: ABdhPJyJDGYtnkMIsjyogMpL4UuuL+z2Gs9eyA3W5PbukMdlZCacCP7+F8bhBru6SRwM0f/DdeqKbQ== X-Received: by 2002:a63:6f4e:: with SMTP id k75mr13960280pgc.434.1621028097030; Fri, 14 May 2021 14:34:57 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.34.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:34:56 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , "James E.J. Bottomley" Subject: [PATCH 29/50] mvumi: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:32:44 -0700 Message-Id: <20210514213356.5264-30-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/mvumi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c index 9d5743627604..0bdea0da8d4b 100644 --- a/drivers/scsi/mvumi.c +++ b/drivers/scsi/mvumi.c @@ -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); } From patchwork Fri May 14 21:32:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439206 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A989CC433B4 for ; Fri, 14 May 2021 21:35:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 90F1061446 for ; Fri, 14 May 2021 21:35:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233286AbhENVgP (ORCPT ); Fri, 14 May 2021 17:36:15 -0400 Received: from mail-pj1-f53.google.com ([209.85.216.53]:35382 "EHLO mail-pj1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233256AbhENVgM (ORCPT ); Fri, 14 May 2021 17:36:12 -0400 Received: by mail-pj1-f53.google.com with SMTP id pf4-20020a17090b1d84b029015ccffe0f2eso2317659pjb.0 for ; Fri, 14 May 2021 14:35:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=N7VmxOno/PSZ8QeKNuENY9Y9ya4YIHoUlqmAutLYZyk=; b=GDJ44GGy+aTZpgD7dgVbx8akfSqAHRaDT/sAS1upkSlHIxPYkJe14uXE6LTsm079tx BqszOBwoRjKzfEN3hLeEXFuFDJDx0k8g+3hK02z55xyXoDZutI9RQ0y+2WnhAEoVhWi/ XUU7hXmzgNUMfdz8cAXJKXDqcEv3+l3eQHBllq8Y/X8SFlq3MPQoEWTNqfM5ibGvsCUb VP+LK0j9YPUQwAPMUoV+EU5rGZL5OS0Nvu7YwPIm7dfRBGBz4zkehy95s8qj04nE4W1u 4DmqMGVzCZJByYI+kUlkWylUqxekU2qHo2cTcmfNAZnx1YHTz8PSaumWkxYsP9I+g2nD FWug== X-Gm-Message-State: AOAM531CHRJ5+CbYvmYLbL71fv+yhHQpsPQuBzke9HDCGfPmhUwpQisA W3y/Hbr4oRLcCXJVgICU1Z0= X-Google-Smtp-Source: ABdhPJxkOOb0DuL9jl7HPGEsYGIKmQ2wVQvnQEzkzmmTFq4aHEAGwznokVgyhJNLR9pP4YpndF4Xgw== X-Received: by 2002:a17:902:a401:b029:ef:4ee:6a7e with SMTP id p1-20020a170902a401b02900ef04ee6a7emr41575732plq.65.1621028099908; Fri, 14 May 2021 14:34:59 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.34.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:34:59 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Hannes Reinecke , "James E.J. Bottomley" Subject: [PATCH 31/50] myrs: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:32:46 -0700 Message-Id: <20210514213356.5264-32-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/myrs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/myrs.c b/drivers/scsi/myrs.c index 3b68c68d1716..390940919b6c 100644 --- a/drivers/scsi/myrs.c +++ b/drivers/scsi/myrs.c @@ -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; From patchwork Fri May 14 21:32:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439205 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FFCCC433ED for ; Fri, 14 May 2021 21:35:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 18DC36143F for ; Fri, 14 May 2021 21:35:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233287AbhENVgU (ORCPT ); Fri, 14 May 2021 17:36:20 -0400 Received: from mail-pl1-f175.google.com ([209.85.214.175]:40699 "EHLO mail-pl1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233267AbhENVgP (ORCPT ); Fri, 14 May 2021 17:36:15 -0400 Received: by mail-pl1-f175.google.com with SMTP id n3so98922plf.7 for ; Fri, 14 May 2021 14:35:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fhEVAQbeiuG8u4w7wEIEIvBbbtDHPDLgytXrqVt11s8=; b=XvTSds/bzbqx5ozSZjK6IzEuhKV78WN+be4uN9UjrNAhlaUoGuwEeGpkjHv0UUioBc W6UwMmQkX92nwuO82O06tWozeP34QAZqJF9cM8KRHYziw3ucr+49KmxtHBVMpyRE4xF1 Yf21TxaZMIarZkAY8GGCGXenX8wmVFxxnFyX8UIlYXjVxpxyp1md6SbysnKwfQYw3i49 Etn7DwYiGTS6FcEIdCwLeRLflLfiotmCrlHYWbrQlW+Tg1OUKo6B2WmVxkktkv49gRbl MwnRSasYy8SG/F2vp1AbXKbn+eE9c2eU1bULnyv0rxsksqLczVAFXmy/X5BPiMlSi5ID dyQg== X-Gm-Message-State: AOAM53240o0uxq6FL9CDFAKE0WhSOgZNJgFUZtfp3FhxL4ooMMp7JoyH oxSUz07ZOSKeoMM9OtkTws4= X-Google-Smtp-Source: ABdhPJwO5JSJcd+NIzeifx9BIrFfewj0WS4JirU6x1U5a1Qj03+kqlr2uEWv5V6jfk18h1AqWRFx1g== X-Received: by 2002:a17:90a:e550:: with SMTP id ei16mr13502706pjb.127.1621028102934; Fri, 14 May 2021 14:35:02 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.35.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:35:02 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Saurav Kashyap , Javed Hasan , GR-QLogic-Storage-Upstream@marvell.com, "James E.J. Bottomley" Subject: [PATCH 33/50] qedf: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:32:48 -0700 Message-Id: <20210514213356.5264-34-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/qedf/qedf_io.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c index 4869ef813dc4..6883218df66b 100644 --- a/drivers/scsi/qedf/qedf_io.c +++ b/drivers/scsi/qedf/qedf_io.c @@ -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; From patchwork Fri May 14 21:32:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439204 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 209A5C43460 for ; Fri, 14 May 2021 21:35:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F1B77613C5 for ; Fri, 14 May 2021 21:35:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233250AbhENVgW (ORCPT ); Fri, 14 May 2021 17:36:22 -0400 Received: from mail-pj1-f46.google.com ([209.85.216.46]:34751 "EHLO mail-pj1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233313AbhENVgS (ORCPT ); Fri, 14 May 2021 17:36:18 -0400 Received: by mail-pj1-f46.google.com with SMTP id g6-20020a17090adac6b029015d1a9a6f1aso1961324pjx.1 for ; Fri, 14 May 2021 14:35:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=n7gxN0HJk866BhsDvBhRhV28HgCfD2GC970SJ4nhuds=; b=QQBSE8l8lW9M1ZZcVeDXe7ooJnK9OoXMh4hrCIXojTmac462aXJYW2eHDG4rvUtefb kgI1PW8cw/ips9ML6wcuwEwwVLqjRlz4RohK4RlzoOkcsWEjJq5BUPK03h8RQJsZaVBE vyhWWxc+NNwPoNXGFICNBKfRBPSlGuIGjKGSA3ClsKIrHhQrwMq+cibM4/2NIGa9XOre BzF+siuqptsFp+IvvXkVYBHGkhPzGul+/h4TRG16Igst7LWrq7ax/+eIxDbY47BZ8n7M I2OPdgsdBhBplRELd/kGTOxhVTGwNnFv7bryoXMrKr7hLXrxTum1D7eqkTlpB6TP0YPU h6Kw== X-Gm-Message-State: AOAM532MAICqRKnQUU4dfyyiTthkc3Qcl1YVGlNEI8QCnZ3/KItjw4DU 0JtEY7HAME0wE6UESUhHUEY= X-Google-Smtp-Source: ABdhPJxpUODod9qFKex+KnUuDIyVBFp1sJvPg7DTLWd/E/AVb91G5TQJLm2S9Ef6zK7Yr3GcFEN/PA== X-Received: by 2002:a17:90a:474f:: with SMTP id y15mr11422331pjg.108.1621028105945; Fri, 14 May 2021 14:35:05 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.35.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:35:05 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Michael Reed , "James E.J. Bottomley" Subject: [PATCH 35/50] qla1280: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:32:50 -0700 Message-Id: <20210514213356.5264-36-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/qla1280.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c index 928da90b79be..a9a8e1e9c253 100644 --- a/drivers/scsi/qla1280.c +++ b/drivers/scsi/qla1280.c @@ -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); From patchwork Fri May 14 21:32:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439203 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22B86C433B4 for ; Fri, 14 May 2021 21:35:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0702D6143F for ; Fri, 14 May 2021 21:35:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233267AbhENVgX (ORCPT ); Fri, 14 May 2021 17:36:23 -0400 Received: from mail-pf1-f169.google.com ([209.85.210.169]:42828 "EHLO mail-pf1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233288AbhENVgW (ORCPT ); Fri, 14 May 2021 17:36:22 -0400 Received: by mail-pf1-f169.google.com with SMTP id h127so642000pfe.9 for ; Fri, 14 May 2021 14:35:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TlBSfGOkRDloBNFq8/A2UkRZK3YjZI1/M4VMfWPNoUw=; b=dWCBQTzi/WtWyi2Znnc+jggEhLSwKlyzdtVzDPvs44XcxRwrTfTXHnRi0nXcDprCqf hUChReBTY5odXek72Myj1cLcglq27aOePq9aslMVkTOPwq7bBbF9dB9EZYslgy8V/cu8 BQgYje0CElE7jBCed6XymI95ov+TZFS3Bri8MEfYeLK3IkpUrhXyKGn8dioFZsxg14Dx gpe1ztGNdWe+2y+lcKnN00OShqaEEl3wi+Z7vW/4rRf2FeWA3eQN08Nh2AjECcm9Ovjj inZq8WXEbl3ePSeLfnVgkEj5GEnAMBHk59ZsjhgNwoANchAKhx2XXl6R8gQMhkecxgqJ fxag== X-Gm-Message-State: AOAM530PNMAIM2k8ksd3kYjz12yfVttlQJqYQtd5zTVlX/ZcjP0K48ya C9UIJh86S/SmTX8vNRy8QqKV92xLpLXVzg== X-Google-Smtp-Source: ABdhPJzdkJ4Zar06owU9U2d2BqmXsVUx5jgjQ7lTYebuFrzoaksdIA4VWJ+xl0YgoebWQpuy8OQShQ== X-Received: by 2002:a65:48c5:: with SMTP id o5mr49252113pgs.101.1621028109381; Fri, 14 May 2021 14:35:09 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.35.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:35:08 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Nilesh Javali , Manish Rangankar , GR-QLogic-Storage-Upstream@marvell.com, "James E.J. Bottomley" Subject: [PATCH 37/50] qla4xxx: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:32:52 -0700 Message-Id: <20210514213356.5264-38-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/qla4xxx/ql4_iocb.c | 2 +- drivers/scsi/qla4xxx/ql4_os.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla4xxx/ql4_iocb.c b/drivers/scsi/qla4xxx/ql4_iocb.c index cbd1e6ffcd67..eac4b201360b 100644 --- a/drivers/scsi/qla4xxx/ql4_iocb.c +++ b/drivers/scsi/qla4xxx/ql4_iocb.c @@ -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 diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index ad3afe30f617..8429ac66305d 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c @@ -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); From patchwork Fri May 14 21:32:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439202 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4B8EC43461 for ; Fri, 14 May 2021 21:35:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 92AD961440 for ; Fri, 14 May 2021 21:35:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233408AbhENVg2 (ORCPT ); Fri, 14 May 2021 17:36:28 -0400 Received: from mail-pj1-f47.google.com ([209.85.216.47]:33763 "EHLO mail-pj1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233317AbhENVgZ (ORCPT ); Fri, 14 May 2021 17:36:25 -0400 Received: by mail-pj1-f47.google.com with SMTP id b13-20020a17090a8c8db029015cd97baea9so1962543pjo.0 for ; Fri, 14 May 2021 14:35:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/7sN+RIXFXqjemppu6P3wAyAKlrO4T6Y619Mi3GWqk8=; b=jI5J5Y0xM/UYjaNmh/Fho3+X9u4FrddcNf/BfKl7G2zkCZoFpIF4DITXzHIYq6kzbU iDtL8CCZZe5VMFZ8LZ9/o8d7kcY2ejahDFtYXgXfLm8ZYawe3hXNAeGnq7kTpXB9fNU3 9YgVV/GRffHt5HqE+FI/3eoEab+weURL3KPLMs+Dnu3UNoSwHqjZCAZky7OWuNfpDPuz UM87YqLXY2lPMaRzLcs6+JdQpQS89gIVGNV6bjG2YjdODnoW4vOugj3QNdvjMVa4I7Lg VkSszcN/tKNEOZMXjf1Bj5qu7/Nwyg58BpXecsZQKWwuCR5pAuqfpHCAs0qcDMD9csb9 7Q/w== X-Gm-Message-State: AOAM530yI8UaMFSWoMAwV0/2te7KZcWNOVCNgyq+xE6gCEoI6zBCk+Qf mCr4vhSHdWxESVbeIhwB6Qqkl471Wteybg== X-Google-Smtp-Source: ABdhPJzSRR8E+Y4bEYaro6QdwryWklSPJT29ndLjwpA7H0M4PC05ydlkaUkLMpWr7Z6QfwiAhfZYaQ== X-Received: by 2002:a17:90a:e7c2:: with SMTP id kb2mr4756367pjb.193.1621028112110; Fri, 14 May 2021 14:35:12 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.35.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:35:11 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , "James E.J. Bottomley" Subject: [PATCH 39/50] scsi_debug: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:32:54 -0700 Message-Id: <20210514213356.5264-40-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/scsi_debug.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index a5d1633b5bd8..12b4f407143c 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -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; From patchwork Fri May 14 21:32:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439201 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0C24C433B4 for ; Fri, 14 May 2021 21:35:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B268C613C5 for ; Fri, 14 May 2021 21:35:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233435AbhENVgj (ORCPT ); Fri, 14 May 2021 17:36:39 -0400 Received: from mail-pf1-f170.google.com ([209.85.210.170]:45910 "EHLO mail-pf1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230463AbhENVg2 (ORCPT ); Fri, 14 May 2021 17:36:28 -0400 Received: by mail-pf1-f170.google.com with SMTP id d16so631721pfn.12 for ; Fri, 14 May 2021 14:35:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=G6kMAN24fqhfCuFIs/fTfEJbJ8y6iXQyQjJVLriGxIQ=; b=OgEN5w63pfOhIgRhKWcWFtqMgM+fuAXmWUg1V67X3WfSTJ+5r+3lB75VyNP6wu2R3I ZWYeQVIZPR/Nqg/DcWeY2a3EXx9kt+Hb1gyP0S7DvZXojq8C2VZvLvgsmlv+io0vs2aB vPo8Lcm0vt9Yl5K8h9Jzc0Ja72UEMuPRdMf+6auegrXCuhZDkGbq97wk1bAc/fpspZWU ILi2rqN7HBk4O83JeEObC6+vumqHkkg5ULbKK0Pwg8ce4k6uDVmst2fMz/GkL+mJjpna jjXWN9MTPsdhF22wHvLsvNcJ0NAc5JP8Yy9Z5Bzg8Ndet8lFxWtyzFsfSfZHTbi26eqJ 82yQ== X-Gm-Message-State: AOAM531DI7V7ZLnzbUuDYuIeulIkVkx6o/RlsOKBphE2oASCqtiBSTLm VwB0h7jm3c/86a7Lb4f08HQ= X-Google-Smtp-Source: ABdhPJwnSOA3kt5tbY3Ljo3gR0RCMow9AZuyDXglCAIKNHh/IvQ4KvWqIIkgCPYmN+2fz2b0BAfRQg== X-Received: by 2002:a62:16c9:0:b029:24b:a41e:cd6 with SMTP id 192-20020a6216c90000b029024ba41e0cd6mr48576107pfw.52.1621028115138; Fri, 14 May 2021 14:35:15 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.35.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:35:14 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Karan Tilak Kumar , Sesidhar Baddela , "James E.J. Bottomley" Subject: [PATCH 41/50] snic: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:32:56 -0700 Message-Id: <20210514213356.5264-42-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/snic/snic_scsi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/snic/snic_scsi.c b/drivers/scsi/snic/snic_scsi.c index 6dd0ff188bb4..72175072351a 100644 --- a/drivers/scsi/snic/snic_scsi.c +++ b/drivers/scsi/snic/snic_scsi.c @@ -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 */ From patchwork Fri May 14 21:32:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439200 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 563E4C43460 for ; Fri, 14 May 2021 21:35:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3C5FE6143F for ; Fri, 14 May 2021 21:35:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233327AbhENVgm (ORCPT ); Fri, 14 May 2021 17:36:42 -0400 Received: from mail-pl1-f169.google.com ([209.85.214.169]:47073 "EHLO mail-pl1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233417AbhENVgb (ORCPT ); Fri, 14 May 2021 17:36:31 -0400 Received: by mail-pl1-f169.google.com with SMTP id s20so86304plr.13 for ; Fri, 14 May 2021 14:35:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xu/t//jOs37VZtA2QmDpOAmcMU6PvcySoOT1+rnB38o=; b=ksuo6rmo0GhWKgflVrLpbxAyTLLvgfqIkqWED9erxpt91DTsupCgJTPMpvTXcXFCsq 6DozSPuAJWFoJ1nDqef6TSPl0qMSrO4gUqpggMUh4Yk7Ecdr0W4RgJb75KVrnvn1WLw9 bUqLpKhsEMYX1fPoHYvHiB+BWulHm1dIFL1N9J5KUziqCp5ClIoWeuU6Ty5yIKujuBiE X0qgIE+hI8x6hcu9Ar1UeQ1azOb8dhHkEz3l7X4yhu+ysQonBANCPJ+QJlyhFOz2Q1HV 93pW5PiDnrPN0N9TjGo2/b/jAGmiirqlrVLTBx0jHafPDe+8aSYq2bxfvL3ABEm5RFIw huTQ== X-Gm-Message-State: AOAM530i6edCzNHlwPHOem/hp4uqoRRpYZCL5xwk3uCgwRjBjgGxIJuw TujA3t8H/FhzclWaTcHSs/8= X-Google-Smtp-Source: ABdhPJztnnIrsEZMl5XE+TvUVV8bFtt8OUXRt7bUZMhbyf/lcJH8X8gZKbzmFOIYpDQOUmUdjkqzZQ== X-Received: by 2002:a17:90b:e09:: with SMTP id ge9mr10872906pjb.232.1621028118003; Fri, 14 May 2021 14:35:18 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.35.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:35:17 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Finn Thain , Michael Schmitz , "James E.J. Bottomley" Subject: [PATCH 43/50] sun3_scsi: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:32:58 -0700 Message-Id: <20210514213356.5264-44-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/sun3_scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c index 2e3fbc2fae97..3cb543a369f6 100644 --- a/drivers/scsi/sun3_scsi.c +++ b/drivers/scsi/sun3_scsi.c @@ -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; From patchwork Fri May 14 21:33:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439199 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7277C43470 for ; Fri, 14 May 2021 21:35:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 895A461440 for ; Fri, 14 May 2021 21:35:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233445AbhENVgp (ORCPT ); Fri, 14 May 2021 17:36:45 -0400 Received: from mail-pf1-f174.google.com ([209.85.210.174]:38553 "EHLO mail-pf1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233288AbhENVgg (ORCPT ); Fri, 14 May 2021 17:36:36 -0400 Received: by mail-pf1-f174.google.com with SMTP id k19so655531pfu.5 for ; Fri, 14 May 2021 14:35:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/w/3FajyRueFFZTeb5dJrM2lkPjosqY1xTFZi9O7qqQ=; b=X86gOYPU+e6WiGtT0hhzmQpFsH5YaYBa4pxgdUCPPiYqfhvbmXMEN+KF1QQRX9stGC V2Ni7oDDiZPiqbatYCHdUZ/SDfbDvo0csxK/GOY6QVncbC9L8y7vngMfJicxPsqyKtiZ mic3TAW+6QlM57B17hikXUnXdXdlp2lI0CxgLSylkYw40JjAmncYlhtu/loBj07n0mtD d6d3IWapRA02WPHO3uIsjNRu2CJnKgDiDD9llS2+/X1vqzzh5jOOFsvfiC219b9nQ34R hzxJP37frKu0VAmdwXDIyteVdS3NgPTyNz4hD77frSkzECcLXBF4l5bSkh2hYbmyZNlF sQCA== X-Gm-Message-State: AOAM532nwGaaIEWdgRL+kAyREYXUb4RGgPV0pO8TdDIgN7OoSsM/J/d9 QWUz/Tu3wdqK41lh/I6IsnU= X-Google-Smtp-Source: ABdhPJye4je6V0N2XzorJx8j5G210S3C0iHJj0A6DlJPmKhTPNnMMJQCUd3IJB1wBK7wJ8LdThwq7Q== X-Received: by 2002:a62:1796:0:b029:2d5:91b4:642d with SMTP id 144-20020a6217960000b02902d591b4642dmr5082568pfx.7.1621028123335; Fri, 14 May 2021 14:35:23 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.35.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:35:22 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , "James E.J. Bottomley" , Stanley Chu , Can Guo , Avri Altman , Bean Huo , Jaegeuk Kim , Asutosh Das Subject: [PATCH 45/50] ufs: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:33:00 -0700 Message-Id: <20210514213356.5264-46-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/ufs/ufshcd.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index ab707a2c3796..18d8e48e739a 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -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(); } From patchwork Fri May 14 21:33:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439198 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26324C433ED for ; Fri, 14 May 2021 21:35:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E9B9E613C5 for ; Fri, 14 May 2021 21:35:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233360AbhENVgr (ORCPT ); Fri, 14 May 2021 17:36:47 -0400 Received: from mail-pl1-f182.google.com ([209.85.214.182]:42533 "EHLO mail-pl1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233357AbhENVgh (ORCPT ); Fri, 14 May 2021 17:36:37 -0400 Received: by mail-pl1-f182.google.com with SMTP id v13so94347ple.9 for ; Fri, 14 May 2021 14:35:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+BoxzK18WDiATfbb117226xoMEe0eHeSjJScLd24Qys=; b=FI2/rKCguoo0wjwRLU9B20o7w++psGQTvbwBrbrwYyKyuz+QWqfd+9NmnQlMs7c0lF V9OeOUeWUTMQ7lH3bGB1XNuRqHmejjNu531OVRlC6FMsqBLfndGf+hM8lMd13MaiMSc1 3qha4KzLdQJIFxR2V9G3GggvNTLTdqIMZWkt+4pkqaa7KI2spEM//KLfH3cDSt+pVh1i 1QrewiC7uLszgUOYve7N70G+yRfQPRxOLytfb5+CXS5gNjpA4CXpnq2Uslz4mxD+Q1dm T4/MvUEC0teNGmCZ9f5+w/ENDrnWIQDa8qpWIZXTgRgVeDKiOM+g9V7AmQM1bxg1Awla pkjg== X-Gm-Message-State: AOAM531bEcW5AN6rjen0/Ow5OS0wnsN7FkWd3zlzCU46F7YtqAeUfNAr S40hWftCwo5yuPqZoCr3OOE= X-Google-Smtp-Source: ABdhPJwtEG+7t4OOyH6jy/3kNHe4rISHGdIdEutFSEXy4WgwQpbu8PSSq5sWRbzeN6/LI5PTIwscXA== X-Received: by 2002:a17:90b:1a92:: with SMTP id ng18mr55338283pjb.213.1621028124876; Fri, 14 May 2021 14:35:24 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.35.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:35:24 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , "Michael S. Tsirkin" , Jason Wang , "James E.J. Bottomley" Subject: [PATCH 46/50] virtio_scsi: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:33:01 -0700 Message-Id: <20210514213356.5264-47-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/scsi/virtio_scsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index b9c86a7e3b97..a7cd82d5620f 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c @@ -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]; From patchwork Fri May 14 21:33:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439196 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96E55C43603 for ; Fri, 14 May 2021 21:35:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7D07161440 for ; Fri, 14 May 2021 21:35:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233419AbhENVgt (ORCPT ); Fri, 14 May 2021 17:36:49 -0400 Received: from mail-pg1-f173.google.com ([209.85.215.173]:41490 "EHLO mail-pg1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233411AbhENVgm (ORCPT ); Fri, 14 May 2021 17:36:42 -0400 Received: by mail-pg1-f173.google.com with SMTP id t30so247567pgl.8 for ; Fri, 14 May 2021 14:35:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vJiWrRK/gssXKJ/acngQthRIJI+9PzFLnYjOWh9yIdY=; b=QSmmZLBgJiOyT8nc4UxyQWI1ufWpT6zldSshT3NhDbgow7fRTr2eWU4AAlKAim2CSc jrkV20wxS47v3oClpczn2AoasAyLN0Z6eZwkdG0yl+BBGojK9OwPFsGxEJuA7aZkTRF+ 3TY7C0idVKONBY9PMfAfauYsInpd9b1Ig+UQZA/FkfxW/9esugF56qb/D05vQetl4Em0 bQjF65yYmuLqoHiIrzzj7mn2bprbnWBBfe9f2HWVQcAmxotdqPLLlocIKJZC4eKtMNa4 d6+7Pr9xn9SryXCeB/THR8pmHtHz56URQpVdZyJq7CF0hDyFPXEjbKRcJ473tnfZVLOD RITQ== X-Gm-Message-State: AOAM532c2c1id57Ch+RETORwLR/Yth1jZiLNA4iQ42S+QpFObvxpUnwh tUn/mYZG7yZYMuAxj5X5xjI= X-Google-Smtp-Source: ABdhPJxfggWRDhpaSXfGtZS9SHjd8vNoFB2Vt1lbpMv7PrOc2ce2d8U+p/oMENLiYq7K2pGZm9AHYg== X-Received: by 2002:a63:b211:: with SMTP id x17mr41249114pge.106.1621028129543; Fri, 14 May 2021 14:35:29 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.35.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:35:29 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Mike Christie , Bodo Stroesser , Himanshu Madhani Subject: [PATCH 48/50] tcm_loop: Use blk_req() instead of scsi_cmnd.request Date: Fri, 14 May 2021 14:33:03 -0700 Message-Id: <20210514213356.5264-49-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- drivers/target/loopback/tcm_loop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index 2687fd7d45db..19c4f21d4d10 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c @@ -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; } From patchwork Fri May 14 21:33:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 439197 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCDACC4360C for ; Fri, 14 May 2021 21:35:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AD796613C5 for ; Fri, 14 May 2021 21:35:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233425AbhENVgv (ORCPT ); Fri, 14 May 2021 17:36:51 -0400 Received: from mail-pj1-f51.google.com ([209.85.216.51]:51090 "EHLO mail-pj1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233455AbhENVgp (ORCPT ); Fri, 14 May 2021 17:36:45 -0400 Received: by mail-pj1-f51.google.com with SMTP id t11so552864pjm.0 for ; Fri, 14 May 2021 14:35:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+u5h4uPf8KfdnguoDucGeAYgNag4EDwJPMJl7vidv4k=; b=beFAIeAwABZeHLlkPtF6Ya1M9UtNR2I2y2qJbHuow3QrW24Du195NK+/3EcBr1j5/P cFfz60eGhs5hCi0arHmB3EJOOxMoqgCAOp/Bjh4f8oucgEay2IMQapdkZ/JGiFFLJsf4 Fwotry1pYbXg64qq9k1cwFtoCOFV6zMtr5h1t0092JUimo57W78iQuu4LNVYPCYkMkCH Z//CgXLLMf/9soTXQocrsgVeVskASXvqIuPJ/JrMni3H6nrQNKKSAKTojXwts6hZwVkg tCXIM87jQueyTcGxlkXxtEy6EGVsTgBAtEqGO7dMBf33NnsGZ+c+SnvsCbPduZIymYIo E1sw== X-Gm-Message-State: AOAM533DCGfbvCX0zE6aDASpl2s6kfyHo7+UmWIjS1/U7TaTrecgVvLE IcuFte3NSwDiAWpEUByyotY= X-Google-Smtp-Source: ABdhPJx8ggpkYia33dPRZcM+QaMRkDtXDNflFeP1ubZrFE7jB4KdvAPoxj10fHNCfcznhtWPyv3XdQ== X-Received: by 2002:a17:902:aa46:b029:ef:8a47:ca53 with SMTP id c6-20020a170902aa46b02900ef8a47ca53mr14212576plr.74.1621028132749; Fri, 14 May 2021 14:35:32 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:e40c:c579:7cd8:c046]) by smtp.gmail.com with ESMTPSA id js6sm9307262pjb.0.2021.05.14.14.35.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 May 2021 14:35:32 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Christoph Hellwig , Hannes Reinecke , Ming Lei , "James E.J. Bottomley" Subject: [PATCH 50/50] core: Remove the request member from struct scsi_cmnd Date: Fri, 14 May 2021 14:33:05 -0700 Message-Id: <20210514213356.5264-51-bvanassche@acm.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210514213356.5264-1-bvanassche@acm.org> References: <20210514213356.5264-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Since all scsi_cmnd.request users are gone, remove this pointer from the scsi_cmnd structure. Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Ming Lei Signed-off-by: Bart Van Assche --- drivers/scsi/scsi_error.c | 1 - drivers/scsi/scsi_lib.c | 1 - include/scsi/scsi_cmnd.h | 3 --- 3 files changed, 5 deletions(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 8846e5066f92..1dac2725fd96 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -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; diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index e88ce8f747ee..f03a42f239d8 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -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)) diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index a68521e6ce57..265fe4599b3e 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -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