From patchwork Mon Aug 9 23:03:04 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: 494165 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 CF604C4320A for ; Mon, 9 Aug 2021 23:04:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9AC8A60F35 for ; Mon, 9 Aug 2021 23:04:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235051AbhHIXE0 (ORCPT ); Mon, 9 Aug 2021 19:04:26 -0400 Received: from mail-pj1-f51.google.com ([209.85.216.51]:37489 "EHLO mail-pj1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229688AbhHIXEZ (ORCPT ); Mon, 9 Aug 2021 19:04:25 -0400 Received: by mail-pj1-f51.google.com with SMTP id cp15-20020a17090afb8fb029017891959dcbso1455623pjb.2 for ; Mon, 09 Aug 2021 16:04:04 -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=T4l2L2bo4HSpQ9tmJiH9KxIIo4Z/lQ1TJBcn2iUc+U0=; b=q+ltq1YzgvwdSAvYY+D89qllV522qkHGSfmcA6R2UxqNiD/KpWNv3SDBoJimZnpdaa QKLEKSIJLJxC8byYzwZ/5hLHJVZyNeKy4yzfKOi7UvwXS/rePDs4s43GGbtWdlSDVx2B x4n6ckboJPfeVHo5gNTfycM9S4TaYWMUr6tNRlMwLlmjOnmdk7V7VFVZ3rL7DdkWmxDw CqmGRYAr9WHzlGIBIKYnlrfaKjGtvFbm+Y2V/YEjfWpxh/Sd5+WEGoN1+5lIQMWiJeOy hMz/OtmBvUL+3cHziYomep5No5PauC9rdNXjP4GL2UVT7iTIQpAhSDGgew/DMMBvLkjB m2Ng== X-Gm-Message-State: AOAM533ojGCG8TuGrZ+VrOmPrjrPJTaQW0vTnFkAjj98nbY4UuNBfpyF xoMLrWhqwAs0m9nbtYNZXqo= X-Google-Smtp-Source: ABdhPJx59BWf5AcjdALY1ag0DMwho+097kVVrbzc56H4idrwCeDd6M6e0rEb1qklQ/faU28d34fo4Q== X-Received: by 2002:a17:90b:f10:: with SMTP id br16mr27265718pjb.76.1628550243849; Mon, 09 Aug 2021 16:04:03 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.04.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:04:03 -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 v5 01/52] core: Introduce the scsi_cmd_to_rq() function Date: Mon, 9 Aug 2021 16:03:04 -0700 Message-Id: <20210809230355.8186-2-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 Reviewed-by: Hannes Reinecke --- 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 90da9617d28a..e76278ea1fee 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 *scsi_cmd_to_rq(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 Mon Aug 9 23:03:06 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: 494164 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 E8BBEC432BE for ; Mon, 9 Aug 2021 23:04:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BCDCE60EE7 for ; Mon, 9 Aug 2021 23:04:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235309AbhHIXE3 (ORCPT ); Mon, 9 Aug 2021 19:04:29 -0400 Received: from mail-pj1-f47.google.com ([209.85.216.47]:51177 "EHLO mail-pj1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235392AbhHIXE2 (ORCPT ); Mon, 9 Aug 2021 19:04:28 -0400 Received: by mail-pj1-f47.google.com with SMTP id bo18so8300931pjb.0 for ; Mon, 09 Aug 2021 16:04:07 -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=sYyDzkQscy0lkr4Zi/O4lCsrEgwRq/OBtfUMxYFRILY=; b=SCSQ2CMQbeaYMIwumSHKEvJEnUutlhiDKjG+E7loLRU2xLqNKUYttWdstKln4FHpLL NzlnftYFBQUCjp0FDmXOUqTAkU+eLo/tVF/zrwvzQHbdhLOxbCe1+2EzyosLSplZ7Df9 GULa3g1uaYB2BufXMId6Km9OD3JBXWv3eyQ87mfouNVKHBuj2m7zVira0Vx3vpQst49S DhOaTwN1kCsyCtlUDQpi00b2RVFtHlLPzS3+n3tIXgBC5Z+2pEc8tFwTGEnwSa3dcYXe 8FY9x8KmJTeGXG+gNVpdOlh3r6ftsBZBo+e97wL/xud1aUqzY5NyBY+869RMLELk5V+M ZeVA== X-Gm-Message-State: AOAM532creQYNDVeZCVfg8nb6RRroaB0IFagC4Ubrmj3wiS2enOdWtHK 1ukIeWzSklHv18no03g/U0U= X-Google-Smtp-Source: ABdhPJwCloh3n7Y+/thKO7j4CB03lPuCg2yAq+snS94LD1uO4QwJSwImY1syixJ0b+61ZBPeJKqN+w== X-Received: by 2002:a63:b950:: with SMTP id v16mr94278pgo.328.1628550247422; Mon, 09 Aug 2021 16:04:07 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.04.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:04: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 v5 03/52] sd: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:06 -0700 Message-Id: <20210809230355.8186-4-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() instead. This patch does not change any functionality. Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Ming Lei Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke --- drivers/scsi/sd.c | 33 +++++++++++++++++---------------- drivers/scsi/sd_zbc.c | 10 +++++----- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index c1b75f159e0c..ac431b0477da 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -776,8 +776,9 @@ 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 request *rq = scsi_cmd_to_rq(scmd); + struct bio *bio = rq->bio; + unsigned int prot_op = sd_prot_op(rq_data_dir(rq), dix, dif); unsigned int protect = 0; if (dix) { /* DIX Type 0, 1, 2, 3 */ @@ -868,7 +869,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 = scsi_cmd_to_rq(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)); @@ -904,7 +905,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 = scsi_cmd_to_rq(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)); @@ -936,7 +937,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 = scsi_cmd_to_rq(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)); @@ -966,7 +967,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 = scsi_cmd_to_rq(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)); @@ -1063,7 +1064,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 = scsi_cmd_to_rq(cmd); struct scsi_device *sdp = cmd->device; struct scsi_disk *sdkp = scsi_disk(rq->rq_disk); struct bio *bio = rq->bio; @@ -1112,7 +1113,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 = scsi_cmd_to_rq(cmd); struct scsi_disk *sdkp = scsi_disk(rq->rq_disk); /* flush requests don't perform I/O, zero the S/G table */ @@ -1210,7 +1211,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 = scsi_cmd_to_rq(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)); @@ -1324,7 +1325,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 = scsi_cmd_to_rq(cmd); switch (req_op(rq)) { case REQ_OP_DISCARD: @@ -1370,7 +1371,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 = scsi_cmd_to_rq(SCpnt); u8 *cmnd; if (rq->rq_flags & RQF_SPECIAL_PAYLOAD) @@ -1875,7 +1876,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(scsi_cmd_to_rq(scmd)->rq_disk); /* New SCSI EH run, reset gate variable */ sdkp->ignore_medium_access_errors = false; @@ -1895,7 +1896,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(scsi_cmd_to_rq(scmd)->rq_disk); struct scsi_device *sdev = scmd->device; if (!scsi_device_online(sdev) || @@ -1936,7 +1937,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 = scsi_cmd_to_rq(scmd); struct scsi_device *sdev = scmd->device; unsigned int transferred, good_bytes; u64 start_lba, end_lba, bad_lba; @@ -1991,8 +1992,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 request *req = scsi_cmd_to_rq(SCpnt); + struct scsi_disk *sdkp = scsi_disk(req->rq_disk); int sense_valid = 0; int sense_deferred = 0; diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c index 186b5ff52c3a..b9757f24b0d6 100644 --- a/drivers/scsi/sd_zbc.c +++ b/drivers/scsi/sd_zbc.c @@ -243,7 +243,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 = scsi_cmd_to_rq(cmd); struct scsi_disk *sdkp = scsi_disk(rq->rq_disk); sector_t sector = blk_rq_pos(rq); @@ -321,7 +321,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 = scsi_cmd_to_rq(cmd); struct scsi_disk *sdkp = scsi_disk(rq->rq_disk); unsigned int wp_offset, zno = blk_rq_zone_no(rq); unsigned long flags; @@ -386,7 +386,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 = scsi_cmd_to_rq(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); @@ -442,7 +442,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 = scsi_cmd_to_rq(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); @@ -516,7 +516,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 = scsi_cmd_to_rq(cmd); if (op_is_zone_mgmt(req_op(rq)) && result && From patchwork Mon Aug 9 23:03:07 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: 494163 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 3DACCC4320A for ; Mon, 9 Aug 2021 23:04:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1DBB160EE7 for ; Mon, 9 Aug 2021 23:04:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235439AbhHIXEf (ORCPT ); Mon, 9 Aug 2021 19:04:35 -0400 Received: from mail-pj1-f49.google.com ([209.85.216.49]:41740 "EHLO mail-pj1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235467AbhHIXEa (ORCPT ); Mon, 9 Aug 2021 19:04:30 -0400 Received: by mail-pj1-f49.google.com with SMTP id fa24-20020a17090af0d8b0290178bfa69d97so2487914pjb.0 for ; Mon, 09 Aug 2021 16:04: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=x8zxBgk79cdBC45+HLy/e1lDboxU7tCb3KFICdDIvz0=; b=sPkevpWcBuRoSsT3E0TfWNRiZjR0btR8bM74p/KrRDzAx8BL/jwQ6AMIaSdFOcpPSn PVVKXCVZsNMmmKWF6AmQHOp0BlWZZI+AnAxKrPvfUCd84N4c2BtHhCPYBF1K0x7ZnJgY UMftin039hywUhWH54dSumGRH1y0y6klmJB2ojcvsaxjyBFG6fmoOldIxFREwXz1bwD7 J77yAZExBvE4x4XW5UUbdfL9DbHC72Cv06e2nWAsmOs6PK4wzrdXkfB2JvW6wruwIsqZ 1TKXOGP+2YqBoslbcbzjQWPJ03L+/6HUkJy9DI/PC1yAsdD0UwJoIH30bsyL/c4+ORWc yklQ== X-Gm-Message-State: AOAM5300hJRbkInqJhvXip6XV4/hAuHifQT3xlk34bnV2ieOT0vD2HUu Qg2TaPklg4e0CiEEjRpB4vQ= X-Google-Smtp-Source: ABdhPJz1Ws5f6zydBqHZ/Ynl7W7+SGBbnQlWzVbrnlkcqGtMaGJDcnZpAOM1iFIIcTqAUF8vNAcLXQ== X-Received: by 2002:a62:7b50:0:b029:3cd:e227:3486 with SMTP id w77-20020a627b500000b02903cde2273486mr62286pfc.74.1628550248993; Mon, 09 Aug 2021 16:04:08 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.04.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:04:08 -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 v5 04/52] sr: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:07 -0700 Message-Id: <20210809230355.8186-5-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() 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 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index 6203a8b58d40..6a96151d3630 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -331,7 +331,8 @@ 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 request *rq = scsi_cmd_to_rq(SCpnt); + struct scsi_cd *cd = scsi_cd(rq->rq_disk); #ifdef DEBUG scmd_printk(KERN_INFO, SCpnt, "done: %x\n", result); @@ -353,16 +354,14 @@ static int sr_done(struct scsi_cmnd *SCpnt) break; error_sector = get_unaligned_be32(&SCpnt->sense_buffer[3]); - if (SCpnt->request->bio != NULL) - block_sectors = - bio_sectors(SCpnt->request->bio); + if (rq->bio != NULL) + block_sectors = bio_sectors(rq->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; + good_bytes = (error_sector - blk_rq_pos(rq)) << 9; if (good_bytes < 0 || good_bytes >= this_count) good_bytes = 0; /* @@ -394,7 +393,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 = scsi_cmd_to_rq(SCpnt); blk_status_t ret; ret = scsi_alloc_sgtables(SCpnt); From patchwork Mon Aug 9 23:03: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: 494162 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 9B418C432BE for ; Mon, 9 Aug 2021 23:04:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7998C60EE7 for ; Mon, 9 Aug 2021 23:04:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235520AbhHIXEf (ORCPT ); Mon, 9 Aug 2021 19:04:35 -0400 Received: from mail-pl1-f177.google.com ([209.85.214.177]:38821 "EHLO mail-pl1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235676AbhHIXEb (ORCPT ); Mon, 9 Aug 2021 19:04:31 -0400 Received: by mail-pl1-f177.google.com with SMTP id a5so2656075plh.5 for ; Mon, 09 Aug 2021 16:04:10 -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=l6VDWq6IVEh87e1uNmLaYE9v1k4d4/jK9l4qdKk6+CY=; b=f0XDGhghGcp01AjxSx4P/Oz5dnbbJshI4FYfhEvCkT+NRr7fRgIOY9AnGOnZLrTRDD EDYyNPH1faO/oHCAY8KgrM+IP2vlS/Lt7O4RNQdHB+ScFP+W2nRdcbQWEnmctiNITg4j 4UihcBXPwPHFToIZ6iXA78bJNbpaWJpwSS272MPidj7iWwmbfSihNe50cwN7q7yAQ+NM wri+iCwcN8dIFzNBD2r+WN9xfa056uZGln8m+w8TWcaNj9vsFHzf4D5N3Ife5/nTxJUk ll8aA6t0dpUDWFlox1hBLUXyrFiiOTrjclAacE85FXMN3G5SsTqFChggCD4dkFdfBZZp SQOA== X-Gm-Message-State: AOAM530l4UP7eknKNCHayTnjfflPXGJGJiGvWXSg62x8igVJKCl8fMzH mMI9DqIaYq7VLRmINCPQt28= X-Google-Smtp-Source: ABdhPJyv2xaiCyCj0X+Tgb37URVGrXScI4466Hgz3mh/AlvtH4ZqwOnxQUaUlBpt6+Ytb0uLuUz8JQ== X-Received: by 2002:aa7:9254:0:b029:3c9:268e:ae68 with SMTP id 20-20020aa792540000b02903c9268eae68mr14697510pfp.58.1628550250550; Mon, 09 Aug 2021 16:04:10 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.04.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:04:09 -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 v5 05/52] scsi_transport_fc: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:08 -0700 Message-Id: <20210809230355.8186-6-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() instead. This patch does not change any functionality. Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Ming Lei Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke --- drivers/scsi/scsi_transport_fc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 49748cd817a5..60e406bcf42a 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c @@ -3804,7 +3804,7 @@ bool fc_eh_should_retry_cmd(struct scsi_cmnd *scmd) struct fc_rport *rport = starget_to_rport(scsi_target(scmd->device)); if ((rport->port_state != FC_PORTSTATE_ONLINE) && - (scmd->request->cmd_flags & REQ_FAILFAST_TRANSPORT)) { + (scsi_cmd_to_rq(scmd)->cmd_flags & REQ_FAILFAST_TRANSPORT)) { set_host_byte(scmd, DID_TRANSPORT_MARGINAL); return false; } From patchwork Mon Aug 9 23:03:12 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: 494161 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 1F07CC4320E for ; Mon, 9 Aug 2021 23:04:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3DD960F35 for ; Mon, 9 Aug 2021 23:04:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236272AbhHIXEj (ORCPT ); Mon, 9 Aug 2021 19:04:39 -0400 Received: from mail-pj1-f41.google.com ([209.85.216.41]:36382 "EHLO mail-pj1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236239AbhHIXEh (ORCPT ); Mon, 9 Aug 2021 19:04:37 -0400 Received: by mail-pj1-f41.google.com with SMTP id u13-20020a17090abb0db0290177e1d9b3f7so1460437pjr.1 for ; Mon, 09 Aug 2021 16:04:17 -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=giX+Q5YLxAG/WYjc3QLRgqxBXl2k14UR8r/KtJMjROs=; b=BEeI1RhaB0G01hrqwlUi44TlKFcjH4ofkdjXX6qNoaQpduyh5TMUTtS2nCgQZYX74G 1+vjCHc3DNrQNybEhz3I9ub/GmrDjnqZbU2ZG+3rZDWHUdzSKpDFWzfSDRwNwWxMhA1P puX0vyNtpQ8P27wR2NixIlPdkHmUKPuWVGI2CT9BWGa0e/SNif9XcsQYXiTQtBjpN/P7 8Pim43yNbDK57azPMHEtJ49yBPoK20stHxdhZgC7m+Z1LZJHsm6e5UCU46r1HJYSYc3O GsNsHpCRD3XJVEwWwDfzeUrcZ8Y03dMLoDXPcpwvQDU8w8f6xWXJoz10T9F10Q+0Ghkq geQA== X-Gm-Message-State: AOAM5316Af6c/SYaN/lAkbkU1UImZyiPl16uVV3BurYpCnFsMq0b7qmJ 2Js7Uh+qpdHyHc+esR11H5A= X-Google-Smtp-Source: ABdhPJzbjEP/1k3ald2qIZ52aFjhQD/PAXUV+dJY8UyRtLFyRIsk23qrCXTtbTiKyRdM6pcnp7bFeg== X-Received: by 2002:a17:902:9897:b029:12d:17ac:3d40 with SMTP id s23-20020a1709029897b029012d17ac3d40mr8935514plp.67.1628550256615; Mon, 09 Aug 2021 16:04:16 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.04.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:04:16 -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 v5 09/52] RDMA/srp: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:12 -0700 Message-Id: <20210809230355.8186-10-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() instead. This patch does not change any functionality. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke --- drivers/infiniband/ulp/srp/ib_srp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 8d5cf5eb5778..71eda91e810c 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -1280,7 +1280,7 @@ static bool srp_terminate_cmd(struct scsi_cmnd *scmnd, void *context_ptr, { struct srp_terminate_context *context = context_ptr; struct srp_target_port *target = context->srp_target; - u32 tag = blk_mq_unique_tag(scmnd->request); + u32 tag = blk_mq_unique_tag(scsi_cmd_to_rq(scmnd)); struct srp_rdma_ch *ch = &target->ch[blk_mq_unique_tag_to_hwq(tag)]; struct srp_request *req = scsi_cmd_priv(scmnd); @@ -2152,6 +2152,7 @@ static void srp_handle_qp_err(struct ib_cq *cq, struct ib_wc *wc, static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd) { + struct request *rq = scsi_cmd_to_rq(scmnd); struct srp_target_port *target = host_to_target(shost); struct srp_rdma_ch *ch; struct srp_request *req = scsi_cmd_priv(scmnd); @@ -2166,8 +2167,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(rq->tag < 0); + tag = blk_mq_unique_tag(rq); ch = &target->ch[blk_mq_unique_tag_to_hwq(tag)]; spin_lock_irqsave(&ch->lock, flags); @@ -2791,7 +2792,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(scsi_cmd_to_rq(scmnd)); ch_idx = blk_mq_unique_tag_to_hwq(tag); if (WARN_ON_ONCE(ch_idx >= target->ch_count)) return SUCCESS; From patchwork Mon Aug 9 23:03: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: 494160 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 4AB33C4338F for ; Mon, 9 Aug 2021 23:04:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2674A60EE7 for ; Mon, 9 Aug 2021 23:04:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236930AbhHIXEl (ORCPT ); Mon, 9 Aug 2021 19:04:41 -0400 Received: from mail-pj1-f51.google.com ([209.85.216.51]:45920 "EHLO mail-pj1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235309AbhHIXEk (ORCPT ); Mon, 9 Aug 2021 19:04:40 -0400 Received: by mail-pj1-f51.google.com with SMTP id m24-20020a17090a7f98b0290178b1a81700so2386827pjl.4 for ; Mon, 09 Aug 2021 16:04:19 -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=96BcAWjd2E5/FjUNSuNIq7ZLjvEwKHE+7FePnmlgD2c=; b=M9NSwFUnf13YRhB0FwRV5m/a+UisDUJDLRoIg84mHZfo4PY2iInFJp5s+G4QsDI4cl U3p7h8ik+BoT4O4GlfkEwLTM6zKIodEvpg/VmNooKDOuIlyBDQm7Ie9kvUhfEoAwfoSY QMZUEDmE0tnqOu9aQn/CI/3m9rsHV3NYBF3zjYe3W/l+YeXOnULnZNN3LA2moDonSKWY Cq8c3D9YQZzkpL5FkOEoTg9dCQZK0ZaqVStFBIpadMWMSnZRKlmfRLu2159TZ6c9styb jw7dyhqODqANafV1piSSBaV79MpNPnuktNGqrtkw7LOch5RL8kypsX35hvf0l84BDyge N5AQ== X-Gm-Message-State: AOAM532gSrRdCrjwgQzoWUrEyO7O1E+RYXj3a0EloPy02ClxL9bHadNc ZuJbFeraZBcnEqw04LhJodY= X-Google-Smtp-Source: ABdhPJwLdRRVib0SR3nzWTRgMGWQQFFwnCV0jeYIX+CP5NzTMpIlocDCGl9191ahuisvc1uPxQrx8Q== X-Received: by 2002:a17:902:c202:b029:12c:9970:bdf9 with SMTP id 2-20020a170902c202b029012c9970bdf9mr11622130pll.30.1628550259583; Mon, 09 Aug 2021 16:04:19 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.04.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:04:19 -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 v5 11/52] 53c700: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:14 -0700 Message-Id: <20210809230355.8186-12-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() instead. This patch does not change any functionality. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke --- 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 1c6b4e672687..a12e3525977d 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 = scsi_cmd_to_rq(SCp)->tag; CDEBUG(KERN_DEBUG, SCp, "sending out tag %d, slot %p\n", slot->tag, slot); } else { From patchwork Mon Aug 9 23:03: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: 494159 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 9042BC432BE for ; Mon, 9 Aug 2021 23:04:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6A55A61004 for ; Mon, 9 Aug 2021 23:04:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236943AbhHIXEr (ORCPT ); Mon, 9 Aug 2021 19:04:47 -0400 Received: from mail-pj1-f54.google.com ([209.85.216.54]:55924 "EHLO mail-pj1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236947AbhHIXEn (ORCPT ); Mon, 9 Aug 2021 19:04:43 -0400 Received: by mail-pj1-f54.google.com with SMTP id ca5so30337804pjb.5 for ; Mon, 09 Aug 2021 16:04:22 -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=eKg6z51wFV7biatzkNM4Hts6TkZNBCWvFreLQRIkp/I=; b=VEVI9rz3wAmgqvFO2wAf0yPRkDsGI6gnPcbBJInck8tm9nVdkpz+z5oQTS5rEvSAkQ 6XfKzP0wJsChJA4JZNDmT8rOoDB7lV/ubGqZRrDIC9pgONCoqVCDwBb2Kj3kvKToRmOA ke1l3Lw5NEmu/aqHnk25txJ0+4YyuwwMkl8CXfsvrB48qta4zQlcnh7CxXjUpCWynlaT U+0YyRQk5nz3sZ1KVkWXwGeDa8u+goLR5segxkkpesZ/J7OaqQkROmxNaqYhiM7TxJMt vvMvvi+1WR7xjlAiAsZki259faD2n9sFJDBTFmOO/tZ4tIxOPO0SZepGiP6ihP5NJiMO 84jQ== X-Gm-Message-State: AOAM5336BSFu9Fpqra2jK59dZWeJSmXbHr8N1wPoyIKaGc5hD2MVD3Vu aXCnqamUucGH8ydGAcXGUps= X-Google-Smtp-Source: ABdhPJzNn6N5yeFfz3RP4cp/VYt5wSejoa/tQrJXwiZP2q3adwHLjvIWxaNOFSN6xvi7KVWRwY0G8A== X-Received: by 2002:a65:5342:: with SMTP id w2mr377622pgr.333.1628550262479; Mon, 09 Aug 2021 16:04:22 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.04.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:04:21 -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 v5 13/52] aacraid: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:16 -0700 Message-Id: <20210809230355.8186-14-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() instead. This patch does not change any functionality. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke --- 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 267934d2f14b..c2d6f0a9e0b1 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -1504,7 +1504,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 = scsi_cmd_to_rq(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..deb32c9f4b3e 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[scsi_cmd_to_rq(scmd)->tag]; /* * Null out fields that depend on being zero at the start of * each I/O From patchwork Mon Aug 9 23:03: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: 494158 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 7B304C4338F for ; Mon, 9 Aug 2021 23:04:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5D65D61002 for ; Mon, 9 Aug 2021 23:04:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236996AbhHIXEu (ORCPT ); Mon, 9 Aug 2021 19:04:50 -0400 Received: from mail-pj1-f49.google.com ([209.85.216.49]:52908 "EHLO mail-pj1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236965AbhHIXEq (ORCPT ); Mon, 9 Aug 2021 19:04:46 -0400 Received: by mail-pj1-f49.google.com with SMTP id nt11so7148199pjb.2 for ; Mon, 09 Aug 2021 16:04: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=Z9le2znCFiWxH/qpKzW0BBcMGqfV1LOmADjtvCBfw3k=; b=DkK5yqtQdrxIWX2rhMzhbXu/u9tMdhgabMTpvzBhXFgQNfkKVChQ/cvtDns1sfP9Cq i6eSGqyUNceevgfqMd4v3UveA4esB2ZXTClGy4sGQS/j/RvjHEq4R3cV5qA2nXvQcSZb impceVxPLSLyhcTMhwIaPU6iyan+aepJefeyZG3QTsXJLwp7AN2vN4/PbJkGDxIvBtK9 6nwew+sy/u+FgKlVbbCSLcSwmbj3GWJ12/rhG7AdpFRLIysFCtsGnam4QDyulxkw2DRx POU1kQsXFvyU3KBbwj05ct4MMA6gu5m3Zsm0Y1zeHL8e14AVaLrBdYsFSpUPfbmXIPvU tsNg== X-Gm-Message-State: AOAM531VjcPXIog6h5i++8RiQCY+f+WO1u5s0nocfb2QH8LfgB1rx99s G9vA/241eQbLQZ492L/TP4I= X-Google-Smtp-Source: ABdhPJwm/vI6dViS+8PIp4bQ8OVsmjEhLnu4/4G8mFhAvwP6tDwOz064Fyd9WL+DsjxMRMLQTqcT7A== X-Received: by 2002:a17:902:bd82:b029:129:2e87:9946 with SMTP id q2-20020a170902bd82b02901292e879946mr22311947pls.53.1628550265262; Mon, 09 Aug 2021 16:04:25 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.04.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:04:24 -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 v5 15/52] aha1542: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:18 -0700 Message-Id: <20210809230355.8186-16-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() instead. This patch does not change any functionality. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke --- drivers/scsi/aha1542.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c index 1210e61afb18..584a59522038 100644 --- a/drivers/scsi/aha1542.c +++ b/drivers/scsi/aha1542.c @@ -262,11 +262,12 @@ static void aha1542_free_cmd(struct scsi_cmnd *cmd) struct aha1542_cmd *acmd = scsi_cmd_priv(cmd); if (cmd->sc_data_direction == DMA_FROM_DEVICE) { + struct request *rq = scsi_cmd_to_rq(cmd); void *buf = acmd->data_buffer; struct req_iterator iter; struct bio_vec bv; - rq_for_each_segment(bv, cmd->request, iter) { + rq_for_each_segment(bv, rq, iter) { memcpy_to_page(bv.bv_page, bv.bv_offset, buf, bv.bv_len); buf += bv.bv_len; @@ -447,11 +448,12 @@ static int aha1542_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *cmd) #endif if (cmd->sc_data_direction == DMA_TO_DEVICE) { + struct request *rq = scsi_cmd_to_rq(cmd); void *buf = acmd->data_buffer; struct req_iterator iter; struct bio_vec bv; - rq_for_each_segment(bv, cmd->request, iter) { + rq_for_each_segment(bv, rq, iter) { memcpy_from_page(buf, bv.bv_page, bv.bv_offset, bv.bv_len); buf += bv.bv_len; From patchwork Mon Aug 9 23:03: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: 494157 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 4452EC4320A for ; Mon, 9 Aug 2021 23:04:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 25C9260FE3 for ; Mon, 9 Aug 2021 23:04:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236272AbhHIXFA (ORCPT ); Mon, 9 Aug 2021 19:05:00 -0400 Received: from mail-pj1-f51.google.com ([209.85.216.51]:40660 "EHLO mail-pj1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237001AbhHIXEv (ORCPT ); Mon, 9 Aug 2021 19:04:51 -0400 Received: by mail-pj1-f51.google.com with SMTP id t7-20020a17090a5d87b029017807007f23so1411465pji.5 for ; Mon, 09 Aug 2021 16:04: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=wjHPmJeqPk5ydGEPAsbeM+wR0ly8Ex7oFJ5KgXs11aQ=; b=L2T0ShgLnuCCVmV0zEbpGwUlRO20uFnKc9xolPyRHsjVCAELe3fBbnrTdgAj370IaQ xyfExjHJnwtwD5RRw06nM0GdgNORRzO0QkpohYeZp24ly5Ms//OPXio1BaollnQIYktd 2hEbhiGrS+4lof6pg6lKcYhhUW+aY+NM8Q2fj6tnQbLfGG0vEM4zsw5Xn2+GHuzRh0qI bvb+H3BJ//sBVcr2/UyWzKHqGypNnYjMifFO6bi1cgBkusUuoMbVma4e41MOJn/3F5ya zbiDivJgifTvlnkfoyrzDbe/NdSKVFOXhPpIINvuhrwq8yF5lfHIyEQAIbifZ8lIxs0z ek1Q== X-Gm-Message-State: AOAM530BEw5TIuAPWDxGAr8G8X1YAOwLewtYchH5BGu63yPmiedg8tQw 0YDYVhr8sW8e7aNf5ywWSa4= X-Google-Smtp-Source: ABdhPJz/mX/hbrsgcj8T0EGKuA0IddSDQJt51pJEosLgD08VBJtQXaBEa6k5gpCBEO2JLa1OSzk+lA== X-Received: by 2002:a05:6a00:d77:b029:3cb:5f59:e1e7 with SMTP id n55-20020a056a000d77b02903cb5f59e1e7mr8993341pfv.5.1628550269749; Mon, 09 Aug 2021 16:04:29 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.04.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:04:29 -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 v5 17/52] csiostor: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:20 -0700 Message-Id: <20210809230355.8186-18-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() 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..3b2eb6ce1fcf 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(scsi_cmd_to_rq(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); + scsi_cmd_to_rq(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); + scsi_cmd_to_rq(cmnd)->tag); return FAILED; } } From patchwork Mon Aug 9 23:03:21 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: 494156 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 357E7C432BE for ; Mon, 9 Aug 2021 23:04:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0BCB960F38 for ; Mon, 9 Aug 2021 23:04:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236981AbhHIXFB (ORCPT ); Mon, 9 Aug 2021 19:05:01 -0400 Received: from mail-pj1-f49.google.com ([209.85.216.49]:40661 "EHLO mail-pj1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237005AbhHIXEw (ORCPT ); Mon, 9 Aug 2021 19:04:52 -0400 Received: by mail-pj1-f49.google.com with SMTP id t7-20020a17090a5d87b029017807007f23so1411549pji.5 for ; Mon, 09 Aug 2021 16:04:31 -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=Xh8XA54Imxo9ILc5L+S6WvBmWu7PpD2lkFGz180jRy0=; b=qZyIjBUoTyJv6tDWHKAL1kzGJq5pcjnPLyRirlsogLhuHPyyPPSJsuoPK3fLymnjuM /C+GEz7UsRub8KCTJrU/oWquy3mmNNkdozayBjWPRl3PVOkqlIhtgKuj/hVA9ccKKi0y VrkeWlFEsNIVZvChdxdrr4Dk13LsaL46Yl3pXRyN/215W9cz8twXSgy68d3+FWsVNf9n kKAVey24LnWvBd0u5JcS+CaVoshS2WKm2qSyQKxsybGapR/3Z5i9EYoXhTq4JdcgOx6m x7yw76Wkl40hPZ9dzZi2y9K43ALvhxFu3YUMOdronm/BZ/lJVE9FjowsWETXXiD4y52s LfTA== X-Gm-Message-State: AOAM531P434mx3pM6DiRXpcA/Y0pbo5uQG1akQuWokmNlTi5+DukSJcV XZ1TDPu/0VbihdYYbQ258NE= X-Google-Smtp-Source: ABdhPJzpLUrywU8kCqDTsGkDq3bez2wNPxVOiBtZlZSPn2mrTfRUkzoqCv0eFrDPHY8IfFrVrOPv8w== X-Received: by 2002:a05:6a00:16c6:b029:32d:e190:9dd0 with SMTP id l6-20020a056a0016c6b029032de1909dd0mr25699377pfc.70.1628550271242; Mon, 09 Aug 2021 16:04:31 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.04.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:04:30 -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 v5 18/52] cxlflash: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:21 -0700 Message-Id: <20210809230355.8186-19-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() instead. This patch does not change any functionality. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke --- 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..2f1894588e0b 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(scsi_cmd_to_rq(scp)); hwq = blk_mq_unique_tag_to_hwq(tag); break; case HWQ_MODE_CPU: From patchwork Mon Aug 9 23:03: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: 494155 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 DAABDC432BE for ; Mon, 9 Aug 2021 23:04:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B95B960FE3 for ; Mon, 9 Aug 2021 23:04:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236999AbhHIXFE (ORCPT ); Mon, 9 Aug 2021 19:05:04 -0400 Received: from mail-pj1-f52.google.com ([209.85.216.52]:38616 "EHLO mail-pj1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237026AbhHIXE4 (ORCPT ); Mon, 9 Aug 2021 19:04:56 -0400 Received: by mail-pj1-f52.google.com with SMTP id lw7-20020a17090b1807b029017881cc80b7so1426425pjb.3 for ; Mon, 09 Aug 2021 16:04: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=tiqvXqd1pqntIXtxFdPnTU/mxlHzMDJV7Vq8vn+v5fw=; b=HZQb3B3Gwgdkj5lXImiM+BS+w0szzKrsP+D1yfbfwgaHwu5ySKO0i6qK5TbNAUs0Mj iuStux/0FUuIJtDHXEcogmXxIh3gt8pTnvHIz3e+hrdtRckWpXyBXyFAXdcdZQVqKFEV Y5qF3cvtdiTFNSSmsJVCne/FSdpgKEdfJ3lXKTKtkLLpcHy5XG302Cu49Eo6Fs+r8Pax xssUtz1rnce0/0zCWy+cIzVkEnv3YySKehmT1BuUNLR4TZwbYR+p3RDwzKOO1QQZBfXx L+fuHNh/gTExjCpjO1PG/v6GsRmXp1ThKsMZyslssG2qQX3XrT8RTqmc70ljByqwTWZ8 maDA== X-Gm-Message-State: AOAM533RJiDmweAkqq2xy+TyPMMysJ+XF6exSNOIkCitYKGyJW+WaSl7 3ZMHD3sTxWaJRvn4/PrD+wQ= X-Google-Smtp-Source: ABdhPJx4nr+ykBq3gEqdvxlBE7Ax9p8XQmuHNUjiY39mWQMQsGXXLF8dkDhGNZAwm0Ql+g2ntmukDA== X-Received: by 2002:a17:90a:6684:: with SMTP id m4mr1518496pjj.127.1628550275567; Mon, 09 Aug 2021 16:04:35 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.04.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:04:35 -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 v5 21/52] hisi_sas: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:24 -0700 Message-Id: <20210809230355.8186-22-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() instead. This patch does not change any functionality. Acked-by: John Garry Signed-off-by: Bart Van Assche --- 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 3a903e8e0384..9515c45affa5 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 scsi_cmd_to_rq(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(scsi_cmd_to_rq(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 a4885d03afe2..3ab669dc806f 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(scsi_cmd_to_rq(scsi_cmnd)); switch (prot_op) { case SCSI_PROT_READ_INSERT: From patchwork Mon Aug 9 23:03: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: 494154 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 E49EDC4338F for ; Mon, 9 Aug 2021 23:04:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CAB1D60F38 for ; Mon, 9 Aug 2021 23:04:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236248AbhHIXFG (ORCPT ); Mon, 9 Aug 2021 19:05:06 -0400 Received: from mail-pj1-f44.google.com ([209.85.216.44]:35338 "EHLO mail-pj1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236275AbhHIXE7 (ORCPT ); Mon, 9 Aug 2021 19:04:59 -0400 Received: by mail-pj1-f44.google.com with SMTP id s22-20020a17090a1c16b0290177caeba067so1520194pjs.0 for ; Mon, 09 Aug 2021 16:04: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=i2V8/BN2iPNBw51OsSyudNN7wtqGW0C1CVr1gqNgEZw=; b=irFtQH5g+iYR2p1xp0U4lc95IIsgOdIqOvXSQfxvnCEn3e94x6KFVF49yqG6b8LGoX hkP1pzYLxlQuyH9hP4f9ZhmKlGrGWCljaFNT98nEmACnJO/hB2AmU2eSWjT4wuAYRx5R kwKuYUPHCBuZ6xHlE8OqgADuFbv5MTIrRttYpsq4F99x3sflt57lbnKc7RFWErPK+tQB x3DZzrJFlo6KuG47r8ng7q40zMUS4gStPfZfpmUxldNaePJsnVuZwAu7IIhoVxxx/lHz WDR66iaXc7Jo05cBSUGAJwQdgDBFqTG2wNysLwqkTuE00fQgY9vA4OHYJAsTSIvXyOSU JGSQ== X-Gm-Message-State: AOAM530LP0uNWWhu2zDsrYN8boLm8QXh5af81GYt+bBmu7xHRHZrZIqt lKaKnMBzAg4HptuoP6+JmgQ= X-Google-Smtp-Source: ABdhPJw/5lKfgmdJ33khV+KDx0kWUOk1DhJG1uVWSb3mkfnJhTONp/KgwMbnbQi5pgdIv9vtjGgVKQ== X-Received: by 2002:a63:2541:: with SMTP id l62mr889844pgl.183.1628550278462; Mon, 09 Aug 2021 16:04:38 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.04.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:04:37 -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 v5 23/52] ibmvfc: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:26 -0700 Message-Id: <20210809230355.8186-24-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() 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 bee1bec49c09..c372bbc5e218 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -1911,7 +1911,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(scsi_cmd_to_rq(cmnd)); u16 hwq = blk_mq_unique_tag_to_hwq(tag_and_hwq); u16 scsi_channel; int rc; From patchwork Mon Aug 9 23:03: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: 494153 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 E6A12C4320A for ; Mon, 9 Aug 2021 23:04:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CBE6A60F38 for ; Mon, 9 Aug 2021 23:04:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237016AbhHIXFI (ORCPT ); Mon, 9 Aug 2021 19:05:08 -0400 Received: from mail-pl1-f175.google.com ([209.85.214.175]:45987 "EHLO mail-pl1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235051AbhHIXFC (ORCPT ); Mon, 9 Aug 2021 19:05:02 -0400 Received: by mail-pl1-f175.google.com with SMTP id d17so18326197plr.12 for ; Mon, 09 Aug 2021 16:04: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=KAGONwU2Ix3aXwytjxc1FfNzoxkRboKLNCgioIOWq0o=; b=pY8b/PWnTtQY88Gv5fVWtl0YcuTvyH7jZV7m1/XGQFSv2+dUjCg7sDiHwWDbbk0HxH IIcSRN6E3ztFXYR/6U7eXqoGzmJEwSiSKVseoCbXozDloMvB0nrik/YosQ3ANBM/GIzr 2jZArdVsYgQqd3gwg0mSNabrEfOGqaX2+VX+w0O5EZb7H8GzFqEQc7GwCp6jLYsd3DT1 O7P9Nh1hD+wttneIZxxPTJJ/SmmK6a6sy6kMWPHjmGJRaxpCgCwnMZuaAiFaq6k9AJlo /XM7Cj24w6Ad7OrEPFEfe11S6+u6a0jr57gb3YCQXpK6HbJUETL21wTOV/bQ+c4uhGdI TfCg== X-Gm-Message-State: AOAM533MS+4HxxX3CNC0WfTG/wfPUK6vWcOapDGUI+UlmdS11zEDwP/4 3xF3yJux5g4P8/vvD1BeMeY= X-Google-Smtp-Source: ABdhPJzhtlRJYvhv6Dqppbl6j34WJBqdHmD3pDK+U3S7+/wRlhpANCIsO1tJaNycmkwIPJwYMgZrjg== X-Received: by 2002:a62:1982:0:b029:356:3484:b7ec with SMTP id 124-20020a6219820000b02903563484b7ecmr26349992pfz.48.1628550281268; Mon, 09 Aug 2021 16:04:41 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.04.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:04:40 -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 v5 25/52] ips: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:28 -0700 Message-Id: <20210809230355.8186-26-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() 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 8b33c9871484..cdd94fb2aab7 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c @@ -3735,7 +3735,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 = scsi_cmd_to_rq(scb->scsi_cmd)->timeout; if (ha->subsys->param[4] & 0x00100000) { /* If NEW Tape DCDB is Supported */ if (!scb->sg_len) { From patchwork Mon Aug 9 23:03: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: 494152 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 46849C4338F for ; Mon, 9 Aug 2021 23:04:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2A1CE61002 for ; Mon, 9 Aug 2021 23:04:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237008AbhHIXFN (ORCPT ); Mon, 9 Aug 2021 19:05:13 -0400 Received: from mail-pj1-f44.google.com ([209.85.216.44]:44545 "EHLO mail-pj1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237015AbhHIXFH (ORCPT ); Mon, 9 Aug 2021 19:05:07 -0400 Received: by mail-pj1-f44.google.com with SMTP id hv22-20020a17090ae416b0290178c579e424so2395256pjb.3 for ; Mon, 09 Aug 2021 16:04: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=tA3LmES8v6WLt2B62YZmGK6WdK6cIyjSz0t5AEaW98I=; b=d0yePkpo+BQKMRhohKA/x+3rWq3gp89ijoROZzpvhBg4ZayONoTwDf0E77i46pkH5T vTS35+tedsQCc3zLyZGO9iL+61tMlDSVYeUXP8xoTILgiUIQAC06LRNbEdBV1TJjNCSC l29aeSHkfD3MM+/SgJfd/4Nh3TwIpAaBksxt3mTVBapxebgQvP/FyjtMl7l5o1VvL4gS WNswmkMQ68abYpwPW1mTqEK9YN43FTi4c+HkkyrzMPMK8WcDzxdpYGYnN2zDwFWJUSWp w5qgnjPgoepCkdYNttUuhOnzEv11+CYzsBY37peG9epaTWe5+DuOhCZLmGjZsiqY2kJG MzbQ== X-Gm-Message-State: AOAM531++h6D5RdaF7CPMmJluUV3qs3E5PKYCeLj4EbFjbcYPRY5tIZp BE6d5+mtc6EBxU7fQDQ4gRo= X-Google-Smtp-Source: ABdhPJxa0OBJsPgthPKql2uCRAjRQpnMqtAigc2o/5wmI28pKBxVMA9iOvz3qS9oFryoFZl3eYoZwA== X-Received: by 2002:a17:903:32d1:b029:12c:d4c6:6d2c with SMTP id i17-20020a17090332d1b029012cd4c66d2cmr8315405plr.28.1628550286440; Mon, 09 Aug 2021 16:04:46 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.04.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:04:45 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , James Smart , Dick Kennedy , "James E.J. Bottomley" Subject: [PATCH v5 27/52] lpfc: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:30 -0700 Message-Id: <20210809230355.8186-28-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() instead. This patch does not change any functionality. Signed-off-by: Bart Van Assche --- drivers/scsi/lpfc/lpfc_scsi.c | 71 ++++++++++++++++------------------- 1 file changed, 33 insertions(+), 38 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index ee4ff4855866..f905a53d050f 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -683,7 +683,7 @@ lpfc_get_scsi_buf_s4(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp, cpu = raw_smp_processor_id(); if (cmnd && phba->cfg_fcp_io_sched == LPFC_FCP_SCHED_BY_HDWQ) { - tag = blk_mq_unique_tag(cmnd->request); + tag = blk_mq_unique_tag(scsi_cmd_to_rq(cmnd)); idx = blk_mq_unique_tag_to_hwq(tag); } else { idx = phba->sli4_hba.cpu_map[cpu].hdwq; @@ -1046,7 +1046,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc, return 0; sgpe = scsi_prot_sglist(sc); - lba = t10_pi_ref_tag(sc->request); + lba = t10_pi_ref_tag(scsi_cmd_to_rq(sc)); if (lba == LPFC_INVALID_REFTAG) return 0; @@ -1629,7 +1629,7 @@ lpfc_bg_setup_bpl(struct lpfc_hba *phba, struct scsi_cmnd *sc, goto out; /* extract some info from the scsi command for pde*/ - reftag = t10_pi_ref_tag(sc->request); + reftag = t10_pi_ref_tag(scsi_cmd_to_rq(sc)); if (reftag == LPFC_INVALID_REFTAG) goto out; @@ -1792,7 +1792,7 @@ lpfc_bg_setup_bpl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc, /* extract some info from the scsi command */ blksize = lpfc_cmd_blksize(sc); - reftag = t10_pi_ref_tag(sc->request); + reftag = t10_pi_ref_tag(scsi_cmd_to_rq(sc)); if (reftag == LPFC_INVALID_REFTAG) goto out; @@ -2023,7 +2023,7 @@ lpfc_bg_setup_sgl(struct lpfc_hba *phba, struct scsi_cmnd *sc, goto out; /* extract some info from the scsi command for pde*/ - reftag = t10_pi_ref_tag(sc->request); + reftag = t10_pi_ref_tag(scsi_cmd_to_rq(sc)); if (reftag == LPFC_INVALID_REFTAG) goto out; @@ -2224,7 +2224,7 @@ lpfc_bg_setup_sgl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc, /* extract some info from the scsi command */ blksize = lpfc_cmd_blksize(sc); - reftag = t10_pi_ref_tag(sc->request); + reftag = t10_pi_ref_tag(scsi_cmd_to_rq(sc)); if (reftag == LPFC_INVALID_REFTAG) goto out; @@ -2818,7 +2818,7 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) chk_guard = 1; src = (struct scsi_dif_tuple *)sg_virt(sgpe); - start_ref_tag = t10_pi_ref_tag(cmd->request); + start_ref_tag = t10_pi_ref_tag(scsi_cmd_to_rq(cmd)); if (start_ref_tag == LPFC_INVALID_REFTAG) goto out; start_app_tag = src->app_tag; @@ -2910,7 +2910,7 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) phba->bg_guard_err_cnt++; lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG, "9069 BLKGRD: reftag %x grd_tag err %x != %x\n", - t10_pi_ref_tag(cmd->request), + t10_pi_ref_tag(scsi_cmd_to_rq(cmd)), sum, guard_tag); } else if (err_type == BGS_REFTAG_ERR_MASK) { @@ -2920,7 +2920,7 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) phba->bg_reftag_err_cnt++; lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG, "9066 BLKGRD: reftag %x ref_tag err %x != %x\n", - t10_pi_ref_tag(cmd->request), + t10_pi_ref_tag(scsi_cmd_to_rq(cmd)), ref_tag, start_ref_tag); } else if (err_type == BGS_APPTAG_ERR_MASK) { @@ -2930,7 +2930,7 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) phba->bg_apptag_err_cnt++; lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_BG, "9041 BLKGRD: reftag %x app_tag err %x != %x\n", - t10_pi_ref_tag(cmd->request), + t10_pi_ref_tag(scsi_cmd_to_rq(cmd)), app_tag, start_app_tag); } } @@ -2992,7 +2992,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, " 0x%x lba 0x%llx blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], (unsigned long long)scsi_get_lba(cmd), - blk_rq_sectors(cmd->request), bgstat, bghm); + blk_rq_sectors(scsi_cmd_to_rq(cmd)), bgstat, bghm); } if (lpfc_bgs_get_reftag_err(bgstat)) { @@ -3007,7 +3007,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, " 0x%x lba 0x%llx blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], (unsigned long long)scsi_get_lba(cmd), - blk_rq_sectors(cmd->request), bgstat, bghm); + blk_rq_sectors(scsi_cmd_to_rq(cmd)), bgstat, bghm); } if (lpfc_bgs_get_apptag_err(bgstat)) { @@ -3022,7 +3022,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, " 0x%x lba 0x%llx blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], (unsigned long long)scsi_get_lba(cmd), - blk_rq_sectors(cmd->request), bgstat, bghm); + blk_rq_sectors(scsi_cmd_to_rq(cmd)), bgstat, bghm); } if (lpfc_bgs_get_hi_water_mark_present(bgstat)) { @@ -3066,7 +3066,7 @@ lpfc_sli4_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, " 0x%x lba 0x%llx blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], (unsigned long long)scsi_get_lba(cmd), - blk_rq_sectors(cmd->request), bgstat, bghm); + blk_rq_sectors(scsi_cmd_to_rq(cmd)), bgstat, bghm); /* Calcuate what type of error it was */ lpfc_calc_bg_err(phba, lpfc_cmd); @@ -3103,8 +3103,8 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, "9072 BLKGRD: Invalid BG Profile in cmd " "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], - t10_pi_ref_tag(cmd->request), - blk_rq_sectors(cmd->request), bgstat, bghm); + t10_pi_ref_tag(scsi_cmd_to_rq(cmd)), + blk_rq_sectors(scsi_cmd_to_rq(cmd)), bgstat, bghm); ret = (-1); goto out; } @@ -3115,8 +3115,8 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, "9073 BLKGRD: Invalid BG PDIF Block in cmd " "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], - t10_pi_ref_tag(cmd->request), - blk_rq_sectors(cmd->request), bgstat, bghm); + t10_pi_ref_tag(scsi_cmd_to_rq(cmd)), + blk_rq_sectors(scsi_cmd_to_rq(cmd)), bgstat, bghm); ret = (-1); goto out; } @@ -3131,8 +3131,8 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, "9055 BLKGRD: Guard Tag error in cmd " "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], - t10_pi_ref_tag(cmd->request), - blk_rq_sectors(cmd->request), bgstat, bghm); + t10_pi_ref_tag(scsi_cmd_to_rq(cmd)), + blk_rq_sectors(scsi_cmd_to_rq(cmd)), bgstat, bghm); } if (lpfc_bgs_get_reftag_err(bgstat)) { @@ -3146,8 +3146,8 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, "9056 BLKGRD: Ref Tag error in cmd " "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], - t10_pi_ref_tag(cmd->request), - blk_rq_sectors(cmd->request), bgstat, bghm); + t10_pi_ref_tag(scsi_cmd_to_rq(cmd)), + blk_rq_sectors(scsi_cmd_to_rq(cmd)), bgstat, bghm); } if (lpfc_bgs_get_apptag_err(bgstat)) { @@ -3161,8 +3161,8 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, "9061 BLKGRD: App Tag error in cmd " "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], - t10_pi_ref_tag(cmd->request), - blk_rq_sectors(cmd->request), bgstat, bghm); + t10_pi_ref_tag(scsi_cmd_to_rq(cmd)), + blk_rq_sectors(scsi_cmd_to_rq(cmd)), bgstat, bghm); } if (lpfc_bgs_get_hi_water_mark_present(bgstat)) { @@ -3205,8 +3205,8 @@ lpfc_parse_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd, "9057 BLKGRD: Unknown error in cmd " "0x%x reftag 0x%x blk cnt 0x%x " "bgstat=x%x bghm=x%x\n", cmd->cmnd[0], - t10_pi_ref_tag(cmd->request), - blk_rq_sectors(cmd->request), bgstat, bghm); + t10_pi_ref_tag(scsi_cmd_to_rq(cmd)), + blk_rq_sectors(scsi_cmd_to_rq(cmd)), bgstat, bghm); /* Calcuate what type of error it was */ lpfc_calc_bg_err(phba, lpfc_cmd); @@ -5419,13 +5419,9 @@ static int lpfc_vmid_get_appid(struct lpfc_vport *vport, char *uuid, struct */ static char *lpfc_is_command_vm_io(struct scsi_cmnd *cmd) { - char *uuid = NULL; + struct bio *bio = scsi_cmd_to_rq(cmd)->bio; - if (cmd->request) { - if (cmd->request->bio) - uuid = blkcg_get_fc_appid(cmd->request->bio); - } - return uuid; + return bio ? blkcg_get_fc_appid(bio) : NULL; } /** @@ -5553,8 +5549,8 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd) "reftag x%x cnt %u pt %x\n", dif_op_str[scsi_get_prot_op(cmnd)], cmnd->cmnd[0], - t10_pi_ref_tag(cmnd->request), - blk_rq_sectors(cmnd->request), + t10_pi_ref_tag(scsi_cmd_to_rq(cmnd)), + blk_rq_sectors(scsi_cmd_to_rq(cmnd)), (cmnd->cmnd[1]>>5)); } err = lpfc_bg_scsi_prep_dma_buf(phba, lpfc_cmd); @@ -5565,8 +5561,8 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd) "9038 BLKGRD: rcvd PROT_NORMAL cmd: " "x%x reftag x%x cnt %u pt %x\n", cmnd->cmnd[0], - t10_pi_ref_tag(cmnd->request), - blk_rq_sectors(cmnd->request), + t10_pi_ref_tag(scsi_cmd_to_rq(cmnd)), + blk_rq_sectors(scsi_cmd_to_rq(cmnd)), (cmnd->cmnd[1]>>5)); } err = lpfc_scsi_prep_dma_buf(phba, lpfc_cmd); @@ -5637,8 +5633,7 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd) bf_get(wqe_tmo, &lpfc_cmd->cur_iocbq.wqe.generic.wqe_com) : lpfc_cmd->cur_iocbq.iocb.ulpTimeout, - (uint32_t) - (cmnd->request->timeout / 1000)); + (uint32_t)(scsi_cmd_to_rq(cmnd)->timeout / 1000)); goto out_host_busy_free_buf; } From patchwork Mon Aug 9 23:03: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: 494151 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 4A973C4320A for ; Mon, 9 Aug 2021 23:04:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2CD7E61002 for ; Mon, 9 Aug 2021 23:04:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236930AbhHIXFO (ORCPT ); Mon, 9 Aug 2021 19:05:14 -0400 Received: from mail-pl1-f182.google.com ([209.85.214.182]:36392 "EHLO mail-pl1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237024AbhHIXFK (ORCPT ); Mon, 9 Aug 2021 19:05:10 -0400 Received: by mail-pl1-f182.google.com with SMTP id f3so7720576plg.3 for ; Mon, 09 Aug 2021 16:04:49 -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=l8ekO4G1BiWlUQSo2Reg6lj4O73UX5iGXlyNzLMWfic=; b=OhTOvfehx3SfYnMZCQC260xzlUMdOuhZOkvsqZzKKBoHnmLDZ2bKmz5NXJqXNsObdV 1xSECpjhWrscVqEXItmZbGERqzBUgWV6Fi87m2gYyqscdRsmrqFlQLlfRFtN4ZaRATtp Egj8iIdlfiFcs+3zF5w98MMy/+peZOCapOoxW47VjT2XC+bxNQwlx6MMnHETFydFVHcN ZOiGg8iNtl7EDeux3yOrILujXjkG0ZY5xgr7T7JRtjjzPuJwpoNvZg0yoGiBFrwNWfEr bUziLbJ0v+cExt2hgxVq2nDzku7Q+nnvJIW7/oSDFUCFC190WYHiAYoOndKA0UQB6QV9 RgRQ== X-Gm-Message-State: AOAM533IszgWSb6w7iHxXAwOt6sztnKaTdbIr5p8jinTMrS9RQWWWJB5 TfqIBbQADw69ziHljsxxrNYXbCYMSxDICQ== X-Google-Smtp-Source: ABdhPJzGMqupFbRP8AoOlZUdSCuUKrtLijwH6wWdGWjP5YA5u7nSCJynatgh3myX3zqlOUggxADK4Q== X-Received: by 2002:a17:90b:3014:: with SMTP id hg20mr16494564pjb.140.1628550289543; Mon, 09 Aug 2021 16:04:49 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.04.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:04:49 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Sathya Prakash Veerichetty , Kashyap Desai , Sumit Saxena , Sreekanth Reddy , "James E.J. Bottomley" Subject: [PATCH v5 29/52] mpi3mr: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:32 -0700 Message-Id: <20210809230355.8186-30-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() instead. This patch does not change any functionality. Signed-off-by: Bart Van Assche --- drivers/scsi/mpi3mr/mpi3mr_os.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c index 24ac7ddec749..bc1c32f599de 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_os.c +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c @@ -50,7 +50,7 @@ static u16 mpi3mr_host_tag_for_scmd(struct mpi3mr_ioc *mrioc, u32 unique_tag; u16 host_tag, hw_queue; - unique_tag = blk_mq_unique_tag(scmd->request); + unique_tag = blk_mq_unique_tag(scsi_cmd_to_rq(scmd)); hw_queue = blk_mq_unique_tag_to_hwq(unique_tag); if (hw_queue >= mrioc->num_op_reply_q) @@ -2016,7 +2016,7 @@ static void mpi3mr_setup_eedp(struct mpi3mr_ioc *mrioc, case SCSI_PROT_DIF_TYPE0: eedp_flags |= MPI3_EEDPFLAGS_INCR_PRI_REF_TAG; scsiio_req->cdb.eedp32.primary_reference_tag = - cpu_to_be32(t10_pi_ref_tag(scmd->request)); + cpu_to_be32(t10_pi_ref_tag(scsi_cmd_to_rq(scmd))); break; case SCSI_PROT_DIF_TYPE1: case SCSI_PROT_DIF_TYPE2: @@ -2024,7 +2024,7 @@ static void mpi3mr_setup_eedp(struct mpi3mr_ioc *mrioc, MPI3_EEDPFLAGS_ESC_MODE_APPTAG_DISABLE | MPI3_EEDPFLAGS_CHK_GUARD; scsiio_req->cdb.eedp32.primary_reference_tag = - cpu_to_be32(t10_pi_ref_tag(scmd->request)); + cpu_to_be32(t10_pi_ref_tag(scsi_cmd_to_rq(scmd))); break; case SCSI_PROT_DIF_TYPE3: eedp_flags |= MPI3_EEDPFLAGS_CHK_GUARD | @@ -3451,7 +3451,7 @@ static int mpi3mr_qcmd(struct Scsi_Host *shost, u16 dev_handle; u16 host_tag; u32 scsiio_flags = 0; - struct request *rq = scmd->request; + struct request *rq = scsi_cmd_to_rq(scmd); int iprio_class; sdev_priv_data = scmd->device->hostdata; From patchwork Mon Aug 9 23:03: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: 494150 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 BD1F3C4338F for ; Mon, 9 Aug 2021 23:04:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A425461019 for ; Mon, 9 Aug 2021 23:04:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236947AbhHIXFQ (ORCPT ); Mon, 9 Aug 2021 19:05:16 -0400 Received: from mail-pl1-f170.google.com ([209.85.214.170]:39697 "EHLO mail-pl1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237012AbhHIXFN (ORCPT ); Mon, 9 Aug 2021 19:05:13 -0400 Received: by mail-pl1-f170.google.com with SMTP id l11so6719285plk.6 for ; Mon, 09 Aug 2021 16:04:52 -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=PBomNPnl7STZls/aW5wCX5ThJyBjrSASUkls2nsP9Q0=; b=V+Glmfp4Trt7+n8ee/5bQqquGTh3XI6oPgMgo5LUzrww8LZCVaRo4Y0BC1nRJE/KPL OYQ6NShY37xw5+1azusayu8HlETtiTIbvJMMsVlkIbWZw+hqGf6iOW2tJUOY4dc3NBJS sswGths9EDLSyiuJN43+sl0C3o8R4YFIsKDmbyspciquAg8D8lU3rkeyDtZWKPWJAb2Q yOo2MtW+8+M8ThY4yQHZVz9kRo+1ryInpiZ4lLaqwQrjh7lKnlWe8q4qOZUrXmHiSVH0 CnVE+rTgVAJ1OUX4jKWLAU67BMScXNmt72oi706yjpcIVL+6+78lFGmmOqeTXNUJTPFw mKUg== X-Gm-Message-State: AOAM533VFEH9DWS7L4V54VY4i3iqN8/FKZaIAASSgc2RnvwmE/TULlea J5phLG2un4/d4H5ticOJYlg= X-Google-Smtp-Source: ABdhPJxXYOU8rFjhkGWgwnXpxj2jVWhmCam2wFWEW/kTVcUz6mWJWay8Z1te5hHCPe6CEIUkjGEJ3g== X-Received: by 2002:aa7:8d54:0:b029:3cd:6ce7:bec6 with SMTP id s20-20020aa78d540000b02903cd6ce7bec6mr3849362pfe.69.1628550292341; Mon, 09 Aug 2021 16:04:52 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.04.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:04:51 -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 v5 31/52] mvumi: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:34 -0700 Message-Id: <20210809230355.8186-32-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() 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 6bb03d7a254d..4d251bf630a3 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); + scsi_cmd_to_rq(scmd)->tag, scmd->cmnd[0], scmd->retries); return mhba->instancet->reset_host(mhba); } From patchwork Mon Aug 9 23:03: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: 494149 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 E064DC4338F for ; Mon, 9 Aug 2021 23:04:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C092760F38 for ; Mon, 9 Aug 2021 23:04:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237033AbhHIXFS (ORCPT ); Mon, 9 Aug 2021 19:05:18 -0400 Received: from mail-pl1-f176.google.com ([209.85.214.176]:39707 "EHLO mail-pl1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236937AbhHIXFQ (ORCPT ); Mon, 9 Aug 2021 19:05:16 -0400 Received: by mail-pl1-f176.google.com with SMTP id l11so6719397plk.6 for ; Mon, 09 Aug 2021 16:04:55 -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=Z5frQuBfvw3TO6BJtxyQj/5vO0rFo/9Rm653FDty9kM=; b=o+N7thpo9nYFh/zJCbXeHVvhvlVqK75UEqUx9E6C40e7lnrgvcoJmzEnVwtWXL8kpY tf1v1iiL+tERNmhWiiVjvUSmIU5cgoVCowPuQi8yurJlHAtXB/NTAuEl/zGafp4LRtja uqW8FIMFnB+5SIbpDKnu2IxYP1eb4ABkJcNfk3k4Cy0fSpzvWuEFtra9lVpmIVxikJIm 43/NahgT7xU/MW/8g35l3cggGCyZJ99rS1wjwpNmPJSQsdGzY3bi4ucakfJP/oB6XJpm PBvoJEgJWw4MoN2f7sYR+htVa0KmEfshwin3s63cLWy9ibD7TxNdjks0DlMWkXqtT/4I jpeA== X-Gm-Message-State: AOAM532igPx3cHMl+YVPSaF+NclFLEeA6APqkoPTeJAiUf2foAax4e9z W/DiHt7PSluqtgJGM89VTIk= X-Google-Smtp-Source: ABdhPJzG3yEiEYOpiGs/59ts5xJQa2SUmkr8DQDlBqsKXCmBuibCUDcJGserdcnJ/+f9hg+BmpqfjQ== X-Received: by 2002:aa7:9af7:0:b029:3be:afdf:e75c with SMTP id y23-20020aa79af70000b02903beafdfe75cmr19928894pfp.77.1628550295096; Mon, 09 Aug 2021 16:04:55 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.04.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:04:54 -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 v5 33/52] myrs: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:36 -0700 Message-Id: <20210809230355.8186-34-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() instead. This patch does not change any functionality. Signed-off-by: Bart Van Assche --- drivers/scsi/myrs.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/myrs.c b/drivers/scsi/myrs.c index 26326af23dbc..07f274afd7e5 100644 --- a/drivers/scsi/myrs.c +++ b/drivers/scsi/myrs.c @@ -1582,6 +1582,7 @@ static void myrs_mode_sense(struct myrs_hba *cs, struct scsi_cmnd *scmd, static int myrs_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmd) { + struct request *rq = scsi_cmd_to_rq(scmd); struct myrs_hba *cs = shost_priv(shost); struct myrs_cmdblk *cmd_blk = scsi_cmd_priv(scmd); union myrs_cmd_mbox *mbox = &cmd_blk->mbox; @@ -1628,7 +1629,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 = rq->timeout; if (scmd->cmd_len <= 10) { if (scmd->device->channel >= cs->ctlr_info->physchan_present) { struct myrs_ldev_info *ldev_info = sdev->hostdata; @@ -1644,10 +1645,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 = rq->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 (rq->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; @@ -1690,10 +1691,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 = rq->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 (rq->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 Mon Aug 9 23:03:38 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: 494148 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 0CA14C4320A for ; Mon, 9 Aug 2021 23:05:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E5FD560FE3 for ; Mon, 9 Aug 2021 23:05:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237002AbhHIXFY (ORCPT ); Mon, 9 Aug 2021 19:05:24 -0400 Received: from mail-pj1-f50.google.com ([209.85.216.50]:53902 "EHLO mail-pj1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236937AbhHIXFT (ORCPT ); Mon, 9 Aug 2021 19:05:19 -0400 Received: by mail-pj1-f50.google.com with SMTP id j1so30351048pjv.3 for ; Mon, 09 Aug 2021 16:04:58 -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=6RFPIMyLjhMpfnOIb75hPSlP1Uw3EoOUZEQ1HTdVJZU=; b=EV8JCMw6zLwDp/BJxXt/lG8YfAJkUsMZGtBPut2NsGSSipiIYHo7qZqtiZfbcuXfIH KgrFkoRc261vsqiQyLBGf7+Oxlo5LHvoCPghgrcEaBxV2Eqn5qmmSubhmHqWTBn4f5V2 g544vfatP1vaay/8W7ps3y/9EB04ZL1rlxJdHZr+ISpIW8fwHfUpCD6jEMVrS1SLmlZR pr6aMm+gcFHF7qBNot1EMktdVu+i5qqlR1AQTZWdmf0u2x+ThyOiLCKF8P5QE26dTc/W Vo/qzcO8JQIpGYZ7EVSmWxOGjli0xfalL16+HrBGrbvEKW89l+gKvCL863ooFmz44SQm SV4g== X-Gm-Message-State: AOAM531zqhdHygiksBB12Dwi6SJns9GnWGOT+8PV8nwQW3l7ykGpvTgA aUUXnCxhiU0UTvzECowYdKQ= X-Google-Smtp-Source: ABdhPJyIRy9PJiAqfvCNY+6WrpjLvu3aae88ickeamVbNfRsEPQFai7D3grT8aw8h8lcDfTe6j37iw== X-Received: by 2002:a17:90a:6782:: with SMTP id o2mr1467632pjj.165.1628550297977; Mon, 09 Aug 2021 16:04:57 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:04:57 -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 v5 35/52] qedf: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:38 -0700 Message-Id: <20210809230355.8186-36-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() 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 6b5b6a75ac88..3404782988d5 100644 --- a/drivers/scsi/qedf/qedf_io.c +++ b/drivers/scsi/qedf/qedf_io.c @@ -1162,13 +1162,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 (!scsi_cmd_to_rq(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 Mon Aug 9 23:03:41 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: 494147 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 89CA7C43214 for ; Mon, 9 Aug 2021 23:05:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6D5BF60F38 for ; Mon, 9 Aug 2021 23:05:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237026AbhHIXFZ (ORCPT ); Mon, 9 Aug 2021 19:05:25 -0400 Received: from mail-pl1-f174.google.com ([209.85.214.174]:38910 "EHLO mail-pl1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236943AbhHIXFX (ORCPT ); Mon, 9 Aug 2021 19:05:23 -0400 Received: by mail-pl1-f174.google.com with SMTP id a5so2658420plh.5 for ; Mon, 09 Aug 2021 16:05: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=tPKq1F1MPTyTLjK6rpWD5zr2FjUTqF7F8c4lG2mKQnc=; b=nIbQNj6E/NsBtTDuluDXYOFgIIHi+dt63HS14NwDMYKwpZzF3q2ymhadM1rMCb5/cE l3B6m6J2C+DJOhnY9tfdOVa5LX1htrx2z+qILOvBznvFfWNzJi4fczHDbH7JtlKiV8LL 0BtrfYNVXEBR3DB1e+ZR/+WrZJ9SLEZ8Whlo8VR55MtvPmJWeKEZRC0V+3T6dBtF98FG tx7l9WOSPWgg5a8f6XHO/A9vM7ekSaEmnZZniemhGYFoIuQqX5rqeSzHNi5rGZm4VPR9 +1RRIC0dtd2KTBmOe2O+Z50uiFMi278FJxdtJRFPYg7Jw5USF6lmPajc+v6h9J6KIATd KUAw== X-Gm-Message-State: AOAM533dKANasWJw9xc0RUfLr3PqKgvoHPogOPg4lhLcFTXelLveiBqo SkNHCxwNVjBGhZU1iPywxE0= X-Google-Smtp-Source: ABdhPJwVXa2qm97y5YSjyAwsQYRLMUbceWFScaroQ8/ONTHz7GrsYgIbSsBIKEumE2MGSVvEKgurLw== X-Received: by 2002:a17:902:e549:b029:12c:bf10:36c9 with SMTP id n9-20020a170902e549b029012cbf1036c9mr22027345plf.66.1628550302195; Mon, 09 Aug 2021 16:05:02 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.05.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:05:01 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Nilesh Javali , GR-QLogic-Storage-Upstream@marvell.com, "James E.J. Bottomley" Subject: [PATCH v5 38/52] qla2xxx: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:41 -0700 Message-Id: <20210809230355.8186-39-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() instead. This patch does not change any functionality. Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_os.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 868037c7d608..126ac7e24ea9 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -854,7 +854,7 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) uint16_t hwq; struct qla_qpair *qpair = NULL; - tag = blk_mq_unique_tag(cmd->request); + tag = blk_mq_unique_tag(scsi_cmd_to_rq(cmd)); hwq = blk_mq_unique_tag_to_hwq(tag); qpair = ha->queue_pair_map[hwq]; @@ -1763,7 +1763,7 @@ static void qla2x00_abort_srb(struct qla_qpair *qp, srb_t *sp, const int res, } spin_lock_irqsave(qp->qp_lock_ptr, *flags); - if (ret_cmd && blk_mq_request_started(cmd->request)) + if (ret_cmd && blk_mq_request_started(scsi_cmd_to_rq(cmd))) sp->done(sp, res); } else { sp->done(sp, res); From patchwork Mon Aug 9 23:03: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: 494146 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 0F5F8C4320A for ; Mon, 9 Aug 2021 23:05:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E180E60F38 for ; Mon, 9 Aug 2021 23:05:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237034AbhHIXF0 (ORCPT ); Mon, 9 Aug 2021 19:05:26 -0400 Received: from mail-pj1-f48.google.com ([209.85.216.48]:44579 "EHLO mail-pj1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237011AbhHIXFZ (ORCPT ); Mon, 9 Aug 2021 19:05:25 -0400 Received: by mail-pj1-f48.google.com with SMTP id hv22-20020a17090ae416b0290178c579e424so2396032pjb.3 for ; Mon, 09 Aug 2021 16:05:04 -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=8THQL4IBWnjCFG34wAR/rrdTZqIKDZOaWTk3GhOvU/Y=; b=du1bH7oY+RIClm8Ll+MxVimjoHv4bVFH1rkSduXbVBbY5GeuCZCVMGp8W63KWN7rkR wy9bFeCzS4gfp2yopfzDYQm329fuaXQ/aa9mVp8pc1ah8RgjSXjSn2fWBHSfIMgzez0I fYLMs2aFx34ySupL/L2pvvPlMT/ZZMJqHK7BKuu7xW2QyR2YpdsoqhmMtgoRNGYkZpR6 JHbIxmgpYskFnvLDk+tvSIafZtU1mWbzrhTPaHSW6WZ3VR2APpDxcvtf4YWT+Xv4Ra+K 6OOFEiTjtk50bA16Rh54+rtRheeQCcs9oVMepg5A7fKu7cMKvvVVJKtz0lKToDEbnSOK 8cQg== X-Gm-Message-State: AOAM533ku8tRJMWQr/RgtHTr0tHUSen6afm9ygfXLGMMWrKThQ09LbUq qIxXgy/TRe75qfcNkytzpNBf4Wy1CHlu4Q== X-Google-Smtp-Source: ABdhPJwZKch0pjIwxyDxyEv2DOXzUoA1R1nhUuWMsdcSiepJjB9G+JJdrwkUJOlNTsDfjN/r8uE3gA== X-Received: by 2002:a17:90a:514f:: with SMTP id k15mr14453983pjm.95.1628550303775; Mon, 09 Aug 2021 16:05:03 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.05.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:05:03 -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 v5 39/52] qla4xxx: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:42 -0700 Message-Id: <20210809230355.8186-40-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() 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 c57cec6fff6d..28eab07935ba 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 = scsi_cmd_to_rq(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 3f7737386193..f1ea65c6e5f5 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, scsi_cmd_to_rq(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, scsi_cmd_to_rq(cmd)->timeout / HZ, ha->dpc_flags, cmd->result, cmd->allowed)); rval = qla4xxx_isp_check_reg(ha); From patchwork Mon Aug 9 23:03: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: 494145 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 A0F10C432BE for ; Mon, 9 Aug 2021 23:05:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 89A3B60F38 for ; Mon, 9 Aug 2021 23:05:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237035AbhHIXFc (ORCPT ); Mon, 9 Aug 2021 19:05:32 -0400 Received: from mail-pl1-f169.google.com ([209.85.214.169]:38401 "EHLO mail-pl1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237041AbhHIXF1 (ORCPT ); Mon, 9 Aug 2021 19:05:27 -0400 Received: by mail-pl1-f169.google.com with SMTP id a5so2658620plh.5 for ; Mon, 09 Aug 2021 16:05: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=q3NLUuStfZMQd5sDYZwFIx1GxfW8BLyvBbkMUeM4RQw=; b=HbJfW/cpU+Z5cmzXyVBLUEmSlPclmPPMLBvdWP0FD+ZamG9U2iIIYhixzwDNsUqiSA Vqjbk9fJsdFg+hYyH5TG53YNbTBG+XAsoWHhE5d2k9/XUF11/7kdrTLJX32jZYSRNF0M 5SoOwC4e1p1QzQEeJdu8tndtEokBtMVpeQTuo/4rPc1x4gtLBjxXvN2oHJgDdhdns2sn sYpJfHAnMHzNnV81OFTUUe7Yzt7PVPQXMdgggmDp0McHziHwQvIRK5+Bm0iPqYtYMLHW OCIdDctLlD6Vy2VJvLrjTjU/iJdtY7kuNw0LHsHmuwx0R/dwd2KiSSiQNpPq8vHiDOdG jMIg== X-Gm-Message-State: AOAM532I3J/WorYiwjTJHFvIeBCEeZKF+RL6XrJ21QcXqa8WoO2fIIKD Do8D2GCy0fudQeayd+2YeYxm/XpT0iVTTw== X-Google-Smtp-Source: ABdhPJz/yFXEeqEPPCAgVRDxVin1rEgOoL22m5EMpF2h34Uyc+U4GkkX39Tb3PUj3htiFS6yekpKaA== X-Received: by 2002:a17:902:7598:b029:12b:e9ca:dfd5 with SMTP id j24-20020a1709027598b029012be9cadfd5mr22434720pll.12.1628550306534; Mon, 09 Aug 2021 16:05:06 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.05.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:05:05 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Douglas Gilbert , "James E.J. Bottomley" Subject: [PATCH v5 41/52] scsi_debug: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:44 -0700 Message-Id: <20210809230355.8186-42-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() instead. This patch does not change any functionality. Acked-by: Douglas Gilbert 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 25112b15ab14..31529d8add0d 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -4722,7 +4722,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(scsi_cmd_to_rq(cmnd)); hwq = blk_mq_unique_tag_to_hwq(tag); @@ -4735,7 +4735,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(scsi_cmd_to_rq(cmnd)); } /* Queued (deferred) command completions converge here. */ @@ -5384,7 +5384,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 = scsi_cmd_to_rq(cmnd)->cmd_flags & REQ_HIPRI; int k, num_in_q, qdepth; unsigned long iflags; u64 ns_from_boot = 0; @@ -5587,8 +5587,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", + scsi_cmd_to_rq(cmnd)->tag); + blk_abort_request(scsi_cmd_to_rq(cmnd)); atomic_set(&sdeb_inject_pending, 0); sd_dp->aborted = false; } @@ -7414,7 +7415,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(scsi_cmd_to_rq(scp)), b); } if (unlikely(inject_now && (sdebug_opts & SDEBUG_OPT_HOST_BUSY))) return SCSI_MLQUEUE_HOST_BUSY; From patchwork Mon Aug 9 23:03: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: 494144 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 2B2F7C4320A for ; Mon, 9 Aug 2021 23:05:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0DACA60F38 for ; Mon, 9 Aug 2021 23:05:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237046AbhHIXFe (ORCPT ); Mon, 9 Aug 2021 19:05:34 -0400 Received: from mail-pj1-f53.google.com ([209.85.216.53]:36511 "EHLO mail-pj1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237061AbhHIXFa (ORCPT ); Mon, 9 Aug 2021 19:05:30 -0400 Received: by mail-pj1-f53.google.com with SMTP id u13-20020a17090abb0db0290177e1d9b3f7so1463629pjr.1 for ; Mon, 09 Aug 2021 16:05: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=T8SlbbTX7ZS3tdWtl1+UcAtfQLkoGrPBUdkthnafFic=; b=XxOBYzDmdYBO+LEx8ummtogaFEHILe3O+xaaa5MeB+C64lGgGmnFCgdzErqniXOTsy NueTedPjweX3sXUdPEaYi6knlbUxog0BZ35pQisw9WGuABXaEpQMnZBFhhhNu4c7YEvv a7YiihtdhCmSVAoq1nOAnoVUc3YlYpRqzUaVhVmwcu0rR8JZkhLfbwO+K9lV2vel1RGV r9Mq5Bkxm+rLu/dzrm0zi3oqjCS85gB0ml0tqYj1+xK2be9p0oSwdytSMB1coj0F/WVu XSqoHMYNlobg1X/M7+ySfXmgvPYanOYqyJQm/2zRkCnD+FuJAAiIby57aOWx1km24fax PNbw== X-Gm-Message-State: AOAM530+nKuTY/7fXtn0xW2tqlUPna0hfri6DlDyNAQctmtCIjoL3alv kUaL2xrpGITxsQvgSO1r30I= X-Google-Smtp-Source: ABdhPJy+NwQzLLOxIONZ7ySO7t2N8croqaSnpwwwGb95QZQCpzwTuP+8ts5DiBgAPqzng7eJFwy4dg== X-Received: by 2002:a05:6a00:1897:b029:3ca:fd44:9137 with SMTP id x23-20020a056a001897b02903cafd449137mr10312214pfh.36.1628550309368; Mon, 09 Aug 2021 16:05:09 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:05:08 -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 v5 43/52] snic: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:46 -0700 Message-Id: <20210809230355.8186-44-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() 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..d5a807c9c0d3 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) (scsi_cmd_to_rq(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], scsi_cmd_to_rq(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], scsi_cmd_to_rq(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], scsi_cmd_to_rq(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, scsi_cmd_to_rq(sc)->tag, CMD_FLAGS(sc), rqi, jiffies_to_msecs(jiffies - st_time)); /* Update IO stats */ From patchwork Mon Aug 9 23:03: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: 494143 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 65080C4320A for ; Mon, 9 Aug 2021 23:05:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4ABD960F38 for ; Mon, 9 Aug 2021 23:05:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237050AbhHIXFg (ORCPT ); Mon, 9 Aug 2021 19:05:36 -0400 Received: from mail-pj1-f45.google.com ([209.85.216.45]:42619 "EHLO mail-pj1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237044AbhHIXFd (ORCPT ); Mon, 9 Aug 2021 19:05:33 -0400 Received: by mail-pj1-f45.google.com with SMTP id mq2-20020a17090b3802b0290178911d298bso2421689pjb.1 for ; Mon, 09 Aug 2021 16:05: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=EtzP95s/sIcg0wtWbViEQxbiXj2bFSd4Jio6b6QJdGw=; b=Jz/6idSx/qfuSZdJ6EQNrIkmgl4FGMdUhQwsNEub2ERkkdpmHN8DSMntDlqxx1bg4+ bDGjT5hPlH8jVWF1hqjQ5NCFQoN2topPHzMTYj4DQy3Tb1beIJDYz4/mfS00vOsywoJu od6R1wPzY32gT9Ak5w1qOmKdEY6hkglgG98PxTAy7//PftQzn4Q60mWgVLtYB3aS7tU/ Hzc3FkttGJ3+RxhOapQkkTjap0KfvKZuINc7XRcyy9ZVUNSt9cGPfjPLb0I6taxnwQID CkAhK7DeBJiUj/F+8ojbTiVc7J91OOb6H78nXNlyMijKQguVZdy0aC7vVXR+vXfPKnSV MzjQ== X-Gm-Message-State: AOAM532H+UtFmgsU0VmHXENomKCLlgKvnXSiZkE0mj009QHWYapzPLRF tvlZ/WclLlYSdYRbvBxtNUc= X-Google-Smtp-Source: ABdhPJy8X0FtHh9AsS5aVtsinA35yF7BvsnnHABEC+QnzSkq+2eVt9JOhtZha/4ZlgEbEAFbe+3AwQ== X-Received: by 2002:a63:5119:: with SMTP id f25mr38334pgb.271.1628550312121; Mon, 09 Aug 2021 16:05:12 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.05.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:05:11 -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 v5 45/52] sun3_scsi: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:48 -0700 Message-Id: <20210809230355.8186-46-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() 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 9ed0bb7ecece..f7f724a3ff1d 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(scsi_cmd_to_rq(cmd))) return 0; return wanted_len; From patchwork Mon Aug 9 23:03: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: 494142 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 3ADC9C4338F for ; Mon, 9 Aug 2021 23:05:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0F95F60FE3 for ; Mon, 9 Aug 2021 23:05:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236999AbhHIXFn (ORCPT ); Mon, 9 Aug 2021 19:05:43 -0400 Received: from mail-pj1-f53.google.com ([209.85.216.53]:53952 "EHLO mail-pj1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235520AbhHIXFn (ORCPT ); Mon, 9 Aug 2021 19:05:43 -0400 Received: by mail-pj1-f53.google.com with SMTP id j1so30352329pjv.3 for ; Mon, 09 Aug 2021 16:05:22 -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=/trrQIYDwfyLamGClCwRt+DPiP0Zme/Paii05lyDYz4=; b=PPolPkzxgobnCKj82UF5KDBvjeX9sIkTuYL/zWF/VDnevVoFeqZC96Fz19x6OoD251 5rL7y4iNQcVzkfbaRexaEDHXvr8cznSFV5wLfQABlNaxXZ+ghf0BxYrp4wd4vhpsLsYi /eAW3sld7oS0N0/pExwaD59h/9MqUWOinTDRURFsqAfRtVS5+/4CSwNB04lwpHFZaFtd 05FuhUboHhsrXjgU/ImRrRgHiDzqZTXPc4fIPPXzRSvBrP++8siKuZpyEkwaoh3IVpPG 71xGk8Etgxy1t1Kv95jOpq2kfHw6h5gDN6eqVqnQyQ4pp0VoQV0uKfyy6slOUne2PZtZ EtHQ== X-Gm-Message-State: AOAM533nzmSKiTztOQvlSFFMxmCcc2+x03Ihg81u4Kzniug1VM4GAOFe XNFyt/xZXon2ZlQ2eAwcgyQ= X-Google-Smtp-Source: ABdhPJyXj02eTQ6/5EDuB56bu3lISDln9hdauSg/UT/agbhE6H6gdlGDEzSmp7jxdTbpdtEVj43rJg== X-Received: by 2002:a17:90a:bb0b:: with SMTP id u11mr1555427pjr.18.1628550321765; Mon, 09 Aug 2021 16:05:21 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.05.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:05:21 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Daejun Park , "James E.J. Bottomley" , Can Guo , Bean Huo , Stanley Chu , Avri Altman , Jaegeuk Kim , Asutosh Das , Greg Kroah-Hartman Subject: [PATCH v5 47/52] ufs: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:50 -0700 Message-Id: <20210809230355.8186-48-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() instead. This patch does not change any functionality. Reviewed-by: Daejun Park Signed-off-by: Bart Van Assche --- drivers/scsi/ufs/ufshcd.c | 11 ++++++----- drivers/scsi/ufs/ufshpb.c | 19 ++++++++++--------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 6c263e94144b..72348153adb0 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -365,6 +365,7 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag, u32 intr, doorbell; struct ufshcd_lrb *lrbp = &hba->lrb[tag]; struct scsi_cmnd *cmd = lrbp->cmd; + struct request *rq = scsi_cmd_to_rq(cmd); int transfer_len = -1; if (!cmd) @@ -390,7 +391,7 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag, /* * The number of Bytes to be unmapped beginning with the lba. */ - transfer_len = blk_rq_bytes(cmd->request); + transfer_len = blk_rq_bytes(rq); } intr = ufshcd_readl(hba, REG_INTERRUPT_STATUS); @@ -2054,7 +2055,7 @@ static void ufshcd_update_monitor(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) spin_lock_irqsave(hba->host->host_lock, flags); if (dir >= 0 && hba->monitor.nr_queued[dir] > 0) { - struct request *req = lrbp->cmd->request; + struct request *req = scsi_cmd_to_rq(lrbp->cmd); struct ufs_hba_monitor *m = &hba->monitor; ktime_t now, inc, lat; @@ -2675,7 +2676,7 @@ static void ufshcd_init_lrb(struct ufs_hba *hba, struct ufshcd_lrb *lrb, int i) static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) { struct ufs_hba *hba = shost_priv(host); - int tag = cmd->request->tag; + int tag = scsi_cmd_to_rq(cmd)->tag; struct ufshcd_lrb *lrbp; int err = 0; @@ -2734,7 +2735,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(scsi_cmd_to_rq(cmd), lrbp); lrbp->req_abort_skip = false; @@ -6974,7 +6975,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd) { struct Scsi_Host *host = cmd->device->host; struct ufs_hba *hba = shost_priv(host); - unsigned int tag = cmd->request->tag; + unsigned int tag = scsi_cmd_to_rq(cmd)->tag; struct ufshcd_lrb *lrbp = &hba->lrb[tag]; unsigned long flags; int err = FAILED; diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c index d0eb14be47a3..908130596610 100644 --- a/drivers/scsi/ufs/ufshpb.c +++ b/drivers/scsi/ufs/ufshpb.c @@ -70,13 +70,14 @@ static int ufshpb_is_valid_srgn(struct ufshpb_region *rgn, static bool ufshpb_is_read_cmd(struct scsi_cmnd *cmd) { - return req_op(cmd->request) == REQ_OP_READ; + return req_op(scsi_cmd_to_rq(cmd)) == REQ_OP_READ; } static bool ufshpb_is_write_or_discard(struct scsi_cmnd *cmd) { - return op_is_write(req_op(cmd->request)) || - op_is_discard(req_op(cmd->request)); + enum req_opf op = req_op(scsi_cmd_to_rq(cmd)); + + return op_is_write(op) || op_is_discard(op); } static bool ufshpb_is_supported_chunk(struct ufshpb_lu *hpb, int transfer_len) @@ -516,9 +517,9 @@ static int ufshpb_execute_pre_req(struct ufshpb_lu *hpb, struct scsi_cmnd *cmd, pre_req->hpb = hpb; pre_req->wb.lpn = sectors_to_logical(cmd->device, - blk_rq_pos(cmd->request)); + blk_rq_pos(scsi_cmd_to_rq(cmd))); pre_req->wb.len = sectors_to_logical(cmd->device, - blk_rq_sectors(cmd->request)); + blk_rq_sectors(scsi_cmd_to_rq(cmd))); if (ufshpb_pre_req_add_bio_page(hpb, q, pre_req)) return -ENOMEM; @@ -596,6 +597,7 @@ int ufshpb_prep(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) struct ufshpb_region *rgn; struct ufshpb_subregion *srgn; struct scsi_cmnd *cmd = lrbp->cmd; + struct request *rq = scsi_cmd_to_rq(cmd); u32 lpn; __be64 ppn; unsigned long flags; @@ -616,17 +618,16 @@ int ufshpb_prep(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) return -ENODEV; } - if (blk_rq_is_passthrough(cmd->request) || + if (blk_rq_is_passthrough(rq) || (!ufshpb_is_write_or_discard(cmd) && !ufshpb_is_read_cmd(cmd))) return 0; - transfer_len = sectors_to_logical(cmd->device, - blk_rq_sectors(cmd->request)); + transfer_len = sectors_to_logical(cmd->device, blk_rq_sectors(rq)); if (unlikely(!transfer_len)) return 0; - lpn = sectors_to_logical(cmd->device, blk_rq_pos(cmd->request)); + lpn = sectors_to_logical(cmd->device, blk_rq_pos(rq)); ufshpb_get_pos_from_lpn(hpb, lpn, &rgn_idx, &srgn_idx, &srgn_offset); rgn = hpb->rgn_tbl + rgn_idx; srgn = rgn->srgn_tbl + srgn_idx; From patchwork Mon Aug 9 23:03: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: 494141 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 4A507C4320A for ; Mon, 9 Aug 2021 23:05:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2F23E60F38 for ; Mon, 9 Aug 2021 23:05:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237044AbhHIXFq (ORCPT ); Mon, 9 Aug 2021 19:05:46 -0400 Received: from mail-pj1-f54.google.com ([209.85.216.54]:46047 "EHLO mail-pj1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235520AbhHIXFq (ORCPT ); Mon, 9 Aug 2021 19:05:46 -0400 Received: by mail-pj1-f54.google.com with SMTP id m24-20020a17090a7f98b0290178b1a81700so2390124pjl.4 for ; Mon, 09 Aug 2021 16:05: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=TMLCx7WeEQe4ZBsSl0axnckf7a0fh04bRQwe8iGs0W4=; b=ac2XdxhMZkeFI6iBoz1EM6s+eBj6HMkKE4/iKZdnBrMiS2FrffO2IDM5suh1ip2EJN 2BOHXxfuT0PFYlkOnSffpdr69lJW4K8s40hkbMGxPZse+61N2mH7SD18jekEeJsU0ru/ bp4qIOSdOKGjNsSOnt+hGqK6RkVQU1zrXTHFKwgX/JsJW1YUWejoPm3DS8ZEilhXCnMQ tsX6nt54+R1s7G+9eWSJsw7vojZd8R/oM++v3qMTyUkigIL2zMMK97VSZU4cuaL9ifwp 6kkkYIG44WSL+BfWywXQTb2B3Aa+BT6EMEsmeA+keXQ2irQQmMkn15dx+P7MA2qvyHpd L1LA== X-Gm-Message-State: AOAM530hTWTPTl2CCJre14az1oRo7ZweMucI4CI6zCMfWu7fqNXwgSy5 1sNw2pO9/rA28nY2l0ws/NM= X-Google-Smtp-Source: ABdhPJxAxnEsKKVNmjU3nT1NIXuK4d3YX2AbsP5TFTn8I2/6qjS0Au9GiOxJ1KMzXdxyRCCSz+PIjw== X-Received: by 2002:a17:90b:1004:: with SMTP id gm4mr6915239pjb.181.1628550324772; Mon, 09 Aug 2021 16:05:24 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.05.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:05:24 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Juergen Gross , Boris Ostrovsky , "James E.J. Bottomley" Subject: [PATCH v5 49/52] xen-scsifront: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:52 -0700 Message-Id: <20210809230355.8186-50-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() instead. This patch does not change any functionality. Signed-off-by: Bart Van Assche Acked-by: Juergen Gross --- drivers/scsi/xen-scsifront.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/xen-scsifront.c b/drivers/scsi/xen-scsifront.c index ec9d399fbbd8..0204e314b482 100644 --- a/drivers/scsi/xen-scsifront.c +++ b/drivers/scsi/xen-scsifront.c @@ -212,7 +212,7 @@ static int scsifront_do_request(struct vscsifrnt_info *info, memcpy(ring_req->cmnd, sc->cmnd, sc->cmd_len); ring_req->sc_data_direction = (uint8_t)sc->sc_data_direction; - ring_req->timeout_per_command = sc->request->timeout / HZ; + ring_req->timeout_per_command = scsi_cmd_to_rq(sc)->timeout / HZ; for (i = 0; i < (shadow->nr_segments & ~VSCSIIF_SG_GRANT); i++) ring_req->seg[i] = shadow->seg[i]; From patchwork Mon Aug 9 23:03: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: 494140 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 D2016C4338F for ; Mon, 9 Aug 2021 23:05:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BAB5B60F38 for ; Mon, 9 Aug 2021 23:05:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237058AbhHIXFv (ORCPT ); Mon, 9 Aug 2021 19:05:51 -0400 Received: from mail-pj1-f52.google.com ([209.85.216.52]:47090 "EHLO mail-pj1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236260AbhHIXFu (ORCPT ); Mon, 9 Aug 2021 19:05:50 -0400 Received: by mail-pj1-f52.google.com with SMTP id w13-20020a17090aea0db029017897a5f7bcso2379039pjy.5 for ; Mon, 09 Aug 2021 16:05: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=yjbZV+3MrAdmbLBg1BOHv8e475oZ5SyVoPXmEaezYSc=; b=sexUkDqTPWEd13ubHr7sxq0CE/DDHh2OKsoPFXwNVR2pd6Z9HJQ/aJXI2mVuTDAO0b AnS55hP2fx882SeDztq0bKF9Vay1+jfS6aoUyfKwm3vXbzHXkBQ3RQ0eFPmZAL57G0wg HUd0TaGMDK1TUOHpE4Qq0IyGq5XPlWMxkUM+FeCvJ13KHX+64z4to9JnJXjPQHqwDcwO mj9vv5vVoxa0vWhDr3iP/Nq2q2TXlMX4sD8g9RfBlkDA8DdX45Mek138nZ4ZfkOxjTxY XSegy5N5IJVDU9B2N7fnKpSu9G4b6BAU4ciikjoKZCzY3euNVV2zxPUFgj2dIHldcRQ4 uHMw== X-Gm-Message-State: AOAM5323m3z1UVuG40MivnNHb45dphYuI8rJu03OO6gfu4ijUCTKMcJ2 6umWYAR1z7240o+QCZXUe0w= X-Google-Smtp-Source: ABdhPJylxPEvIK7XPB4kCphUpx6pf/0bn2WecLXCY3YGRHFSVsvpCJN4gKo/0VjIjjkStw/cTfHfyg== X-Received: by 2002:a63:ed47:: with SMTP id m7mr339276pgk.194.1628550328553; Mon, 09 Aug 2021 16:05:28 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7dd4:e46e:368b:7454]) by smtp.gmail.com with ESMTPSA id j6sm24102260pgq.0.2021.08.09.16.05.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 16:05:28 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Alan Stern , Greg Kroah-Hartman Subject: [PATCH v5 51/52] usb-storage: Use scsi_cmd_to_rq() instead of scsi_cmnd.request Date: Mon, 9 Aug 2021 16:03:54 -0700 Message-Id: <20210809230355.8186-52-bvanassche@acm.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210809230355.8186-1-bvanassche@acm.org> References: <20210809230355.8186-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 scsi_cmd_to_rq() instead. This patch does not change any functionality. Acked-by: Alan Stern Signed-off-by: Bart Van Assche --- drivers/usb/storage/transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c index f4304ce69350..4c5a0a49035f 100644 --- a/drivers/usb/storage/transport.c +++ b/drivers/usb/storage/transport.c @@ -551,7 +551,7 @@ static void last_sector_hacks(struct us_data *us, struct scsi_cmnd *srb) /* Did this command access the last sector? */ sector = (srb->cmnd[2] << 24) | (srb->cmnd[3] << 16) | (srb->cmnd[4] << 8) | (srb->cmnd[5]); - disk = srb->request->rq_disk; + disk = scsi_cmd_to_rq(srb)->rq_disk; if (!disk) goto done; sdkp = scsi_disk(disk);