From patchwork Thu Jun 1 23:27:08 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: 9761353 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 08DF9602BC for ; Thu, 1 Jun 2017 23:27:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF07A28524 for ; Thu, 1 Jun 2017 23:27:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3F3128544; Thu, 1 Jun 2017 23:27:37 +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 4EA7028524 for ; Thu, 1 Jun 2017 23:27:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751152AbdFAX1f (ORCPT ); Thu, 1 Jun 2017 19:27:35 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:52559 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751140AbdFAX1Z (ORCPT ); Thu, 1 Jun 2017 19:27:25 -0400 X-IronPort-AV: E=Sophos;i="5.39,281,1493654400"; d="scan'208";a="22105974" Received: from mail-by2nam03lp0047.outbound.protection.outlook.com (HELO NAM03-BY2-obe.outbound.protection.outlook.com) ([216.32.180.47]) by ob1.hgst.iphmx.com with ESMTP; 02 Jun 2017 07:27:23 +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=hy3pCw7uSYuZwF7wyCTNv3IKUItNfy/4NBClMnsuUQQ=; b=TkwI62MXvEnI5MeXAaKAayAOMls2dxMfbfqk3r4FhvxJt6zR1zhAuzLaQIN2L54LSem3fFSxf0SiSOspuS6OFU6u+ntFhfFGdUL7oGgM71djY9xFho38KfzsoKgWG9xGINZr5XgnYVwuKQI4nslN2cxU9gUEk7QHbL7XG8qx90A= Received: from CO2PR04CA0107.namprd04.prod.outlook.com (10.165.94.161) by DM5PR04MB0395.namprd04.prod.outlook.com (10.173.169.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10; Thu, 1 Jun 2017 23:27:21 +0000 Received: from SN1NAM04FT041.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4c::200) by CO2PR04CA0107.outlook.office365.com (2603:10b6:104:6::33) 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; Thu, 1 Jun 2017 23:27:20 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; suse.de; dkim=none (message not signed) header.d=none;suse.de; 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 SN1NAM04FT041.mail.protection.outlook.com (10.152.89.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1101.12 via Frontend Transport; Thu, 1 Jun 2017 23:27:19 +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 58.A8.51736.5D2A0395; Thu, 1 Jun 2017 16:27:17 -0700 (PDT) Received: from milsmgip11.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; Thu, 1 Jun 2017 16:27:15 -0700 X-AuditID: 0ac94369-6dc8f9800000ca18-a8-5930a2d52a82 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id B0.93.11415.3D2A0395; Thu, 1 Jun 2017 16:27:15 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , James Bottomley CC: , Christoph Hellwig , "Bart Van Assche" , Hannes Reinecke , Johannes Thumshirn Subject: [PATCH v2 09/12] Make scsi_mq_prep_fn() call scsi_init_command() Date: Thu, 1 Jun 2017 16:27:08 -0700 Message-ID: <20170601232711.29062-10-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170601232711.29062-1-bart.vanassche@sandisk.com> References: <20170601232711.29062-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBLMWRmVeSWpSXmKPExsXCddJ5ke7VRQaRBg/va1sseLOXzWLl6qNM Fhv7OSwed81gtei+voPNYvnxf0wObB7TJp1i89h9s4HN4+PTWywe67dcZfHYfLra4/MmuQC2 KC6blNSczLLUIn27BK6MxfMtC44pV6zbsIetgfGubBcjJ4eEgInEl1WnWLoYuTiEBJYyScw6 3swK4WxllHi6cD4zTNWVS/eZIRIbGSW+7F7IDpJgEzCS+PZ+JguILSJQKHFpWwcjSBGzwB5G iZZ9LYwgCWEBT4k7p94wgdgsAioSZ9ZDTOUVcJDYvG4NK8QGeYmzW3aCxTmB4vtazoDVCwnY SzQdns0GUbOIVWL2F22IXk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 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)(39840400002)(39860400002)(39450400003)(39410400002)(39850400002)(39400400002)(2980300002)(438002)(199003)(189002)(9170700003)(81166006)(106466001)(33646002)(76176999)(50986999)(36756003)(47776003)(305945005)(5660300001)(72206003)(1076002)(8936002)(478600001)(53936002)(50226002)(54906002)(2906002)(38730400002)(48376002)(356003)(8676002)(4326008)(50466002)(189998001)(6666003)(86362001)(5003940100001)(2950100002)(77096006); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR04MB0395; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM04FT041; 1:A03SYfo5kYrtahPWEPweE+CDGSubD7b/SSay5Xd0TbVS8Wi30CLBG8MjLtgi23jKYtTfIk1r/x5S9b6D5l94rBjjteATtJclKUxOLnka376AO6z1oh2JH649u3YHcK9VR8gMzK3heePpxJVjpoY2PUiUvGkBC2t1CadhdITrQKjF8USoJARKfsUTf0H4+XJuUt5i0EO4muo2ehLbLVtlEIQhDKZyXjxvGTPys2k8uT9UylkGGZmMglPHobmbZrHS9rRv1trpe5ZKvLKCJB2XMsbWIs/Hci8P9BgkY/5Ul6uOWegjN3p0eg0lSme3RcybkoWZFfQyZ6MzU5ukosm0q0IXGYxWo4K9unX5k3MI+xm4ZsBXuoMl6aQk06S4XMs4boA1yFzKXSVG3IDvtqeWRPlx6hVsKfKxlgmAiXQewtomC1+cgopFqCtkBCE+wV7rsi/sphOjAwdCuTrMIAeoVzp1HSKUCh1RjuDk8uguptA8E8e3XK/EOFVbn0XFRBEqyxnigZ/CX8Qu4vjn47mHmYsbwtoyQlTMc1+abbnJNAz4Si6XgyWJMUeKst6g49O9 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR04MB0395: X-MS-Office365-Filtering-Correlation-Id: 8132941d-e664-4b59-8bd8-08d4a945bf9e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR04MB0395; X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0395; 3:bWtKCKxluEQxPYhscO3xuuchcBwTkl7HyllIPdFEMNmGiR8EXNOpEKd/qjUshYvUp8yGroN2080idTdWVyUGKWTu7UCFxAUrJColrujBM9OkKo7tdQMhdwJ71m4AO5mPKBEAw4Yxe5M+FLMjWCKvLsU7QQ22RUZ/iOtXTIdOPWzPMruf1e9p9VGkMWWE5i9tmqOWKe3SoAoHH2gz6/EqrN2yDorgdfSUB6+upOPmHkIo0RPX4dN0Yy4NjEuyMvv08ELpMXd2x+OX7uVgrt9h6sTr7zc9/ZodSckt6KHF7YIxGG8gQToa5e9woMjphPTUpg7mRgsy8k0v33iiRcOXdCARpL9nHXjIde2ME/lnvsIELF82ggQuXfqqqjp/20UId6KGZa2wAy4svWIW20wAecn6514C8ClDwPxBb5c8zN8x8auVBU4jOxHeIZrHWCJpSRwAejwAZCb7cXEYxpgmsBg/p0yIA1RXh+JcJn3AAIGk2f47J02XjPe8YIrv4CiIf6n2ZceKikfWIaNNYOs15w== X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0395; 25:6P28PWBjRkD32eo7h5ULy3k1WNfXoml+kwj095SnyN/OYGALBM4527Dh17E3YZ3O6PPfhhGpzJ4bBWijB+ZypH83ZdGgEXlN33q2oOVV5HCmdAcXcuNVqA2+WhlpIyPVasfmqcvQW9ui6NFT9iL+oKw+5a6vXImos5OYXMQW4KSuhpZX1gWuX44KND/97aotPrlXFT8peaA9GSaOFaEC9wfeCP4GM26xL01ebp+hj+Flw+MqFFuCDCrD/QlZ043hcBIqFLeq3wa8tKC7mDKCv4aMdTSHeM/GssnDm1UnwowYHviXUWfrBHAwwm/aECCBON948ZoEVfE0hwwM55zdQvAEDMHCTM3gUGPYcX+rmYCLFMcZeGjjQbHzp9XDLF7WBvuuYPFoSu0rtQvVW5ni7SefV/24DEl1w28D5/ufIKXh7xGtc6OZrb3bCtA4S0InMWQfhSaQ0PmRefpfFsvllS0sRWnNj3yPjqgP13dsvAU=; 31:pprv1BTHdEDWMEON1CNqGItAqkPHTbXHcIfNZVON7tVND8M9+0k/XL0St9zVrbq3XPdSW8mmcVlwSKOiAFwU+mWa7TWDJct1k5uW6RPRAR9Qf8mSAIHJsMFsrBSW+OYI25dOv/JJiCujoGNXsAF7K7I23FnAC4gZgjhTKPYDIJRU+rt9enK5LNSp6W/8ms70A2dWxpjOK+cT4DMNcN4qekGL7DKC8JKi7oEHpwgXYQhDlyFIEwF/pWEEmGX9tuzxeQuizwFbtDJAGuZuUfA6iA== WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0395; 20:UC9yYiO/kBuGVRHVldQZxWPUNAXsC9ZJFhCCrRPSDBuYcjSHN7yuJuj4CYxr6pZ7CFZrNaFnoGEJIaJtrBTxPw9REmuu6slvHof/OkLRCe5TXbFOFfv99diHOUoUF0CFH9wely+WvnlNUK+zV6+QNN1rcUPh4JbEIzSGwVEAOmoSVoXb0CcCP3yU2J2CNDD+ZS7ZplID2EVX7I6vnOjVKjC+cTJWJIEvRHzSHQcdng9tzNefFFvh63+5UEMQbgFNgEK5gIOkU4asBoJ5oFzxz1DoQIDR0sMWejtqyomlbsEP4kalVKXkStGkSp5iX2gpr2Cl5L4DPWBoXV0XPvxr1mlYwSFhGnn2RosS6XyCuH08fC0RManHgeT16NDg1xPieLEl2OG62Y1cVpUpQsR6anDFk0DmIdHumeZlTbRNN+pfa1bARCtr99qFilD4bslQgzNmVNuxVRf2BFLee82cjHhACMsW9tHpl1fRV3tXgbZnxJdIytl0FnR+lDu8RJsB X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(13016025)(8121501046)(5005006)(13018025)(3002001)(93006095)(93004095)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR04MB0395; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR04MB0395; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR04MB0395; 4:HxVF/lDuxIWxmaLaU6QT08xgpvA0Gpyf9G8bxAi8zb?= =?us-ascii?Q?nhwzniE/yjBWVJ5PyCginFQUhhYG/xd5hpR9mWzT9CcJKkuWWxMPyHpW9Pya?= =?us-ascii?Q?JHehUDjVT1SNAvNF5gwmDMTN/+ktWxh3ydw96ggfkeyJ8GPV6T3D+HOtDeOp?= =?us-ascii?Q?lbjCuuodEIm7aZYyNmth6wtnoy3EU49Gqie3hFaSXy58aZC8NO61S4kpelyJ?= =?us-ascii?Q?KO7yewkC5FCMTHXoqk9v77b7Wp+Dv4nPMHFgaH70vTwql8vmoFx6UPwNlrQg?= =?us-ascii?Q?2cBBL4O+jiSigiKWYFgc4oulcXLjVx4pOJinf43u+ku0ZNswg2AWHCLEzPNI?= =?us-ascii?Q?0pnRF2QWSkjIq+yrgNA3I9dW8yMUXOmv0Us+lathx2ihhPSGGgbxWGqceREd?= =?us-ascii?Q?Wp6g+T2p4RxZNpR4dieyN8C18DOTp/sWljDFVEATdyELmt7mpqr+t1zbzJtR?= =?us-ascii?Q?tPzND8FFzAyXJ9KhPSTcjXQvLByn/1GbXwQ2PE4CNjHZBfEukN9E1tTwu/9v?= =?us-ascii?Q?L4zlQbTZcfIwRsnZJN4N0qMb5MNsYLkYp8YfIykaA8FRBXQOIG63Fq9//y5r?= =?us-ascii?Q?tdgHukDHA7CBNTSZDV/0d/67YsQK1hXanILffHc4uM5KE4vikwHJynqKOnlu?= =?us-ascii?Q?mDJTkXF9jpjCZgueBTqyEWTLk04Q2MzCAOPqWbyjxBI/ObEuLsEHS1rfxV1X?= =?us-ascii?Q?D+VRiXk2B8/qg07u5VaHinzRVpPWPXhnVRVGn0uFpVIYBwJ2yZ8g9AGKtoZK?= =?us-ascii?Q?rnYtdq4Rq0NYLD42azTv5r8957oooD5Y75lARuwWpkykxKlkGM7yuveH7TEo?= =?us-ascii?Q?CPpHSNXujyUKQ2vO+77w4Uldxg79rg9BoUhbMKAIbwR6ty/dB9y1Ea/4OmsM?= =?us-ascii?Q?kmwB83gzb0ahh9CgnqIoS5nZ0vJQu2lt1lfzxobXCumFFeejcTKvaFGPVOtx?= =?us-ascii?Q?bmRkY/3GYno/VOyBBuAeFV3gZD/JJ5tjJ/K1kcTycjmR/kiU8sPuN/2MnNF4?= =?us-ascii?Q?Fbc6kelOLfIzjx5x4joydTKdO5wKGNufkdYEni6kjBOTjkWlIpD+C0xc+5HM?= =?us-ascii?Q?/CHkM3ZDdRp6t2K+jgtG2Djz3aTuOs8ilEug4hNuk6YP5Y8M8Il4V4Pv7I5N?= =?us-ascii?Q?m35XDiokuJMLNgpOw1DzwajZonLaEzY7ZvdSuKnvJhbS1z4tkorxXUGHojYm?= =?us-ascii?Q?U/Y2JcYw3/7GTSTq8bKSB4L0r3aRKlbxy1+V8ceLSvKVnycgAMdccV1rae2X?= =?us-ascii?Q?rFYIZHrLEfoJtJFRc=3D?= X-Forefront-PRVS: 0325F6C77B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR04MB0395; 23:UxpvFZiJjfteIR47Q6SjMDq7vOB4ehcT5QCrv6PVU?= =?us-ascii?Q?goAZVzzxWNtOUPuNMj/9gJq3OyQM2s7fETfmikiALqwzx69WNHpj7mla6JB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ifq5Z04l5yvvLl8NVTF5hQ4+pswar8aIOOXsfXDiuzZ8lxIb/m+jvTgqfVfJsaLPVEgTSk1XBMS5gdcruY3xfr6b7zgBX7qm2hOtRfhosBXLpohS09YHTOkPyGZCmSqY90jTWBmpDDs5oFVZNpMB4kM2CSqK68mDBQtjvEQII83TMRZsY21P79XFnRrwP1Hdzzvg3xeC9erjE7+fyP/HNEf/xWCzNbL; 24:cSQzbCgcng05Cdv5+OWa+8J1/9KPI9AqnP1sI2GyCvD4Y5fOeFTDYZNgsuy0KgufF8v+MESEVQXs8+UIPlvNeNsQgOOILxunLhm0To1oVqI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0395; 7:DmQkDrLeUDj4TBcbAv1R34Lc2ztk8veuacSPWwtYOEi+rA4wIRBGKSZc7u50GXt3lYBv9cNKv8cUF2+2+yeOqC08eBNV5ttOYXfpYewEIDTnd8TvBX74/APnD98KOce+jtGLdBlZ3MdYEGhQyIMQ5JMs6c8rhpWz6fBhtGLnduTsPVi2EYGb9UXuaeEIUMqN+q/ZYdB0AWXrO81TAWSDUNDFrhwb+gZP4FEu0hMdeYMjlBllbtnIxWC192cwF2OagxQPeWyp7nwb+/O4yyE/GiGG1PYVVL59tt4oisxpTG72PrZySK5FZO1xqX+q10o2T9jvF0+OTTtJv+VR4joOjg==; 20:srHxWHzuORLxiIToK6IzAOVHHSgAqMKgD+0QRbZY4hjKycBelVZPIru543H6aQN6bV7zfyW8WpuVO26aG08OL5c6+kjR8f2vQlfZ4Ph1JsmBKhTC2BwBOg/jiFE6eQjPItjyEEwdUqmibAdadv4M+rq7JxKxSuo/BwC68uz7d3c= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2017 23:27:19.3446 (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: DM5PR04MB0395 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch reduces code duplication. The only functional change in this patch is that it causes scsi_mq_prep_fn() clear driver-private command data, just like the already upstream commit 1bad6c4a57ef ("scsi: zero per-cmd private driver data for each MQ I/O"). Signed-off-by: Bart Van Assche Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Johannes Thumshirn --- drivers/scsi/scsi_error.c | 2 +- drivers/scsi/scsi_lib.c | 28 +++++++--------------------- drivers/scsi/scsi_priv.h | 4 +++- 3 files changed, 11 insertions(+), 23 deletions(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index ac3196420435..2e73ef6c1857 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -2283,7 +2283,7 @@ scsi_ioctl_reset(struct scsi_device *dev, int __user *arg) blk_rq_init(NULL, rq); scmd = (struct scsi_cmnd *)(rq + 1); - scsi_init_command(dev, scmd); + scsi_init_command(dev, scmd, NULL); scmd->request = rq; scmd->cmnd = scsi_req(rq)->cmd; diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 6b4fb48033fb..4041d4c70845 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1152,10 +1152,10 @@ void scsi_del_cmd_from_list(struct scsi_cmnd *cmd) } } -void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd) +void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd, + struct scsi_data_buffer *prot_sdb) { void *buf = cmd->sense_buffer; - void *prot = cmd->prot_sdb; unsigned int unchecked_isa_dma = cmd->flags & SCMD_UNCHECKED_ISA_DMA; /* zero out the cmd, except for the embedded scsi_request */ @@ -1164,7 +1164,7 @@ void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd) cmd->device = dev; cmd->sense_buffer = buf; - cmd->prot_sdb = prot; + cmd->prot_sdb = prot_sdb; cmd->flags = unchecked_isa_dma; INIT_DELAYED_WORK(&cmd->abort_work, scmd_eh_abort_handler); cmd->jiffies_at_alloc = jiffies; @@ -1342,7 +1342,7 @@ static int scsi_prep_fn(struct request_queue *q, struct request *req) goto out; } - scsi_init_command(sdev, cmd); + scsi_init_command(sdev, cmd, cmd->prot_sdb); req->special = cmd; } @@ -1870,36 +1870,22 @@ static int scsi_mq_prep_fn(struct request *req) struct scsi_cmnd *cmd = blk_mq_rq_to_pdu(req); struct scsi_device *sdev = req->q->queuedata; struct Scsi_Host *shost = sdev->host; - unsigned char *sense_buf = cmd->sense_buffer; - unsigned int unchecked_isa_dma = cmd->flags & SCMD_UNCHECKED_ISA_DMA; struct scatterlist *sg; - /* zero out the cmd, except for the embedded scsi_request */ - memset((char *)cmd + sizeof(cmd->req), 0, - sizeof(*cmd) - sizeof(cmd->req)); + sg = (void *)cmd + sizeof(struct scsi_cmnd) + shost->hostt->cmd_size; + scsi_init_command(sdev, cmd, scsi_host_get_prot(shost) ? + (void *)sg + scsi_mq_sgl_size(shost) : NULL); req->special = cmd; cmd->request = req; - cmd->device = sdev; - cmd->sense_buffer = sense_buf; - cmd->flags = unchecked_isa_dma; cmd->tag = req->tag; - cmd->prot_op = SCSI_PROT_NORMAL; - INIT_LIST_HEAD(&cmd->list); - INIT_DELAYED_WORK(&cmd->abort_work, scmd_eh_abort_handler); - cmd->jiffies_at_alloc = jiffies; - - scsi_add_cmd_to_list(cmd); - - sg = (void *)cmd + sizeof(struct scsi_cmnd) + shost->hostt->cmd_size; cmd->sdb.table.sgl = sg; if (scsi_host_get_prot(shost)) { - cmd->prot_sdb = (void *)sg + scsi_mq_sgl_size(shost); memset(cmd->prot_sdb, 0, sizeof(struct scsi_data_buffer)); cmd->prot_sdb->table.sgl = diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h index c11c1f9c912c..c43a138423d7 100644 --- a/drivers/scsi/scsi_priv.h +++ b/drivers/scsi/scsi_priv.h @@ -8,6 +8,7 @@ struct request_queue; struct request; struct scsi_cmnd; +struct scsi_data_buffer; struct scsi_device; struct scsi_target; struct scsi_host_template; @@ -30,7 +31,8 @@ extern void scsi_exit_hosts(void); /* scsi.c */ extern bool scsi_use_blk_mq; int scsi_init_sense_cache(struct Scsi_Host *shost); -void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd); +void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd, + struct scsi_data_buffer *prot_sdb); #ifdef CONFIG_SCSI_LOGGING void scsi_log_send(struct scsi_cmnd *cmd); void scsi_log_completion(struct scsi_cmnd *cmd, int disposition);