From patchwork Tue Jun 20 18:15:41 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: 9800059 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 B945460328 for ; Tue, 20 Jun 2017 18:16:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9256212BE for ; Tue, 20 Jun 2017 18:16:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD0E028294; Tue, 20 Jun 2017 18:16:11 +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 8E508212BE for ; Tue, 20 Jun 2017 18:16:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751085AbdFTSQI (ORCPT ); Tue, 20 Jun 2017 14:16:08 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:29524 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751128AbdFTSQD (ORCPT ); Tue, 20 Jun 2017 14:16:03 -0400 X-IronPort-AV: E=Sophos;i="5.39,364,1493654400"; d="scan'208";a="129578073" Received: from mail-sn1nam01lp0115.outbound.protection.outlook.com (HELO NAM01-SN1-obe.outbound.protection.outlook.com) ([207.46.163.115]) by ob1.hgst.iphmx.com with ESMTP; 21 Jun 2017 02:16:02 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=tm4X6I8/O80P2exg6TMvZXMwaumDAQElwWgZekRXFxU=; b=OMBglPuYAxnsnSsatL4B6L2ck+TbVkKjIewdMCLwO1a0h2Ug2VJFH6AfE7JZndrJd+T4wBayXzlplx1TvFpEVo9+AjxK8+vqAsY4ukmuok+j5K5TB6H+OYiUwI7tiBenGK+hIQjOy7IZPC1hh6j07qj2CHiXL82IPL0f1v+Z5V0= Received: from MWHPR04CA0070.namprd04.prod.outlook.com (2603:10b6:300:6c::32) by CO1PR04MB555.namprd04.prod.outlook.com (2a01:111:e400:103e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1178.14; Tue, 20 Jun 2017 18:15:59 +0000 Received: from CO1NAM04FT030.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4d::208) by MWHPR04CA0070.outlook.office365.com (2603:10b6:300:6c::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1178.14 via Frontend Transport; Tue, 20 Jun 2017 18:15:59 +0000 Authentication-Results: spf=fail (sender IP is 63.163.107.21) smtp.mailfrom=wdc.com; fb.com; dkim=none (message not signed) header.d=none;fb.com; dmarc=none action=none header.from=wdc.com; Received-SPF: Fail (protection.outlook.com: domain of wdc.com does not designate 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.1178.14 via Frontend Transport; Tue, 20 Jun 2017 18:15:58 +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 9A.16.02805.C5669495; Tue, 20 Jun 2017 11:15:56 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Tue, 20 Jun 2017 11:15:13 -0700 X-AuditID: 0ac94369-9c18398000000af5-e3-5949665c66e9 Received: from exp-402881.sandisk.com.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id F1.5D.11415.85669495; Tue, 20 Jun 2017 11:15:52 -0700 (PDT) From: Bart Van Assche To: Jens Axboe CC: , Christoph Hellwig , "Bart Van Assche" , Bart Van Assche , Hannes Reinecke , Omar Sandoval , Nicholas Bellinger Subject: [PATCH v5 04/12] block: Make most scsi_req_init() calls implicit Date: Tue, 20 Jun 2017 11:15:41 -0700 Message-ID: <20170620181549.24903-5-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170620181549.24903-1-bart.vanassche@wdc.com> References: <20170620181549.24903-1-bart.vanassche@wdc.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJLMWRmVeSWpSXmKPExsXCddJ5kW5MmmekwesTBhar7/azWSx4s5fN YuXqo0wWe29pW7StPsNocfjeVRYHNo+Jze/YPS6fLfW4v/0Ik8fumw1sHuu3XGXx+LxJLoAt issmJTUnsyy1SN8ugSvjZ8dR1oLmBsaK69vnMDcwfs7sYuTkkBAwkZg/aT9zFyMXh5DAUiaJ 7//PMkE4Oxgl3r7qZoepWvX8KiuILSSwnFHi3K5kEJtNQE/i1Lx9TCC2iICCRM/vlWwgNrNA D5PEy1VpILawgKfE4ccfWUBsFgFVifPzX4PZvALWEqt/3GCGmC8vMe1dL9h8TgEbifdLTrNA 7LKW+Pr9PhvIQRIC61glbnyZBNUsKHFy5hMWiGUS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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)(39410400002)(39400400002)(39850400002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(9170700003)(2950100002)(4326008)(6916009)(72206003)(189998001)(53936002)(77096006)(54906002)(50466002)(478600001)(110136004)(6666003)(86362001)(38730400002)(575784001)(305945005)(8676002)(5660300001)(33646002)(356003)(36756003)(50986999)(47776003)(85426001)(50226002)(76176999)(1076002)(105606002)(106466001)(8936002)(2906002)(5003940100001)(81166006); DIR:OUT; SFP:1102; SCL:1; SRVR:CO1PR04MB555; H:milsmgep15.sandisk.com; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM04FT030; 1:gY/EKK9rgzXPhw6yYUv6v54AQUvtkNz096/kDjQfrW94FBSdWORiE/n0Bqq90psBmaGM4K4It/L3cdwOEs90HSXLDgxTO+AnK86RW5GEr2G2KvaFBJoFflpdfB65DUkbRS0+vqoA/Bbsv/iE9ohz/iKCvLY0UU56pAeDiW/TLL/otUA2p81p9yMC06D+BBmFshs4mT56/s1doCqw3zyi2qZikqrMhr3ZI+pWisqvztyR4QUpDwHXpuXoWJDCS43dZQyZrx7hqgxWer+2nIiKWo3svJn9dlRFTJH5888akajgU4/ba4lvGefcJJKFVIP2ru2uf3uvvaA6Sr5MBDqnuXbQYf1TG6Bi6IK6v9DXMbIRNOnml2UcaJluZwOfTM5/bNBjBsCt4K9qyE52HNMZKGKk6nzcRBnIwjWyW1i0RqMwuh5hHbj7Fl+q8HDkxJbr4aEswCZDVaTxTjXndFIDVfuWOeqHKA49JegYcNYYcYwsrLh/hXu1CcAUplSouSSpe9rMJkCByEQWWloXEGcW9Ka4cvfkCKXL5hsM72fiEIkjArUVXgSel9eGhKc2WGW2b4z0btReyOIQDRZsuHGH0pWTWUyAqjkpmu7HstzET28yPyoIWwd3otUafNpuv3YsvPwCICGg5mPuL4L51+Jtx43YK01RFRapVoHgYoYiGElnMdcpV3vfKJsuLsgwD5baWpaOx9n8OqwbzrK+AGqT8JFqri9UxDLbahBqBRSkoIVVEy0e3aBK2cBVgl5d9H0OKPmGpJxhHlJ44tbMiCrK6JnaQtqY3a9qxAzrOXk/tMjaRa1DafXnC83QolqRhQ90PWHdzaYcZqGsms4BaQXVVmJV7EEg7iySxvWRfkagpZTSefdKz6tnQWGZ//ysqUR5GiqLLx/q+zq3+NXcdJYom6C0iABWWxHAOZ/7YxdrXS 0= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 31fe6dd2-a5df-4405-fc45-08d4b8086740 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081)(201702281549075); SRVR:CO1PR04MB555; X-Microsoft-Exchange-Diagnostics: 1; CO1PR04MB555; 3:8xbWY8bexaLE3sABOJJgtTGjC/5QilE/Ql2xj1IS0ay+IO5QR1tMUgsYpOO19K54Chi+a9mnZT3e/tRi76ycnwCxnxMuOlpgwwyvINRLH2i4fmqS8FLVcuDZale1dS+J9ZUd9rRh11Cgd7AslZPWZ467EsSBbSZfuUg3cYKVVNAXKpcRjySvGjatLjvsUD2AJMDXi/lVmQmPh4eT9OKcYQX/sDROJh84zUgD08d7eVOb6+32/cFsnW+qrFdCm4/XMPyd1KgWJbZeK0V3pAbK+znh4xOyjYx9uPQl1c95grLBkQ4GRKPVhUFptxzUlC0agUWWfdECvhTFaegPbYSI5L2UBToDTj63zZRiqCCoCRJxMbllAtGGuejfxnTYJUpY7QNvxPRA2ISPMUrgLpLYal4Xgf+qLL4LWDFkHW7OSCGLPEhtEQfyKcIqu7Xz+6UCHuAyht8YI9YD9FUcD+3bYjM9Q64/dNt4opoxUOd0YGF2RhJMkZucjb8PQMacz7iY X-MS-TrafficTypeDiagnostic: CO1PR04MB555: X-Microsoft-Exchange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FBHl/wasFVr8543qtHwuJMm7+tzwI9qy2QmiG3uqQOglSWpRguWOqHSheDhmpH31ntb1bfIDUf7xva8iuW0l/AxI1yiEU5NfhHdAJn41b5H70j8inIyDMQo3wFHdvQu0RO9BOa11IpqNNF3e+x84KUIqVyx/5P5dK1wFOD/bBnXuVglGppUBXNntAq4JL9gJB/18CSYasUsm4zv1NDzXSVyftMTrem+mBbxV5UZD3+hb3s/Hzy4yA+bWLZKDQOAQ6Faweo1oMaDl8zJnKM4SOmguwcVrtJhkKlGuThiT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484)(42932892334569)(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(13016025)(5005006)(13018025)(3002001)(93006095)(93003095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123555025)(20161123564025)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO1PR04MB555; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO1PR04MB555; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO1PR04MB555; 4:NfGpDmPvxpPFTvCrYBQWCpJcLwhCx+i0E6BJXhQ6Tgg?= =?us-ascii?Q?L+HEB6U7eKhrJw0T6nb0aVSu+N7n8CP0e76KFeMyBPJy1BnIlGN+BqR5DeNu?= =?us-ascii?Q?cPySLi/3whegCuzxP1jKe/AIiCtdKk3SuMk4QANkFoz6sANS72fU+aHyECoN?= =?us-ascii?Q?X4s/hi2RxjTQEtXk+iWl3v0ZjkJWy1Ih2buHu0m8Lp5CQ+gn03m9L9+yzNp1?= =?us-ascii?Q?r3R9z6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LRD+CGtY+l2jkEI?= =?us-ascii?Q?EaXEoxspEG+mYWUpVkLoJ0jVmtdBJtHJ/zZg2qElbqj4t5HUVMIPDNGi1htC?= =?us-ascii?Q?UyZzIsOrIABr0j6AEzNZeVmxA4RRojpSL+f2O8HE1mZRhoAxCeuoijipZFqY?= =?us-ascii?Q?+PgCV0Z40Xw5p1JIL5KRzcuTWRAHrKD97g2pCYq4ZwctHZeolfapVRdA7LCJ?= =?us-ascii?Q?Yiqb2WS6ABdUcWcDqF2M=3D?= X-Forefront-PRVS: 03449D5DD1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO1PR04MB555; 23:nkLxklwv1mcXs2YFywcBq3azS961YK5Ohp5riG9gQk?= =?us-ascii?Q?aoOtA973i+TRmRyvSgzVYOzzZelYDX7AuM/Y82r5bmspgKsV8QG7ojrx0ebY?= =?us-ascii?Q?vLHrIsqGMRFc1lHLEOqhQfrfJUgO581qRG0S4ErKl/G+EYkKVytE54PvpOao?= =?us-ascii?Q?wq/NJ+wmiHWUgKlqJ5upjHECth2nM1NTc35tCjpuI7kClywby5CGjpobEHDa?= =?us-ascii?Q?IcMUftVATcGUSgnju9dliViYDyuSsM47mSafCla5CyTk+cSJ+nL/SKlQzRwB?= =?us-ascii?Q?Wt13zuNPGn5iOQWNQj1Rq7f6veBfHLI0ODSVkZlo10hI0ljIJU5xdnGrJzLJ?= =?us-ascii?Q?r+hEOqOZ6M5O0bTxKHaLVhMH4joSM/2CBS2o28eJFwyOzl/ATIyaNHAywNAL?= =?us-ascii?Q?uJra5VUMlUTWc25SLKlXBiA4DRpa0lThmCDqADDv8dk1lT6uFhvP0zyqKh6O?= =?us-ascii?Q?L2U9UwjVTyFnlCN9+IBwYrxlRzxt/r5cqgzKn2DeGti/zE99f7vL0Xq8d/SE?= =?us-ascii?Q?GlLCpjiylL9rUoXZsxIBrY9WPbeIg7qR8TI3kecOXKUb6UUCj0VgeqffamO5?= =?us-ascii?Q?EZOwOHg24NHa1FJPpZUHpt1Z+nMLySr/g2MdHkH0yNExh8Kq1fAqOuOAqM4L?= =?us-ascii?Q?Om3XFFDON9H1Xz18/niNt8L1V0Yg0y1OCP2JoBMlubUGS7pOYR7AR4lwnl8F?= =?us-ascii?Q?q/qUFcgTSg9/uDsDb6sgwYtZrHcC++ANQKWsmUokl3Ivq4PWAZGarOPhcNkA?= =?us-ascii?Q?JNgq97HCUDKDMDstiaIJEXCcJvlbTFnKbwFUszGdqEDTnvoiHhTkVBMG7eJC?= =?us-ascii?Q?eBwfSWwd20N/tD0HcYbOcYz/g6bV6CQIaDMH9ixbi/PWzdRG8bcQZRdlNpi9?= =?us-ascii?Q?Ji3DoVPuWn+8Ry8IuTW7mjjAW4tHlIyzY637x8c1buFGw4XoydsRJhpvGDa+?= =?us-ascii?Q?U5ipel7jpVwEr11YE/O54EXT670XCGecHnyrNBkws9mSe4hEZ5ned0BgLuKy?= =?us-ascii?Q?04FusDFicR11XH2jB7ULs8/RBcoF8uxeXC3IOq2JEvsOfi223byNzYvdKPRl?= =?us-ascii?Q?qm7gX9GxdrihVPpcZh7R1R9oIPUBB3MBLy//HgI4xHzcru//kXULGjmF0BYZ?= =?us-ascii?Q?5CKcHGNFMUZMUk3mDguZilzNOpt5oDfTyLELvYTe2oYfiRzYSHKL5a3BTc6e?= =?us-ascii?Q?GJ8q17xu9jjCI=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO1PR04MB555; 6:AGvWUzlxIpcJ3IWom9Ad2EjlVv36a8I+5P/ZAp+4GxO?= =?us-ascii?Q?okfJgJX3HWwmue3ZtEuJgH0mYTkiotiRN+sh3rrZ0Wag0ZRgva0Cg09HJQnp?= =?us-ascii?Q?95XfZSmOGeEIa2fzFdJZbaUm6+pffIXO3lYBLruuDKtPPm38mB5mqfECes3C?= =?us-ascii?Q?fWZSYtT4tW2EcG1nrTzqR5jhr8Dpc4NhdnroG5x7bbKdZopj3i1LVxTOBULA?= =?us-ascii?Q?2kSfznYVt6AU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quEzHCUvx06Qpgt5edK/6btBOcbWtSuKU5OhdoG/rHCRwTlwYMUwJDw0+51qnRgU0JLADjhg2I+n0/A2lIdvGcDTRWYYhIcvohLqO22g1mQcdkp3BBwBAvN5bi4i4TqnLWYM7eOYacoNLO0210iD17WsmK9DwLuWa+ipOr/tbboUevFJyeBe9s28Dj9BCsEq4VPk15R5+rg6vd5xlauqyDSoARleQXyeOvdrv5cwPoGXmDYxH+dMiUSht5hKukzRRj9hutIsY22hSF0Y7HEhEI8NZyujsGk4xwWxAPw23a5sVIprmf7ALvjIxv9Ev7PJ+XsIcJE3OXxgwUvMXyGwM0mWJTh1No+RSLEcWEqB4Pszs= X-Microsoft-Exchange-Diagnostics: 1; CO1PR04MB555; 20:K4Q0/fKiaVtkeI+To4CuEy31n2+3sADO+knqun85nzfSZER1vqZ5qtwMTBmf/+P/A4zXkZi749gCYMya/G3x8HlagNfbVkftXkmqcN7uifwmbFIJekPSNs/pHwv/jQKGGh07g4xAnuPfQFky+z5l+m5bBZx2xGEgkkEpwJPo30Q= X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2017 18:15:58.9181 (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: CO1PR04MB555 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 From: Bart Van Assche Instead of explicitly calling scsi_req_init() after blk_get_request(), call that function from inside blk_get_request(). Add an .initialize_rq_fn() callback function to the block drivers that need it. Merge the IDE .init_rq_fn() function into .initialize_rq_fn() because it is too small to keep it as a separate function. Keep the scsi_req_init() call in ide_prep_sense() because it follows a blk_rq_init() call. References: commit 82ed4db499b8 ("block: split scsi_request out of struct request") Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Omar Sandoval Cc: Nicholas Bellinger Reviewed-by: Hannes Reinecke --- block/bsg.c | 1 - block/scsi_ioctl.c | 3 --- drivers/block/pktcdvd.c | 1 - drivers/cdrom/cdrom.c | 1 - drivers/ide/ide-atapi.c | 1 - drivers/ide/ide-cd.c | 1 - drivers/ide/ide-cd_ioctl.c | 1 - drivers/ide/ide-devsets.c | 1 - drivers/ide/ide-disk.c | 1 - drivers/ide/ide-ioctls.c | 2 -- drivers/ide/ide-park.c | 2 -- drivers/ide/ide-pm.c | 2 -- drivers/ide/ide-probe.c | 6 +++--- drivers/ide/ide-tape.c | 1 - drivers/ide/ide-taskfile.c | 1 - drivers/scsi/osd/osd_initiator.c | 2 -- drivers/scsi/osst.c | 1 - drivers/scsi/scsi_error.c | 1 - drivers/scsi/scsi_lib.c | 15 ++++++++++++++- drivers/scsi/scsi_transport_sas.c | 2 ++ drivers/scsi/sg.c | 2 -- drivers/scsi/st.c | 1 - drivers/target/target_core_pscsi.c | 2 -- fs/nfsd/blocklayout.c | 1 - include/scsi/scsi_cmnd.h | 1 + 25 files changed, 20 insertions(+), 33 deletions(-) diff --git a/block/bsg.c b/block/bsg.c index 59d02dd31b0c..37663b664666 100644 --- a/block/bsg.c +++ b/block/bsg.c @@ -236,7 +236,6 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm) rq = blk_get_request(q, op, GFP_KERNEL); if (IS_ERR(rq)) return rq; - scsi_req_init(rq); ret = blk_fill_sgv4_hdr_rq(q, rq, hdr, bd, has_write_perm); if (ret) diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index 4a294a5f7fab..f96c51f5df40 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c @@ -326,7 +326,6 @@ static int sg_io(struct request_queue *q, struct gendisk *bd_disk, if (IS_ERR(rq)) return PTR_ERR(rq); req = scsi_req(rq); - scsi_req_init(rq); if (hdr->cmd_len > BLK_MAX_CDB) { req->cmd = kzalloc(hdr->cmd_len, GFP_KERNEL); @@ -456,7 +455,6 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode, goto error_free_buffer; } req = scsi_req(rq); - scsi_req_init(rq); cmdlen = COMMAND_SIZE(opcode); @@ -542,7 +540,6 @@ static int __blk_send_generic(struct request_queue *q, struct gendisk *bd_disk, rq = blk_get_request(q, REQ_OP_SCSI_OUT, __GFP_RECLAIM); if (IS_ERR(rq)) return PTR_ERR(rq); - scsi_req_init(rq); rq->timeout = BLK_DEFAULT_SG_TIMEOUT; scsi_req(rq)->cmd[0] = cmd; scsi_req(rq)->cmd[4] = data; diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 26c04baae967..8ef703ccc4b6 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -708,7 +708,6 @@ static int pkt_generic_packet(struct pktcdvd_device *pd, struct packet_command * REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, __GFP_RECLAIM); if (IS_ERR(rq)) return PTR_ERR(rq); - scsi_req_init(rq); if (cgc->buflen) { ret = blk_rq_map_kern(q, rq, cgc->buffer, cgc->buflen, diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index ff19cfc587f0..e36d160c458f 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -2201,7 +2201,6 @@ static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf, break; } req = scsi_req(rq); - scsi_req_init(rq); ret = blk_rq_map_user(q, rq, NULL, ubuf, len, GFP_KERNEL); if (ret) { diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index d7a49dcfa85e..37f61acf5a35 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c @@ -93,7 +93,6 @@ int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk, int error; rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, __GFP_RECLAIM); - scsi_req_init(rq); ide_req(rq)->type = ATA_PRIV_MISC; rq->special = (char *)pc; diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index d55e44ed82b5..81e18f9628d0 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -438,7 +438,6 @@ int ide_cd_queue_pc(ide_drive_t *drive, const unsigned char *cmd, rq = blk_get_request(drive->queue, write ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN, __GFP_RECLAIM); - scsi_req_init(rq); memcpy(scsi_req(rq)->cmd, cmd, BLK_MAX_CDB); ide_req(rq)->type = ATA_PRIV_PC; rq->rq_flags |= rq_flags; diff --git a/drivers/ide/ide-cd_ioctl.c b/drivers/ide/ide-cd_ioctl.c index 55cd736c39c6..9d26c9737e21 100644 --- a/drivers/ide/ide-cd_ioctl.c +++ b/drivers/ide/ide-cd_ioctl.c @@ -304,7 +304,6 @@ int ide_cdrom_reset(struct cdrom_device_info *cdi) int ret; rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, __GFP_RECLAIM); - scsi_req_init(rq); ide_req(rq)->type = ATA_PRIV_MISC; rq->rq_flags = RQF_QUIET; blk_execute_rq(drive->queue, cd->disk, rq, 0); diff --git a/drivers/ide/ide-devsets.c b/drivers/ide/ide-devsets.c index 9b69c32ee560..ef7c8c43a380 100644 --- a/drivers/ide/ide-devsets.c +++ b/drivers/ide/ide-devsets.c @@ -166,7 +166,6 @@ int ide_devset_execute(ide_drive_t *drive, const struct ide_devset *setting, return setting->set(drive, arg); rq = blk_get_request(q, REQ_OP_DRV_IN, __GFP_RECLAIM); - scsi_req_init(rq); ide_req(rq)->type = ATA_PRIV_MISC; scsi_req(rq)->cmd_len = 5; scsi_req(rq)->cmd[0] = REQ_DEVSET_EXEC; diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 7c06237f3479..241983da5fc4 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -478,7 +478,6 @@ static int set_multcount(ide_drive_t *drive, int arg) return -EBUSY; rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, __GFP_RECLAIM); - scsi_req_init(rq); ide_req(rq)->type = ATA_PRIV_TASKFILE; drive->mult_req = arg; diff --git a/drivers/ide/ide-ioctls.c b/drivers/ide/ide-ioctls.c index 8c0d17297a7a..3661abb16a5f 100644 --- a/drivers/ide/ide-ioctls.c +++ b/drivers/ide/ide-ioctls.c @@ -126,7 +126,6 @@ static int ide_cmd_ioctl(ide_drive_t *drive, unsigned long arg) struct request *rq; rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, __GFP_RECLAIM); - scsi_req_init(rq); ide_req(rq)->type = ATA_PRIV_TASKFILE; blk_execute_rq(drive->queue, NULL, rq, 0); err = scsi_req(rq)->result ? -EIO : 0; @@ -224,7 +223,6 @@ static int generic_drive_reset(ide_drive_t *drive) int ret = 0; rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, __GFP_RECLAIM); - scsi_req_init(rq); ide_req(rq)->type = ATA_PRIV_MISC; scsi_req(rq)->cmd_len = 1; scsi_req(rq)->cmd[0] = REQ_DRIVE_RESET; diff --git a/drivers/ide/ide-park.c b/drivers/ide/ide-park.c index 94e3107f59b9..1f264d5d3f3f 100644 --- a/drivers/ide/ide-park.c +++ b/drivers/ide/ide-park.c @@ -32,7 +32,6 @@ static void issue_park_cmd(ide_drive_t *drive, unsigned long timeout) spin_unlock_irq(&hwif->lock); rq = blk_get_request(q, REQ_OP_DRV_IN, __GFP_RECLAIM); - scsi_req_init(rq); scsi_req(rq)->cmd[0] = REQ_PARK_HEADS; scsi_req(rq)->cmd_len = 1; ide_req(rq)->type = ATA_PRIV_MISC; @@ -48,7 +47,6 @@ static void issue_park_cmd(ide_drive_t *drive, unsigned long timeout) * timeout has expired, so power management will be reenabled. */ rq = blk_get_request(q, REQ_OP_DRV_IN, GFP_NOWAIT); - scsi_req_init(rq); if (IS_ERR(rq)) goto out; diff --git a/drivers/ide/ide-pm.c b/drivers/ide/ide-pm.c index 08b54bb3b705..544f02d673ca 100644 --- a/drivers/ide/ide-pm.c +++ b/drivers/ide/ide-pm.c @@ -19,7 +19,6 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg) memset(&rqpm, 0, sizeof(rqpm)); rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, __GFP_RECLAIM); - scsi_req_init(rq); ide_req(rq)->type = ATA_PRIV_PM_SUSPEND; rq->special = &rqpm; rqpm.pm_step = IDE_PM_START_SUSPEND; @@ -91,7 +90,6 @@ int generic_ide_resume(struct device *dev) memset(&rqpm, 0, sizeof(rqpm)); rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, __GFP_RECLAIM); - scsi_req_init(rq); ide_req(rq)->type = ATA_PRIV_PM_RESUME; rq->rq_flags |= RQF_PREEMPT; rq->special = &rqpm; diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index b3f85250dea9..c60e5ffc9231 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -741,12 +741,12 @@ static void ide_port_tune_devices(ide_hwif_t *hwif) } } -static int ide_init_rq(struct request_queue *q, struct request *rq, gfp_t gfp) +static void ide_initialize_rq(struct request *rq) { struct ide_request *req = blk_mq_rq_to_pdu(rq); + scsi_req_init(rq); req->sreq.sense = req->sense; - return 0; } /* @@ -771,7 +771,7 @@ static int ide_init_queue(ide_drive_t *drive) return 1; q->request_fn = do_ide_request; - q->init_rq_fn = ide_init_rq; + q->initialize_rq_fn = ide_initialize_rq; q->cmd_size = sizeof(struct ide_request); queue_flag_set_unlocked(QUEUE_FLAG_SCSI_PASSTHROUGH, q); if (blk_init_allocated_queue(q) < 0) { diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 4d062c568777..fd57e8ccc47a 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c @@ -855,7 +855,6 @@ static int idetape_queue_rw_tail(ide_drive_t *drive, int cmd, int size) BUG_ON(size < 0 || size % tape->blk_size); rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, __GFP_RECLAIM); - scsi_req_init(rq); ide_req(rq)->type = ATA_PRIV_MISC; scsi_req(rq)->cmd[13] = cmd; rq->rq_disk = tape->disk; diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index ab1a32cdcb0a..4efe4c6e956c 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c @@ -433,7 +433,6 @@ int ide_raw_taskfile(ide_drive_t *drive, struct ide_cmd *cmd, u8 *buf, rq = blk_get_request(drive->queue, (cmd->tf_flags & IDE_TFLAG_WRITE) ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN, __GFP_RECLAIM); - scsi_req_init(rq); ide_req(rq)->type = ATA_PRIV_TASKFILE; /* diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c index 1e69a43b279d..ca45bf6d2bdb 100644 --- a/drivers/scsi/osd/osd_initiator.c +++ b/drivers/scsi/osd/osd_initiator.c @@ -1574,7 +1574,6 @@ static struct request *_make_request(struct request_queue *q, bool has_write, flags); if (IS_ERR(req)) return req; - scsi_req_init(req); for_each_bio(bio) { struct bio *bounce_bio = bio; @@ -1619,7 +1618,6 @@ static int _init_blk_request(struct osd_request *or, ret = PTR_ERR(req); goto out; } - scsi_req_init(req); or->in.req = or->request->next_rq = req; } } else if (has_in) diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c index d54689c9216e..929ee7e88120 100644 --- a/drivers/scsi/osst.c +++ b/drivers/scsi/osst.c @@ -373,7 +373,6 @@ static int osst_execute(struct osst_request *SRpnt, const unsigned char *cmd, return DRIVER_ERROR << 24; rq = scsi_req(req); - scsi_req_init(req); req->rq_flags |= RQF_QUIET; SRpnt->bio = NULL; diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 44904f41924c..304a7158540f 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1903,7 +1903,6 @@ static void scsi_eh_lock_door(struct scsi_device *sdev) if (IS_ERR(req)) return; rq = scsi_req(req); - scsi_req_init(req); rq->cmd[0] = ALLOW_MEDIUM_REMOVAL; rq->cmd[1] = 0; diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index fb18ed284e55..301a7f706c9a 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -250,7 +250,6 @@ int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, if (IS_ERR(req)) return ret; rq = scsi_req(req); - scsi_req_init(req); if (bufflen && blk_rq_map_kern(sdev->request_queue, req, buffer, bufflen, __GFP_RECLAIM)) @@ -1117,6 +1116,18 @@ int scsi_init_io(struct scsi_cmnd *cmd) } EXPORT_SYMBOL(scsi_init_io); +/** + * scsi_initialize_rq - initialize struct scsi_cmnd.req + * + * Called from inside blk_get_request(). + */ +void scsi_initialize_rq(struct request *rq) +{ + scsi_req_init(rq); +} +EXPORT_SYMBOL(scsi_initialize_rq); + +/* Called after a request has been started. */ void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd) { void *buf = cmd->sense_buffer; @@ -2124,6 +2135,7 @@ struct request_queue *scsi_alloc_queue(struct scsi_device *sdev) q->request_fn = scsi_request_fn; q->init_rq_fn = scsi_init_rq; q->exit_rq_fn = scsi_exit_rq; + q->initialize_rq_fn = scsi_initialize_rq; if (blk_init_allocated_queue(q) < 0) { blk_cleanup_queue(q); @@ -2148,6 +2160,7 @@ static const struct blk_mq_ops scsi_mq_ops = { #endif .init_request = scsi_init_request, .exit_request = scsi_exit_request, + .initialize_rq_fn = scsi_initialize_rq, .map_queues = scsi_map_queues, }; diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c index cc970c811bcb..a190c052cd93 100644 --- a/drivers/scsi/scsi_transport_sas.c +++ b/drivers/scsi/scsi_transport_sas.c @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -230,6 +231,7 @@ static int sas_bsg_initialize(struct Scsi_Host *shost, struct sas_rphy *rphy) q = blk_alloc_queue(GFP_KERNEL); if (!q) return -ENOMEM; + q->initialize_rq_fn = scsi_initialize_rq; q->cmd_size = sizeof(struct scsi_request); if (rphy) { diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index f3387c6089c5..21225d62b0c1 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -1732,8 +1732,6 @@ sg_start_req(Sg_request *srp, unsigned char *cmd) } req = scsi_req(rq); - scsi_req_init(rq); - if (hp->cmd_len > BLK_MAX_CDB) req->cmd = long_cmdp; memcpy(req->cmd, cmd, hp->cmd_len); diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 6b1c4ac54e66..8e5013d9cad4 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -549,7 +549,6 @@ static int st_scsi_execute(struct st_request *SRpnt, const unsigned char *cmd, if (IS_ERR(req)) return DRIVER_ERROR << 24; rq = scsi_req(req); - scsi_req_init(req); req->rq_flags |= RQF_QUIET; mdata->null_mapped = 1; diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index 323ab47645d0..ceec0211e84e 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -992,8 +992,6 @@ pscsi_execute_cmd(struct se_cmd *cmd) goto fail; } - scsi_req_init(req); - if (sgl) { ret = pscsi_map_sg(cmd, sgl, sgl_nents, req); if (ret) diff --git a/fs/nfsd/blocklayout.c b/fs/nfsd/blocklayout.c index 47ed19c53f2e..c862c2489df0 100644 --- a/fs/nfsd/blocklayout.c +++ b/fs/nfsd/blocklayout.c @@ -232,7 +232,6 @@ static int nfsd4_scsi_identify_device(struct block_device *bdev, goto out_free_buf; } req = scsi_req(rq); - scsi_req_init(rq); error = blk_rq_map_kern(q, rq, buf, bufflen, GFP_KERNEL); if (error) diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index b379f93a2c48..da9bf2bcdf1a 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -166,6 +166,7 @@ extern void *scsi_kmap_atomic_sg(struct scatterlist *sg, int sg_count, extern void scsi_kunmap_atomic_sg(void *virt); extern int scsi_init_io(struct scsi_cmnd *cmd); +extern void scsi_initialize_rq(struct request *rq); extern int scsi_dma_map(struct scsi_cmnd *cmd); extern void scsi_dma_unmap(struct scsi_cmnd *cmd);