From patchwork Mon Jun 19 22:07:52 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: 9797957 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 1D1BF603F5 for ; Mon, 19 Jun 2017 22:09:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05DBF26B41 for ; Mon, 19 Jun 2017 22:09:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEBF1274D0; Mon, 19 Jun 2017 22:09:13 +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 54BA126C9B for ; Mon, 19 Jun 2017 22:09:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752711AbdFSWJF (ORCPT ); Mon, 19 Jun 2017 18:09:05 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:18717 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752175AbdFSWIS (ORCPT ); Mon, 19 Jun 2017 18:08:18 -0400 X-IronPort-AV: E=Sophos;i="5.39,363,1493654400"; d="scan'208";a="26617568" Received: from mail-sn1nam02lp0023.outbound.protection.outlook.com (HELO NAM02-SN1-obe.outbound.protection.outlook.com) ([216.32.180.23]) by ob1.hgst.iphmx.com with ESMTP; 20 Jun 2017 06:08:17 +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=783DkooGpMN3lhPXGPvCuMpRvK1GSoiUHG9iUx5W4/g=; b=En4mghKJfg1D8dFE8OpmbhHWs+6iqAbjGE9cINuCx1bUdPMTaBfHbP8vKQyHXUlfgu87pmwvK33B+StUpHtQrUw0CUOzqSywa2Dz1iSIO0HPNqc+aigx0M3DFSB+tvSyGvZiAPp1xW9F4E/ckUMQUai8cm/mkbfBv9FIwydVyZ0= Received: from MWHPR04CA0042.namprd04.prod.outlook.com (2603:10b6:300:ee::28) by DM2PR04MB541.namprd04.prod.outlook.com (2a01:111:e400:2430::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Mon, 19 Jun 2017 22:08:15 +0000 Received: from BN3NAM04FT033.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4e::201) by MWHPR04CA0042.outlook.office365.com (2603:10b6:300:ee::28) 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; Mon, 19 Jun 2017 22:08:14 +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 BN3NAM04FT033.mail.protection.outlook.com (10.152.92.165) 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; Mon, 19 Jun 2017 22:08:13 +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 22.03.02805.C4B48495; Mon, 19 Jun 2017 15:08:12 -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; Mon, 19 Jun 2017 15:08:09 -0700 X-AuditID: 0ac94369-9c18398000000af5-2b-59484b4ca7f2 Received: from exp-402881.sandisk.com.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id F5.4D.11415.84B48495; Mon, 19 Jun 2017 15:08:08 -0700 (PDT) From: Bart Van Assche To: Jens Axboe CC: , Christoph Hellwig , "Bart Van Assche" , Bart Van Assche , Hannes Reinecke , Omar Sandoval Subject: [PATCH v4 03/12] block: Introduce request_queue.initialize_rq_fn() Date: Mon, 19 Jun 2017 15:07:52 -0700 Message-ID: <20170619220801.12557-4-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170619220801.12557-1-bart.vanassche@wdc.com> References: <20170619220801.12557-1-bart.vanassche@wdc.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPLMWRmVeSWpSXmKPExsXCddJ5ka6Pt0ekwfMTRhar7/azWSx4s5fN YuXqo0wWe29pWxy+d5XFgdVjYvM7do/LZ0s9dt9sYPNYv+Uqi8fnTXIBrFFcNimpOZllqUX6 dglcGet//2Mp2CZaMek6TwPjK8EuRk4OCQETiVvzJ7F0MXJxCAksZZL4sLAFytnBKNF+YCkr TNWNmdMZIRIrGSWWPtzGApJgE9CTODVvHxOILSKgINHzeyUbSBGzwCNGiS+P+hhBEsIC3hIL 108Hs1kEVCVWTz4FZvMKWEtc+76TEWKDvMS0d71g2zgFbCS+T4aICwHVfH4/AWyzhMAiVom9 j+cwQzQLSpyc+QTsCmYBCYmDL14wQzQoS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filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39450400003)(39860400002)(39850400002)(39840400002)(39400400002)(39410400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(9170700003)(6916009)(189998001)(2950100002)(72206003)(76176999)(50986999)(105606002)(305945005)(1076002)(53936002)(106466001)(6666003)(110136004)(478600001)(38730400002)(86362001)(575784001)(36756003)(50466002)(77096006)(356003)(81166006)(2906002)(8936002)(54906002)(50226002)(8676002)(5003940100001)(4326008)(85426001)(5660300001)(33646002)(47776003); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR04MB541; H:milsmgep15.sandisk.com; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3NAM04FT033; 1:M32XdE/78iAh7/20Ag0W13FjYSxOrlmWcQE7hsMqUE2vlYUqKC7U9BnCxvTP6txdQp6I4UEKvw/ZC/naWFhT0U42Z4WruGxr6jZZxYv+MVsEx7N4/vyrHMPOvjYP5tlT9A1O8EX4joywgj+DfEObfsjm9dgdf3TBU5kGIA1vj9Y5PL8y1/fkzQxsJlJjmXV5ADVRGVFKzIMFT1fDcpnJcflRZGkhkZWRybQEZT4FE2dwZb2Jv+iDonZkc5gxw3dVHeUtGT8/OM3mQC/XhX5tEJHn0xpIWpupSEFazulSsnMXKnNETXZByFf0Y/F3EEBz6X4UsjEvb4hd2ci/WLZ3AipZJKcr3imdxfTJ9Xdl8xd6hgBc2RBr3EjG8bnk5h29l87Ibm427/d+eumw6/hzy9D3auj6tcTik2k7Resy6pCz9hLk7dYw9mGeBin0hMy8IxupY3sJIFilDa1tFEcjuwOnKOeJ1z7Fjtn6fcNDg1EWhy24HXP4bBh0Oga2AQ2hEMyWuUKBqRXAkWyD35you+dyyf79tbk0DovrFtqQUe0DPPDXo0gemjODwxwNmEAn X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM2PR04MB541: X-MS-Office365-Filtering-Correlation-Id: 98279dc3-9625-45cb-a334-08d4b75fae8b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:DM2PR04MB541; X-Microsoft-Exchange-Diagnostics: 1; DM2PR04MB541; 3:sQVvkESvaTcoSI1HRvV1u5mAmL2JJfplWeeDv+EiuZjNyebzl6nhFvhPXqVz3Trbn5kykU85wpErhPgXD/Nu7izISVwX1FTFJYde0Z5/+0quwI3WfJJIG2xVkanBjq4Zs01LumA+trQIUOXmtRfyk+yNvvEEQxrQWnsZmSHJR5qXj2Nj4uE604ZkxOwNt14XnTp4FKRJ9nLfceLOufiPjZZcoekrzhszFcLd7Tb6Xw+B78pckXYhWEIHU09OdlFJHnFTi0Di5LdegYTlx5aJkgfl/OHPVQAQCCCKUuU4hIBJbrwxJKFdK9SQTq8DNAlxCJqBg7mgE9GSHYi9m7QwS2Dy7jIdvMHRnKlo4YcwS1IFM8RaoGEbCDnyhWdO9Fnl7/7ex9gZuiATiqOLLvCizN0mHI+coQNF9JfaZZWjULyRRPlAks5HlHinQ1HJmSqDLMlW2CT7QUTHcUBqNd7gmg== X-Microsoft-Exchange-Diagnostics: 1; DM2PR04MB541; 25:D8rCCcN8cCkgp7xoReomtFezagflwtuu5GZwnwOlmJX0YMdIO3M+6U0kTaEP6LsxLzdrQWf4xLvCRtg/0AXK50aaUhGu5UVwYL1rR5Po5hPywy24z6VbSLOPp2p2IFFsPj5raBwq/Bzo1bso9W3wqp+kJvMTx5P9pM4l2YCF3SsdvdQIr36X6sQB1q3SVL1Exm1ceDfmKueZmtRGAu8iWwBOCqVlRYlzJ7BJNnJ+FxgEXFGeu6gugUjHWNV3HmWHXvGyhZKwy8qr26WtILSSnbRBHvbtLKccvFe2B3j8UaQi1WKxGjI0xUUNMnu/ZEk/m0QWVRtxNwekVzF3UfO3ZGFmp0rtYv8TmhruY3WvBAsnhkM8xRs2DkEL36z250VrYqb90CtKZqLO0i0OVMSPPMdouGBGNGqG/Oac+y0wlL2tZ9rMNg4wYhOuBgb8a63rqKncD9c+E53YEfvR89JXSDx4hNiIVarMioc9bTFq9BU=; 31:35pfVjaW2xMaMZFVXjIx7i/ZtiAJ7J+dgqA45Srzt7rvESPrdrLb7kzh5Aw0Z/xIe/WGDT/1q5n2a4O3Bcx0vXw/Yn+oZ8fcS90VN1d21Y3YxiaJenAAVqwy46xauq8xaQuDfCF/dzBWFuNU0FdZG+IQ1+RkBbEYcNdTFs11qM0zchqWS7vHGs09j5+p+LiPSTz+z7D3HUHN9Ntwc4N4vxT3wcWPLL944kieUG/ZcYm2xmwAPvtlUnV6Q0hM9A7A+1hwqfQbo2xVOoQJKsX6JQ== WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; DM2PR04MB541; 20:a1siE07vUFq1d8rOWrTyYLv0pnLjfiJPvkFdXRRezjQnTDhm4le2CnCXxucv5/15kUglny/YpfGxo8rNHJnfwroYf2z2k57UZUrTwcmQKd6NeW2QrnwvjFWOQZ1gYYN3GQcOXDEzuqRmJ8Ny4dikkC5Z5wPwuGOhrRgXoNE4znaTZKg2svzGyRW2GGt3yONskVjM5IZHdM756AAaNbZZdIxm1xbNkEGgY6jbWXVU1jsJT7kmZk2NgqYfZMSmlQiUu09h2EOPJux2LiojI+OxTic4P9UDtHdsWNVzfznTGt40po95btwlhg3EGMu/Bg/Wx02r1+XpJCtem725GdVQvBS4cFbWmOucvW9CVSRBlN4YHiR2gTg+ifJ76gf5sz8bWz30pvVgHP6hS3AclpZirr12++8/ZNxrMX5oPq8yYDpaxsqBDI9vxT5OBnMMz60WxS1h/1xOJOC+r2FvcHvkwUtDb1WVr9vxTWQkPzQLuivjwb7zxKAud0zJkpr2G6FZ 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)(93006095)(93003095)(3002001)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123560025)(20161123562025)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM2PR04MB541; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM2PR04MB541; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR04MB541; 4:BbcZqv65AUfHh7+ne3NV573M6UbiXO0nWmwsgRscxqy?= =?us-ascii?Q?HpAyfscqbooPtnS/eo3QhQiI/avzvAODF1WnosYQKz0L8dxBM6OqBPTS+mxp?= =?us-ascii?Q?TYoGqqcKRBU6DiOn09mYjictDy25aP5eNJjwfj4+aVsSepApKu9zbixhFisi?= =?us-ascii?Q?dKfVKKSTsT6A64QcIRrXc2XPzXQX7jcRRi578PuRcyqU3mz0ABKOWB7lD9TR?= =?us-ascii?Q?0ET4Cc4lkY1CIKvJPhNI9vjR6bB0vCAguHXgaujusO0X25R2Tl8YtYL0wTLa?= =?us-ascii?Q?FJqT3Q6nNOr4sQfu1Q3sPaiz3dr72gFkisDow0orDCY9g7dX/oFvyKP3H++Q?= =?us-ascii?Q?z2ZJUKzFl54KdvgkLU3uwv7P1U/IBeoHPgsNiHzal70VGWPanuYPbxOy3NCv?= =?us-ascii?Q?6ishcKu+tkBj28yR97+3VryO3pJ0wVkXY3Zh1fX9tMqiP5HUCA/cUJ24D6lp?= =?us-ascii?Q?6YORE8lBz3iczQebGTSJlG2yMv9s92XFTRoYLzgL42u97PvMJ9g1TCZ3q3Or?= =?us-ascii?Q?8m3LE9mlswfbqE9wRtdEO+rv7cF/Ch22cNbpN7uQUsi36w6szZtYjTa+wWBd?= =?us-ascii?Q?uUZLgGF6x45mIaS2PfKNxgR9yNWY6bejiNsy9rXU67gbW57PSELcU9AARVNM?= =?us-ascii?Q?jGoyKdXnfBLdLTITGX0GuaiOQvmve3AS/QFpxZ2sgBCfYYvBpRnnQgEwP+nL?= =?us-ascii?Q?muwUX5BeJjyAfzhyTWqRTFsOT/r847UaoYPbzXEb8ZJgbMV6OXHxeS/Jik9W?= =?us-ascii?Q?fd+Ia0V95+WdTu2mFE4f+yIvu+VFSfXkpTxrTDhd9EYFBRJNLORT6oRp744f?= =?us-ascii?Q?2/NDSzVQzz9HSx7ez8YXsds6SvjJKszLrNdJ5shb3VdqHdAfSsn1vo1iHYfa?= =?us-ascii?Q?8y8toVftF4kBgkyw5f6momNBUf04okxPRPvpEcNozVU5GdRIagaN4K7RUzbC?= =?us-ascii?Q?Ek3/2S5LtbCArTfnAwn/mH8TotatICvXKZOPV+wAejRXE9atq0RRwQXRgMYw?= =?us-ascii?Q?jPD1zxwhUoTV7jj+WrsA3/0OJg79d/GhVM3PPDBl3Dha9P8P5VFCb7nddW8L?= =?us-ascii?Q?yPIss1gzF8839JFdYmW5y3ZuyP0Cvby7/r+gvP4QQgZcs/8E7EQ6GbzqKd0W?= =?us-ascii?Q?PEhce0fQZOsdXELlyEzDz+gLLDI+ryEFAHCpxFPaxjVwlojRFsutCxpGIcv6?= =?us-ascii?Q?E99kbMmrmDqX3HHRyA7JjfgazY0au8WsROm0dKLYsY2uI6eAG2rvSF2gKePI?= =?us-ascii?Q?woJPGdTGa+SUoJf3EiYufTsq1TasZT3VTuu6NXH2BXENdiYjHGtMwolC2u7y?= =?us-ascii?Q?WtT9KcN8PjYLkkWrXRyo=3D?= X-Forefront-PRVS: 0343AC1D30 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR04MB541; 23:tq76xge1gmdHmIJIwfh8WZSEZ+J45LIBfQ6gXvQYcE?= =?us-ascii?Q?v2PE3CJskWKw7VJ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K?= =?us-ascii?Q?LvpCaV6PjAh+IHWOLL6sEh1gGj6Yb5PjQhAEBptzxBQJ6WJftOeKw/q7WUaB?= =?us-ascii?Q?YpdFhNktRAUamJWhggYOkA3St6DczClsQAfXcD5j4EVOSrWAdAtyKZHpReQ+?= =?us-ascii?Q?+MiMdu78eKsH0EqJW0UT/sEkyAazapQ69IP5bb7wAz1edbtxCRrGKOB7Xy53?= =?us-ascii?Q?sYOEZQ0YfgSMr2t3LUNdb56bQt1mcqV5m4oUCeiZmIBnwP9inVlNV73uiO6m?= =?us-ascii?Q?y/P7mlLyMvIcA=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR04MB541; 6:KOHTaBv5yaHaInAevOhrWhefQxBa1niepNNm6QDNDRy?= =?us-ascii?Q?cUndxKNK2J8Bs280MbmBM2Ov3k83SzS6jn3maCghzurADdBKHhcSyUD44Uui?= =?us-ascii?Q?VIo/odxbyS86JKlJM/w1O0+K/Yy8IVpzr8Ti2wgiXSrBk3y3rWwHNT+XwXAC?= =?us-ascii?Q?Z6Uf6fahkWGDd/4HQpAF81F4MkJmK6KQBiuIUoOcXJe5L2z34PRcxSJBc+t2?= =?us-ascii?Q?ewhXIsHV9xlOQkKZU6oUWScsohr1H1/W4Q1WAKQKw3V0lrHViaRriwvl/zKr?= =?us-ascii?Q?d95bfAOpt9HLqz8ZQg1B/sXbI5GTLJ6ksJZZbzwwXebZcKQKNq8gWp4a5Ave?= =?us-ascii?Q?Al9t/4OVfTCNHbinrU7pLVr8aobIDHkKpGlmVc+QX0tv4IYUhenzIMLPdID/?= =?us-ascii?Q?E5FvD9UqupyTSeBeMSBCBa1FuuSlHSiL8S7FwPmal0w6f1fmGkKH5SwGoJge?= =?us-ascii?Q?MKRjONa92/KRUvfrf4PU9rAjX7TKKs5XM2k2r6WEHxSz3x1RpQas/eWNhlyi?= =?us-ascii?Q?ruJoG3gGqOPTvyiPSwfM6S1LFDyMnZvO7iqLQrcRC452rY3qn/zXS5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or+u0NpYuWntfWBMH0oq2eQz2/R4/uwSes64; 24:VzHG8dRyJygombUDDrr+ad+7W0iYkuD5kGZdgHGoQvy9G/fsbt8cWYevABDnzY7/yFt47okOXqHKqEviXttD8gdzDrrpHcru2R0WN6P9uxg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR04MB541; 7:DiMyhckZxOyVf4FRHDqx8OK107iJtE1uYc2tWzhlN5cIdU0wqaDXQKbD+skoyyji7n9xOkA7Bz0GUEayfI3FesNQyYNLDsqvHLKEIzWN4mL0j20ZA2DeO09ELB5Ad65rOpMxI24Rxw7QdB9VtE2LBIu6os36OCPkLGmobzbdq/vNY+4VzNpjmOnSrl1EDmA0M4gx9hObt6UXTahx2x9RDKUPrv33EE5H6XHrjkRtLBlShs5MIVpLN7Ste03NCGadQ8nerxV0/6uiIC0/QMFbQhPWxgBnZk3OnTXRHrD6fcD7rlu1oOe66PMHGawNhq8Db3z2HAFrbrjXw3ZSHb1oupAiiCqXZ1xuVQ38bbKqIgmjbsdq/R5Z/AJSTN8KbE8pDuT6I/QTwdaWidUz6QwyzpzbFkIDm/1L08BdamrK97/cyqtRQ9KN1tZJXwXArdRBkpbddIt2GrGucrPKsPQwIqTqv8fyDX4ywuuEf5uoBexpBpi6quwL90wyeOk1LfBWOxAmtVm0MTMNIi3TPBU1EdBhFs+0Z98nbs3crf2Wh7lycnjvswxJvxAHdvquIueMaqC1n1GiT8cxmKMCnWfI0bwHeb6MsW4FDOiXDLYlmVGtAybakiKuJMW1bL/fd+UwRs/881lvSmee5T/0LCOpyYZOhPAsckaLoxiTSpzzOaWpcnJFAa8iT+jEx2t8f0OIZjVmpSKQJ5RVSGzuh1V2RxfawHqTQUo7yzohOrVqxctfvkc6C4FzR8WBzBsjNUKtAz1256AkYa6oXX/N3Nj8NbyU/hHxTr1eXfyBTD/JBUY= X-Microsoft-Exchange-Diagnostics: 1; DM2PR04MB541; 20:BvfAbi3gEVfHWJ4rytb5Diq6I/3mZVOZv8bZkSDM/vXWQUoPhDFzC4GW2r+nsyD18LQtUY/bbQdPH03arVuo60yKWZhtcBRiX53KpClFjKxDg1aeXOe4ux+HK95myu2ohg+4qgZa2DAkDTz54DjCAx/hlseZL9nZw3iepuW/S0Y= X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2017 22:08:13.9245 (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: DM2PR04MB541 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 Several block drivers need to initialize the driver-private request data after having called blk_get_request() and before .prep_rq_fn() is called, e.g. when submitting a REQ_OP_SCSI_* request. Avoid that that initialization code has to be repeated after every blk_get_request() call by adding new callback functions to struct request_queue and to struct blk_mq_ops. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Omar Sandoval Reviewed-by: Hannes Reinecke --- block/blk-core.c | 17 +++++++++++++++-- include/linux/blk-mq.h | 2 ++ include/linux/blkdev.h | 4 ++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 93edf22009fe..0c08cf3559c9 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1366,12 +1366,25 @@ static struct request *blk_old_get_request(struct request_queue *q, struct request *blk_get_request(struct request_queue *q, unsigned int op, gfp_t gfp_mask) { + struct request *req; + if (q->mq_ops) - return blk_mq_alloc_request(q, op, + req = blk_mq_alloc_request(q, op, (gfp_mask & __GFP_DIRECT_RECLAIM) ? 0 : BLK_MQ_REQ_NOWAIT); else - return blk_old_get_request(q, op, gfp_mask); + req = blk_old_get_request(q, op, gfp_mask); + + if (IS_ERR(req)) + goto out; + + if (q->mq_ops && q->mq_ops->initialize_rq_fn) + q->mq_ops->initialize_rq_fn(req); + else if (!q->mq_ops && q->initialize_rq_fn) + q->initialize_rq_fn(req); + +out: + return req; } EXPORT_SYMBOL(blk_get_request); diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 698015526ca7..23d32ff0b462 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -144,6 +144,8 @@ struct blk_mq_ops { init_request_fn *init_request; exit_request_fn *exit_request; reinit_request_fn *reinit_request; + /* Called from inside blk_get_request() */ + void (*initialize_rq_fn)(struct request *rq); map_queues_fn *map_queues; diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index c2844c27ef65..ff0ae83235ea 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -410,8 +410,12 @@ struct request_queue { rq_timed_out_fn *rq_timed_out_fn; dma_drain_needed_fn *dma_drain_needed; lld_busy_fn *lld_busy_fn; + /* Called just after a request is allocated */ init_rq_fn *init_rq_fn; + /* Called just before a request is freed */ exit_rq_fn *exit_rq_fn; + /* Called from inside blk_get_request() */ + void (*initialize_rq_fn)(struct request *rq); const struct blk_mq_ops *mq_ops;