From patchwork Tue Jun 20 18:15:40 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: 9800055 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 7EB9C60328 for ; Tue, 20 Jun 2017 18:16:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83170212BE for ; Tue, 20 Jun 2017 18:16:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7797D269A3; Tue, 20 Jun 2017 18:16:07 +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 8F08B212BE for ; Tue, 20 Jun 2017 18:16:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751546AbdFTSQF (ORCPT ); Tue, 20 Jun 2017 14:16:05 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:65097 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751088AbdFTSQC (ORCPT ); Tue, 20 Jun 2017 14:16:02 -0400 X-IronPort-AV: E=Sophos;i="5.39,364,1493654400"; d="scan'208";a="28426656" Received: from mail-bl2nam02lp0080.outbound.protection.outlook.com (HELO NAM02-BL2-obe.outbound.protection.outlook.com) ([207.46.163.80]) by ob1.hgst.iphmx.com with ESMTP; 21 Jun 2017 02:16:01 +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=2QZHcK/Q+/V62JurFw0gEaor3hjMmaiV7AUtps1gqis=; b=FlE4UieVfWvDvuz1t66C9V9EWEkMSid6jRDx+BG2lPaaEQkv71ucLoaVHImD+FCBiIYbgaiwu0UWdlT7XxHbEe92qpe5mlBzoQc5mkqX9BVEovu2yeyVm2IegwQn3CTMMnfm5EtYdNhpUG1oA5u7tqumAY2VK3ScgsIPo2BEZJs= Received: from BN3PR04CA0029.namprd04.prod.outlook.com (10.166.70.167) by BLUPR04MB547.namprd04.prod.outlook.com (10.141.29.145) 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:58 +0000 Received: from SN1NAM04FT021.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4c::204) by BN3PR04CA0029.outlook.office365.com (2a01:111:e400:7a4f::39) 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:58 +0000 Authentication-Results: spf=fail (sender IP is 63.163.107.225) smtp.mailfrom=wdc.com; suse.com; dkim=none (message not signed) header.d=none;suse.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.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by SN1NAM04FT021.mail.protection.outlook.com (10.152.88.149) 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:57 +0000 Received: from MILHUBIP04.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 D3.50.03809.C5669495; Tue, 20 Jun 2017 11:15:56 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.9.6) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Tue, 20 Jun 2017 11:15:13 -0700 X-AuditID: 0ac94371-10e5898000000ee1-52-5949665ca4ac Received: from exp-402881.sandisk.com.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 61.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 Subject: [PATCH v5 03/12] block: Introduce request_queue.initialize_rq_fn() Date: Tue, 20 Jun 2017 11:15:40 -0700 Message-ID: <20170620181549.24903-4-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+NgFnrALMWRmVeSWpSXmKPExsXCddJ5kW5Mmmekwc/TMhar7/azWSx4s5fN YuXqo0wWe29pWxy+d5XFgdVjYvM7do/LZ0s9dt9sYPNYv+Uqi8fnTXIBrFFcNimpOZllqUX6 dglcGQ+637EVbBCtWLbqK3sD41PBLkZODgkBE4lpbQvYuhi5OIQEljJJ3D35gB3C2cYoMeXl PyaYqhPfzzJCJJYzSnzafoIdJMEmoCdxat4+sCIRAQWJnt8rwUYxCzxilPjyqI8RJCEs4C1x 8vFZZhCbRUBV4kjzSTCbV8BaYu2qZVAb5CWmvetlBbE5BWwk3i85zQJiCwHVfP1+H2yohMAi VonVRx4wQTQLSpyc+QSsiFlAQuLgixfMEA3KEufXPmGbwCg0C0nZLCRlCxiZVjGK5WbmFOem pxYYmugVJ+alZBZn6yXn525ihIR74Q7G17e9DzEKcDAq8fBGKHtGCrEmlhVX5h5ilOBgVhLh lYsDCvGmJFZWpRblxxeV5qQWH2KU5mBREufNkp0aISSQnliSmp2aWpBaBJNl4uCUamCcevC7 ZIOovLPTthUnT1iem963XnwC26Pqki/BLdkH/5TOZkiovvWzqGZDStSrpS51s5z/HLzb675z /e+737b6TC/43qyVx8bG4TGpX3v6Ssu4C3zXNF9fubXe7tTPltgAttK0WUtKkjc4z/gS4N55 v/3z/1LGzQmsLKdn6s3UebUs7+iHWVOFlFiKMxINtZiLihMBBXFAwHMCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJJMWRmVeSWpSXmKPExsXCtZGTTTcizTPSoPmKjsXqu/1sFgd/tjFa XPrzhdFiwZu9bBYrVx9lsth7S9vi8L2rLA7sHhOb37F7XD5b6rH7ZgObx7Q155k81m+5yuLx eZOcR/uBbqYA9igum5TUnMyy1CJ9uwSujAfd79gKNohWLFv1lb2B8algFyMnh4SAicSJ72cZ uxi5OIQEljJKbHu8jh0kwSagJ3Fq3j4mEFtEQEGi5/dKNpAiZoFHjBJd83vAioQFvCVOPj7L DGKzCKhKHGk+CWbzClhLrHtyjxFig7zEtHe9rCA2p4CNxPslp1lAbCGgmq/f77NNYORewMiw ilEsNzOnODc9s8DQUK84MS8lszhbLzk/dxMjJHAidzA+nWh+iJGJg1OqgXGmk7jfrGerwxUi 2Jeklade00h1fZTdcXvOhlLdUvvdd183x8x++GqGce3CtHOPxB5f2xltONcrQYX7ntqh13PO 7bq7YlHnnF0f1srlTA/dl3h/V8raVf+4E+RP613Z3bZyxw+r+tzFTy3dvmeEOokVtaxSVLAU fLUgKl7V/9sO0czuOwtV5xxSYinOSDTUYi4qTgQAvVqxZcwBAAA= MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39400400002)(39410400002)(39850400002)(39450400003)(39860400002)(39840400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(9170700003)(53936002)(2950100002)(5003940100001)(6666003)(110136004)(4326008)(38730400002)(6916009)(2906002)(33646002)(106466001)(72206003)(1076002)(478600001)(77096006)(54906002)(356003)(36756003)(50986999)(81166006)(189998001)(47776003)(50226002)(50466002)(305945005)(8676002)(76176999)(85426001)(575784001)(8936002)(86362001)(105606002)(5660300001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR04MB547; H:milsmgep14.sandisk.com; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM04FT021; 1:YAp6y1oQmR1YEtYKozGt6Ip7Ofn0UOmdnSMB2rLqEbNjR5ycU4juiI7H/ALrCT5lK/gGs4EIJimUb5FcPYbmteyzLjGMSH2UoKQA/7A+/grLjNLdHtD/e6ESuCNgH2zAU8nc8rIZXEE6xHaBqmAHYC31wdSEkOOT2vcSly3YZnB2Xbd0I92JOkdbClmjLXJeAsyFyQZ5a/OLOnqUIULL2t8n9hKBAia6gWqD4CyVtWpsW+C8TpMQ96RFTHk85io8WxKOtYwq6vnFG31VksdH8Pvezz3Z1V3JeYs0zhescAMGgXOe5vQ2wPJLHK4j8znzXFqsfPKThJVUPePnGd6A9qMNyYKwYJB/ajPKsjgPONwT91LLY2kRTYp4A6QcpVijp2fMSd3/WdD9liX9zo/RP/ShY7NLXGOqEgV+tRucM3kOwxQUpXcEYPcLEU8OgpTBx5WD34U9gb5C7u8HZJ07QO78X9ZK3XRdjnhDQNK7EWAjHGPpMPaS+t9i3r5eeRGHPbPZ0v/O6mVUL1yq6y7ouHOtdiUXK9rw5juAeSqDxcaaNC2gfTxddQ3vdJXg+R5boDiUw8j1irAHsOLU+DL4dxgmouXlYIhWb3K8QUC1H76AP/NOgqVliUPOpsKHAzWqb+IeNfFzMQetEz+8xSpuvZmwlBWzixWOwdDhugP83FD+LPp2nWlNkUVmoEcKICgpPh/c40xsseZSmXZXbQ229w3UcJcs6Nbj2U1zVxSJOsIT6+SDfAJiw+wT36zy43V70bmQolzvsnp5wUQ333EgXdgbGphuo39KpcaRMu4pSB03BFt0H1lVJWuWTZkrzjEiONZ+CiOBonyNzSgGLGWWbVo8vFN1DXvHd36RaAKGT1LLobhA0V904WshVUlhzjn5kZ4mHAvzDDj6Cp9F8zvBCozi4cuGDLZVBvZ0QEsiRG k= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 460cd4b3-4b0f-4871-e79c-08d4b80865f4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081)(201702281549075); SRVR:BLUPR04MB547; X-Microsoft-Exchange-Diagnostics: 1; BLUPR04MB547; 3:u5jB9JUpnS93meocYDMJkFHVq4Altu7p2+9ul5Bjc6v8rh+IVOVwrjITflVLxMtvKpy2YQAw1HLpQEJX6WcHZVNqnxD43vTZBhRoEswZx+LDaBVx+fUCV7Wx7tGqT7faQmn1CWaf+Ku9maWnVRNFMuzVQwRNbLaIkbXBUcuQBRUFYgPandUnNTSjS3u6+ybt+Lhg8delNLibIy5YH5OJUb5t/Fml7gjAel/N6yZe/MY1+j/KMy+ii8iIyF3z/ZWzkpiKAIW6XyTtEvbWQc8V6VuI8XEBnAlI9bIPbcYWEbQCodGHHrUIPGTRI5y/6nG+kqYVdoZVdHhW5GGWEpKHryZlUYSe+ITbZZreFsvOdwDcdkvReJenZkKIt+You796JrjS/ghTLnfy7MUhFl5HE8y0LQva+ZJukE6XY0RbSCCgNCH1D28+D6XYgQ3dGNir9ogCJYjT1E1jjKmoCKjLC1TC+sdbYEQZ+MN6KR9XbWrim2oW25MiOH05Jv18eEKr X-MS-TrafficTypeDiagnostic: BLUPR04MB547: X-Microsoft-Exchange-Diagnostics: 1; BLUPR04MB547; 25:iBe4AC3IgtCP6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WS9RwYjIV2hInQLHMD2oGu6GqYRRubF/uLZnFdPE4+K6zskkpldeyH9+Gu0noyi7u4EeCUtsRAxzfdh7P4B25Cs1NbcvPpf9hoOtogFS5OyjzOR 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)(5005006)(13016025)(8121501046)(13018025)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93003095)(6055026)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(20161123555025)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR04MB547; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR04MB547; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR04MB547; 4:JqNLTpzDTYPDeKQr/O7ahzbMdnor+P44d8Rm8jXsSqJ?= =?us-ascii?Q?EdKOnfAPiS5JR5Oezq32XAxtquPTxMmkbWtECN+ZuAhsNep8s4xazjm3ZCAX?= =?us-ascii?Q?CxepZIXMC+ykdxyZMSEhWIEm1gOkl/ojQwaWWrXafdzAlTNGZScFf+5GAVdX?= =?us-ascii?Q?7U3QJ/ZkFiC9+u/1pV0FIXbGau0PL4GgZuQNtnuGchRJLZPtSrX83OrLvyVL?= =?us-ascii?Q?f/m32olyfxAA8kGHZMSN9gkxsLNLpjFNhFrsyM8ahm5SMtynhLpW8FqgzgPE?= =?us-ascii?Q?2zSRlTPGBR4+DpZtv15EvUGdum4fsN5RddBdawLZ6ZnhanKfeFSL4Bsd2oJ7?= =?us-ascii?Q?L1ZuljRYB+Q3ku0hA7DTlmFwc1zzBA4A6UM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r4eozIjIGUU?= =?us-ascii?Q?gRdtqqMgkjK17dILp3tXOCc5a7fZ12GL0Qiu0k8amTsl/4BUrZR1HmSmgw5Y?= =?us-ascii?Q?+0+x9p0wC1NQO5rM5V7TydKY4qznyLhhzhUkelOGdRQub6giGThFkKJHjgGO?= =?us-ascii?Q?WwC82jmXfyQ+pLyG64qf5vsR8BSXhvP9MfFZOf5APNnSjhr6WnvRahrHruxy?= =?us-ascii?Q?v9cI7yRCxvh1Jp/FJbhfuGeYouXp0Ugp4RTCk6cAhUbO0JuFckYVPAKUNGC2?= =?us-ascii?Q?krzcdSZK0hEIJUZ4mzChXE4qnLElNEUbR3pcSWRutzxBWSsjV/feNoq8qxKp?= =?us-ascii?Q?0Tru/fYiS+1F39xCfRvo4+a1HbPp2tSS4r2s4mjEsc1fn4/6chiQRgbRNw9Y?= =?us-ascii?Q?nUOSBgqgofOteJjWp3JEi4/nalMk5rzWR3XIP+hEeCON0eLcXQB5aAyz+Kgo?= =?us-ascii?Q?y40zhhEKZSe18=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR04MB547; 6:7kX9xycBzB3eN/dPchWff4eV+5MNPSLaFyFSk9dFQMX?= =?us-ascii?Q?6ctwhKDeSTMCGa2N0Imy43e7FDHLAjsvcZarIzx5S9oUbjnG17tSXOHU/Ahd?= =?us-ascii?Q?yLBfKgMZ3306sgzbv7XMiCHWgT8MNmb2jytF6yIzhBBrXOaUgcGCBAj1bzqz?= =?us-ascii?Q?Y2lr5hsb0ORajeO01z8hzhDpVdNX+EigX/lXwCZmB3k2D8h9GhpYO9eeBhJO?= =?us-ascii?Q?onLxz2vkLuhCBgaHyQBjvdCBFRcnjzt6PRYpQ+P+0lseAWs/JjADdstyWHrZ?= =?us-ascii?Q?NI3EEFwcEy9VsxA0dWiS1n/ABGD7nOjxcxuYW2Yhed338eTSxTJVqmnA0ecf?= =?us-ascii?Q?5OpkZaPnIABMz7/fTloHWEdurObcATe6y6GAiRTsspuWF2tRszwnlNSXuWRM?= =?us-ascii?Q?xApKUFRZKv+zNlRd6DlePX8mHyv4rZ00WozivRhS6wV3pQ6oTmjUauYJMbwh?= =?us-ascii?Q?Nu5D4Psw2Dkx5sMI1mOjegeTttu1MgFyD34ZBRoK22+Foa1P9Yah5CeVrObj?= =?us-ascii?Q?7QAU0SHnSjqliEI6dGt568F4huIgAOU9v0AvSytmerM367YWc8XcAAVuz8d7?= =?us-ascii?Q?ZHVgKMtr6eM46+ahQgKo2rZaJHCIOXfELr+HdkFmeDH1zPi1BbdAXZK+A5tn?= =?us-ascii?Q?nYOw8mJIVWyZYXQgi+65y+Ly0cDn2K+M8JbraSo1kkodLogXA48+SOXY+aqo?= =?us-ascii?Q?uuS2B38MtEciDLsaQwptSC9gEQsF594SxiuaJF8bqyhtSmUVW6Z6M6EfO5ky?= =?us-ascii?Q?L6ezSYW+Q1ahAnXdsW8NwZBANeVbJInMZjH+TCIBEnh0WRwltIOhboItgADr?= =?us-ascii?Q?mN/iRFlbvbIWAooi312F6fgBNbGJxEoqULqQrfee63oEiAWG01t+wdRWDmSo?= =?us-ascii?Q?Jyq0HH5YpeLgopS4f5PH6QqXkjvFqaffT5xyzaY44cRPiS9EcrV817boeaTy?= =?us-ascii?Q?k+zdLTa9c+rZq3EknUhJRsreGzgVTQNnmTELLyvzsRD55glQyZly0o59BnXG?= =?us-ascii?Q?ZRxGcffa2yTY1kNfnS4ek?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR04MB547; 5:gffIhmR08HmSSJEYahysJEyLSebtnFODkiMp6cVF9BYQk+AucVQbthbbd6ou/7xEcfvWzZ9rdradmFtEqTd9hYTrRgXNtzUL2IoW3+i7mL237t362zI9wBfkdf+8XDBpkXHISAFn2g+GN+nMpGMmLMnCes8nj0hHQ9NJnzH6CZ1oGWsmpnrmcM+sbEGeB61Io3qCQggO6Y/TrNGVnDiW6Yu/6CYJwk2w3lk3Wwq3GQipU0RD1iwd5LOMMxTo4kB52I89bpYjfoVH7L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ByHzIryCs8odItoOgfIG84G9D7KbRGxKZN4W7T9+LA8J51taTqeJzCiE06JI3snrSkPsjD5mrULnlv+HMetvWHY8jWGqwdXLFKEwdmMwjL3OVAosdHRgXv9NF+Wkk00sxuWF49LY89VXq7vduR+oe/LcpNJXSA= X-Microsoft-Exchange-Diagnostics: 1; BLUPR04MB547; 20:OyYOEbsEK5J03VabThgai2SPzFK59ht8erj7JDcaaawsaw3vJKl7Cyk2XATyGB//b1uD4TyTsKindaLIS8Wo3kyc6NwHBW3d72epK+sjrfuBzgZHvGvNtjGV5WG77mTPUmvRSJmhES7rON9FfdwUJdw3cpeyfwdBk1uec0MZzVc= X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2017 18:15:57.1192 (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.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR04MB547 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, 19 insertions(+), 4 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 21f6f1020303..09989028616f 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1372,12 +1372,21 @@ 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) { - if (q->mq_ops) - return blk_mq_alloc_request(q, op, + struct request *req; + + if (q->mq_ops) { + 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); + if (!IS_ERR(req) && q->mq_ops->initialize_rq_fn) + q->mq_ops->initialize_rq_fn(req); + } else { + req = blk_old_get_request(q, op, gfp_mask); + if (!IS_ERR(req) && q->initialize_rq_fn) + q->initialize_rq_fn(req); + } + + return req; } EXPORT_SYMBOL(blk_get_request); diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 3077714250ce..366b83cee955 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;