From patchwork Wed May 24 00:33:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9744707 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D0C7A602A7 for ; Wed, 24 May 2017 00:34:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C352128867 for ; Wed, 24 May 2017 00:34:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B81D72886B; Wed, 24 May 2017 00:34:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0175428867 for ; Wed, 24 May 2017 00:34:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760654AbdEXAe5 (ORCPT ); Tue, 23 May 2017 20:34:57 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:5764 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760620AbdEXAeb (ORCPT ); Tue, 23 May 2017 20:34:31 -0400 X-IronPort-AV: E=Sophos;i="5.38,383,1491235200"; d="scan'208";a="19885593" Received: from mail-sn1nam02lp0019.outbound.protection.outlook.com (HELO NAM02-SN1-obe.outbound.protection.outlook.com) ([216.32.180.19]) by ob1.hgst.iphmx.com with ESMTP; 24 May 2017 08:34:28 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=/SLF3lJ4TAymPegi/6qxeOfRprANS0xG9ZICFhkRh8A=; b=SLv1WgBwdS4W/o2US3JGwI6zKkMb/Q8MGVm3Z/W4jF0+zR39oceIm3SmTqphE09N8N60KuH7ZyygRf0joAIzKZJOnGTv7f0kEvmJYTB1oLPcD39Ri5jmAD/+IsC0IK5nkOlXgRDal/3dCDqEZ6z8tnMmb4oF5VQ1MSTph5bt5ZE= Received: from MWHPR04CA0078.namprd04.prod.outlook.com (10.174.173.19) by MWHPR04MB0366.namprd04.prod.outlook.com (10.173.48.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14; Wed, 24 May 2017 00:34:26 +0000 Received: from CO1NAM04FT030.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4d::208) by MWHPR04CA0078.outlook.office365.com (2603:10b6:301:3a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9 via Frontend Transport; Wed, 24 May 2017 00:34:26 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; HansenPartnership.com; dkim=none (message not signed) header.d=none; HansenPartnership.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by CO1NAM04FT030.mail.protection.outlook.com (10.152.90.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1075.5 via Frontend Transport; Wed, 24 May 2017 00:34:25 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 94.43.45291.015D4295; Tue, 23 May 2017 17:34:24 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.9.6) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Tue, 23 May 2017 17:34:22 -0700 X-AuditID: 0ac94369-166ac9800001b0eb-ed-5924d5107a47 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id FF.93.18148.E05D4295; Tue, 23 May 2017 17:34:22 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , James Bottomley CC: , , "Bart Van Assche" , Christoph Hellwig , "Hannes Reinecke" , Johannes Thumshirn Subject: [PATCH 07/31] scsi: Use blk_mq_rq_to_pdu() to convert a request to a SCSI command pointer Date: Tue, 23 May 2017 17:33:56 -0700 Message-ID: <20170524003420.5381-8-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170524003420.5381-1-bart.vanassche@sandisk.com> References: <20170524003420.5381-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrDLMWRmVeSWpSXmKPExsXCddJ5ka7AVZVIg7/fzC0WvNnLZrFy9VEm i439HBaPu2awWuy9pW3RfX0Hm8Xy4/+YHNg9pk06xeax+2YDm8fHp7dYPNZvucrisfl0tcfn TXIBbFFcNimpOZllqUX6dglcGR9uf2csaFGtmNbUw9rA+E6ui5GTQ0LARGLrh1lMXYxcHEIC S5kk5k59zAzhbGOUOHGmiRGmqv3mTEaIxEZGic/P3rGCJNgEjCS+vZ/JAmKLCBRKXNrWAVbE LHCbUWLf2naguRwcwgJJEg2LwkFqWARUJT7uOM4OYvMK2EksWzKHHWKBvMTZLTuZQWxOAXuJ rlcT2EFahYBqFm2vABkpIbCM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essage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39450400003)(39840400002)(39860400002)(39400400002)(39410400002)(39850400002)(2980300002)(438002)(189002)(199003)(9170700003)(81166006)(50226002)(5003940100001)(86362001)(36756003)(8676002)(8936002)(77096006)(2906002)(6666003)(48376002)(575784001)(1076002)(50986999)(33646002)(5660300001)(76176999)(106466001)(305945005)(2950100002)(47776003)(4326008)(38730400002)(478600001)(72206003)(50466002)(54906002)(53936002)(356003)(189998001); DIR:OUT; SFP:1102; SCL:1; SRVR:MWHPR04MB0366; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM04FT030; 1:zJvyXaKXjq+fCl+0/SOdhb1nxvp5fD4yjdXB2gutmHC+6xxeaddMhBBBaGLa2HacF0aUWbCW3vohRu/QnOYJ/VTUgmYX0X8UfEjyBBOmZdbr0PcnCzzriikj1TsXclcd3MFgd/obrIogwkUBgzASPk/Wnn8NdtG2MXXQI3lN5imKQ0s3fu1tbULyYLJOC7AyDKpWxIikpxXLonAWC6GHe0TTnmHrcS1GfhaRhN+TCzNPkj/hcQyf66wKQyRJ1tka3EtXAbBJmGbYgof9stbxAnXy19X3HngqadLPai+yPzaMa6AWPAZYW2xh+Awowa0OZFcaB2z9zXtE/raFV+nSN0Ue5OnvUnfNpo16R1AS1gK+AkCNKjb7JEzaDLYKQuTbmTrMHEfY3VFOdyfp7lJUn7SpZbKEBxZ5hE2eAzwzy0DIKccBXBm+VmySwSNG1x1R8SxT/GGjQmYTGDjpw/nuECqnRjWNwtPO4uwkRuA/GGAUp/44c9oUIi+/p7+rrzxjKgOK7m1nORAi4xtLM84vK0Z2VNw0FoBAh9VB40wZi4g= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR04MB0366: X-MS-Office365-Filtering-Correlation-Id: 07835c89-725c-4fb8-a8f6-08d4a23ca1c8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:MWHPR04MB0366; X-Microsoft-Exchange-Diagnostics: 1; MWHPR04MB0366; 3:Tq9LYN6JBnNvWno+2h2HNLoTWu6+KAnFS3b33kAmx3OCyugc2hm1W/GwHjBY4UW2cAlXTJ3WDhBX6AQtqTAS9Wa8taYRzsHRO/Ibyhh8wny0f2yg0jNk47cAY6+vTpUWNlxKvj3q/P6bohmi7Rc0v+F1pVpjlDMHi82ucP5SphtDYK+b+q8a/KBVDjNpOtSAAV7SidVUW/b5ZVRwKIQsB4x5Hm1B3K2t7u2yH+2lfmV/kOdnuolJTEqvg1wI6EKHdV2I/rXGB9RdvHjBcpWOKTTSI8oYs3E/CEm5uFFOaP689oxBPn0jnVlYpKJxAnPRyDnCM/nQOsFMsoW1VRpi9iJiem5bhk/Rl2BV9Be7uvkBfemMPRosU3Y0v3w/4b6jLObuvR42BVsFNfFaMwTh4L24/2p6JaNZCfZPP7dMoaDRcPGMeyUmdnBya6vFkuH9uYmceDm+NA7BpJg4hxiMkO2kBnfmdadYW+wBTPBzyHbxLlh0Kugbd7KXCq1F1va5 X-Microsoft-Exchange-Diagnostics: 1; MWHPR04MB0366; 25:jOsD6cVULDAW412pRwQ1zYxowob1HhmMTtcjnzR/5ZGGTHCYOlAdoGD9FiygAjLERYA5BxK56DDhKL/0iVkac2f2CJxIuUuviVYRtJauCOhf4O6+fz1VasyAP2iEJq4KY1GCIALu/w8BlpNv1OKdYoIWKY6HCPR30FmHui/EYJonDZ7TVdathyhT8LrYpb2FTWnXq7ltuKNFQmi5jmuLgLb+7MH+O0KvENeLIZMCGPjeMJv1GNOmO0OQ+PaMmOrKJDUgQTSDNWFlcD5iuHexXn/EJR/0bYrObO8VX4Kn7NF3iCEZPZEeizJBMkV7S4/UZP6yWL0NaKLPmh796LrPjO+C3I7oAY72eL3i4a47vrcKeGOijNGxmAjQb80aq+FFiyD4bQ2BGwmpeuA7WQo87dQhBery8Gq0Y92JYg/h+yGkfY8dIL5nGTmzxxfWVU4nnyItJMob7bBxFKevb1IdSA7i3SbhI6Usz8lHEQhRaYc=; 31:VXlceYzjKBTgTTURrWzki6ONYAzqYWhXk+fYNkhnvAqBvPVlfl+FbR6b89LgWopIYp39EGMV31V0XA1Idg/HlESVjifBcoee4AK1T3R0WQnZD/kmvovcRwQqgqKKz9IOeeHItF+Ufbuw0bKFYJ4h2qGyR1YxSPoBP2q4jKAaas4AgHJlxcJH5o489daFfrwNhD+lYrUlDhCJaog7xOpFGzk2wJBUPSWUgHoQ+bJ+yfCWNeZ7bDuxNLjS4y26UAHVB7SKBUqc+5yyvAHOQ+VU1A== WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; MWHPR04MB0366; 20:5Vkmg/suFyYZXkDg1hAvGLH/E4KnFuzG7tFXs+j3Wvh1ZqkHjnRDJz3pOIWNn3MFGBRGLN5G6gXdiFs6OxFZZx86Ls3iKk+WmES7fq6Wks+IOuyoTKacSzOukjS/crqvnLAs5XZ9CHDg4c9iTgHVaTmEg3FUBV3LN7r111cXYfjVpiFFVo2Ph8dsjDojrd4FRNQdMjdRvQTxjukjigfSu9X51RwU6mFMxagY5+pEseI6havsncF7mc2pWpn8j4l3HPqrPGfkEpUr290897gCVp+l4SwayLCqsTWl8iRdfwMue7J8NPM2uzCvbxzmC49AgK7JxSsoT0geL5oT4MbdUQm06xmQxZ9KnBYI7u3h0QSc8t99x9yNJh0AeMKZhb3V3axOtnZIqHN2MctJRv3gW+VBIrmZMjxHQHHDcMBNRMhgJXiZaJg7b9A220sZyMkeB6TleCZrsAnHQoxVIUmVw/KVGJ0l8dJYgbZaQ6geNyYQBvtH9t+br7QXqwcglrZ/ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(13016025)(13018025)(10201501046)(3002001)(93006095)(93004095)(6055026)(6041248)(20161123562025)(20161123555025)(20161123560025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148); SRVR:MWHPR04MB0366; BCL:0; PCL:0; RULEID:; SRVR:MWHPR04MB0366; X-Microsoft-Exchange-Diagnostics: 1; MWHPR04MB0366; 4:f/zDSHHpna5mBteUuGCf4yqoEwQE3xitGIXDdBE1zbibWkHyMFLHja0PfoVTpPZDa+AByB7fPCJUGR8ol4Lg7sXl2RJPOlTam/ajPX9p0ShmylLKfIPRgakQsrypgxzWAtBZ/1q3pbltwShnsYOI6gy8gCECg+nSSLDIGhdQsp6hNYxN1XqKXYK/ObuQdX6xUVbuMuCUEarqh5K01QoQ4TYkAaOUuzIp/CzldvUTLH5DEmH/ukzb+v9tYlZ0BtSfjj/P3BrLZJowTfz1sE6NeiwE7D8ta7ZM7jwGZBuw7XBzQZPWunFmfuvMzOvQwUAkkqewMcGoCm2MyTVwF+t+h8/ZHzqa/cdWFY33yT4HVSzCYOV9ozk1OmtpUfacIrVSxM7bXXFCbqUZ1ecGIMNn5KBvgaEbTQCwMFd7r5PW1RddvrdRMF52Q5PcjaaZTBUjUukWGWN5M8MkTibKYERZJgcPhwJcnesElqnHIRuprGHGMs+jGw40kHCaiNId10vCPA+2m1JVhQBtVkbYGB+U1JB3KvUGLjVfA8PpxvtagMblPedIQbmaG/gNOLfGYlCoj4ELoul3KqoOOQxTlqNtiOHtNY6Zi25UpN3IZ9FOCw3j7loV9mRBVQhcqGPbm0twxG85U8rm1Wlyb3yAFBiWatI3rSI8s/PwjEEbnCv81sdyeF9CtoyrAuuexKP5V6h9gStyDh8zo9fawwkVtWoI5Gy1XfQkWHYMuTGnKBkOVtlvmpOsvYmMGs1WZRZ1Ntdf0tFr76W8wSx2YbspBBCXPJibS7W80pzgsI+Dw6Vsc8f9I4iyfs81EM9GZ9z6kMQPwoyEqLUwsKKPF9q+CW/r7Y8/clFyihszEymU00jKnvdbMSz7YhoYRtr5v3gL7aWGwudlWmy2BAfSbqw7HzcZWVCwnP1VoOMsU0Kbydrc9e k= X-Forefront-PRVS: 031763BCAF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR04MB0366; 23:XmXvN3nfMm9FrUHNA0B1rkPHxKUqMCyn6kLkqnaUu?= =?us-ascii?Q?SiNo8PRBfrM7hUmTEJv9OzT2JgdhRA8w8slug728NXcsG2tsR03PkRU9c0Ld?= =?us-ascii?Q?LlFXxyAJDnspjKjD+5+QgOCPuCtf56KRUvc0nMyO9hoR8kEkohOgu7U1HbIl?= =?us-ascii?Q?PMbuEsPwasCayTp/mnSkvFvex6jJD2VcW9qgu4sNwGuGLcUm0OLttYqdgwfZ?= =?us-ascii?Q?P/i44ULwJrAVWGC8WuDKM4PIlLhTG/vNJWRlPNHB7iNcGRnvMWYLifZ0cCoQ?= =?us-ascii?Q?IlnqKFe/Iti/Kh2fy3c3Kihpgc3QXaPeLn4QA/26LbfrzcZVG0YdyuvebfJ6?= =?us-ascii?Q?1Lafumw50pEbR8J/I9GRKBvAsvSIU/n/akB793SOzm6uwJs7nr8mUvlhUlQG?= =?us-ascii?Q?4l6FrgI2Hbu6QyW0D85IjhwlS3179kNFdIUuj05l/YxMk3Qy+tjYl6eWgtpD?= =?us-ascii?Q?74ZUFckZwc57CB0AAduw2lSf260Iv7OZwP8Km9HIJ1FZBLjrRNEneabeO1pr?= =?us-ascii?Q?YCIK+7W2NAaNqhBLp70UBwveQuuKjMiJ+NymahOasr2xB8uv9wsZ2+7ACYfA?= =?us-ascii?Q?X6HUhpx1gEvXRJfYB1P+QSNiPRQMGrjcNY8AhgGCpIs8g9UpA7w7SbBADElW?= =?us-ascii?Q?rDJyMcgJZX7xxi6gQOpxoE0BA0S3SXo7FRoccFwCrk1gMn1VorXic9wCFBDv?= =?us-ascii?Q?gCG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Aj3a9B1bEd14Q07GrG57XZefTO1p/V14ZbXlF0JZqBhaoSkn8WrWLKRsVB/YUjH8ldQg4vDtJd89Pf+BW1R5jPDV6RSTAxHxfWZiECoRA5AazhyYqrBDeOHjZXYFIGhQOXF/b2bFtVPU29IjtpDAQ==; 24:v2Gz4BckqeuedD1yG56+eyQo5CKl7ZP0vEfd50bYgBUq66z01qtHpwHUHh/4/84RYRTkOEpdoqt0vxB10amp9GcMeAmMC2C26GmkkYJFRHg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR04MB0366; 7:vqTsYJPYLplfZxVAruotOi+2jTNaMyfolC5UkAOfJrs3xzqJRmdNQonOA1jJY7K9GMXpJAxTepabnflBgkEW8/VsaN11MI0FzgkYYqxVmKwPBJmj8Abunou6EoBTjJ78HJH7HRERLWx1TCf3zp9zBtQ6tm5ck1CbaJn1iMFJOIxt/xkTfVWl/OWu0Jk029OFSX1iihAjOGui77Hy5jjkbJEYPMwPv+ovITrslbFdk/w0aOv7QFQRAyq+VoAe1iyRO2HEYPy+wwmdfJxr4bYNVKZhBabACM4huD7yHq7n/uBb0gSCgMCp6elH2Yyp5cyv20U19KCvWiiT9IuFM7z9Yw==; 20:OWzSd9eRg4holKSsCSK8qbKlPPTB6No7G94c05MdmJ0HSxgYGq0C2JgNdYvO6kuYDmYwfjYUfCjQgM7EN3tnw/PTosHlmasZnUlpyPBQhP6ewCSsWile3tmudC1Ls4Fnwy1asBKrWqSIVXI9bWovavGNv0du4PPaNV3DLMbBUik= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2017 00:34:25.7727 (UTC) X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=b61c8803-16f3-4c35-9b17-6f65f441df86; Ip=[63.163.107.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR04MB0366 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since commit e9c787e65c0c ("scsi: allocate scsi_cmnd structures as part of struct request") struct request and struct scsi_cmnd are adjacent. This means that there is now an alternative to reading req->special to convert a pointer to a prepared request into a SCSI command pointer, namely by using blk_mq_rq_to_pdu(). Make this change where appropriate. Although this patch does not change any functionality, it slightly improves performance and slightly improves readability. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Johannes Thumshirn Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn --- drivers/scsi/scsi_error.c | 2 +- drivers/scsi/scsi_lib.c | 18 +++++++++--------- include/scsi/scsi_tcq.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 19cafa3efb17..7ba5f988426c 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -265,7 +265,7 @@ void scsi_eh_scmd_add(struct scsi_cmnd *scmd) */ enum blk_eh_timer_return scsi_times_out(struct request *req) { - struct scsi_cmnd *scmd = req->special; + struct scsi_cmnd *scmd = blk_mq_rq_to_pdu(req); enum blk_eh_timer_return rtn = BLK_EH_NOT_HANDLED; struct Scsi_Host *host = scmd->device->host; diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 5c6874cf4388..30a7900d331c 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -637,7 +637,7 @@ static void scsi_release_bidi_buffers(struct scsi_cmnd *cmd) static bool scsi_end_request(struct request *req, int error, unsigned int bytes, unsigned int bidi_bytes) { - struct scsi_cmnd *cmd = req->special; + struct scsi_cmnd *cmd = blk_mq_rq_to_pdu(req); struct scsi_device *sdev = cmd->device; struct request_queue *q = sdev->request_queue; @@ -1156,7 +1156,7 @@ void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd) static int scsi_setup_scsi_cmnd(struct scsi_device *sdev, struct request *req) { - struct scsi_cmnd *cmd = req->special; + struct scsi_cmnd *cmd = blk_mq_rq_to_pdu(req); /* * Passthrough requests may transfer data, in which case they must @@ -1187,7 +1187,7 @@ static int scsi_setup_scsi_cmnd(struct scsi_device *sdev, struct request *req) */ static int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req) { - struct scsi_cmnd *cmd = req->special; + struct scsi_cmnd *cmd = blk_mq_rq_to_pdu(req); if (unlikely(sdev->handler && sdev->handler->prep_fn)) { int ret = sdev->handler->prep_fn(sdev, req); @@ -1202,7 +1202,7 @@ static int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req) static int scsi_setup_cmnd(struct scsi_device *sdev, struct request *req) { - struct scsi_cmnd *cmd = req->special; + struct scsi_cmnd *cmd = blk_mq_rq_to_pdu(req); if (!blk_rq_bytes(req)) cmd->sc_data_direction = DMA_NONE; @@ -1339,7 +1339,7 @@ static int scsi_prep_fn(struct request_queue *q, struct request *req) static void scsi_unprep_fn(struct request_queue *q, struct request *req) { - scsi_uninit_cmd(req->special); + scsi_uninit_cmd(blk_mq_rq_to_pdu(req)); } /* @@ -1530,7 +1530,7 @@ static int scsi_lld_busy(struct request_queue *q) */ static void scsi_kill_request(struct request *req, struct request_queue *q) { - struct scsi_cmnd *cmd = req->special; + struct scsi_cmnd *cmd = blk_mq_rq_to_pdu(req); struct scsi_device *sdev; struct scsi_target *starget; struct Scsi_Host *shost; @@ -1561,7 +1561,7 @@ static void scsi_kill_request(struct request *req, struct request_queue *q) static void scsi_softirq_done(struct request *rq) { - struct scsi_cmnd *cmd = rq->special; + struct scsi_cmnd *cmd = blk_mq_rq_to_pdu(rq); unsigned long wait_for = (cmd->allowed + 1) * rq->timeout; int disposition; @@ -1749,8 +1749,8 @@ static void scsi_request_fn(struct request_queue *q) blk_start_request(req); spin_unlock_irq(q->queue_lock); - cmd = req->special; - if (unlikely(cmd == NULL)) { + cmd = blk_mq_rq_to_pdu(req); + if (cmd != req->special) { printk(KERN_CRIT "impossible request in %s.\n" "please mail a stack trace to " "linux-scsi@vger.kernel.org\n", diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h index 4416b1026189..5b416debf101 100644 --- a/include/scsi/scsi_tcq.h +++ b/include/scsi/scsi_tcq.h @@ -39,7 +39,7 @@ static inline struct scsi_cmnd *scsi_host_find_tag(struct Scsi_Host *shost, if (!req) return NULL; - return req->special; + return blk_mq_rq_to_pdu(req); } #endif /* CONFIG_BLOCK */