From patchwork Thu May 25 18:43:16 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: 9748913 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 2D10360209 for ; Thu, 25 May 2017 18:43:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23E852679B for ; Thu, 25 May 2017 18:43:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 18A4E2836D; Thu, 25 May 2017 18:43:47 +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 8DE022679B for ; Thu, 25 May 2017 18:43:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1036491AbdEYSnq (ORCPT ); Thu, 25 May 2017 14:43:46 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:13770 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1036476AbdEYSnh (ORCPT ); Thu, 25 May 2017 14:43:37 -0400 X-IronPort-AV: E=Sophos;i="5.38,393,1491235200"; d="scan'208";a="20374630" 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; 26 May 2017 02:43:35 +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=tLQxIFxsR/D39sq2mrWEOJAia6Qfv+W2IfD6OxLSHUw=; b=hF8oi6w673Gb7oUSUUPOUS0Gv3nk3XMWPECExTZax9TsN+8ekINDsDjqzs40ZD4fJCp9kHSrokzRfeInXkLLSOn/e4G4iSaG88SxJG1uMp2YckKihcSazggJVb8KCLEaEEiuz38bWGHwm2m/+oXSon3UVvkFMdshZyvmbrKo79M= Received: from MWHPR04CA0080.namprd04.prod.outlook.com (10.174.173.21) by DM5PR04MB0507.namprd04.prod.outlook.com (10.173.170.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Thu, 25 May 2017 18:43:33 +0000 Received: from CO1NAM04FT046.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4d::208) by MWHPR04CA0080.outlook.office365.com (2603:10b6:301:3a::21) 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, 25 May 2017 18:43:32 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; kernel.dk; dkim=none (message not signed) header.d=none;kernel.dk; 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 CO1NAM04FT046.mail.protection.outlook.com (10.152.91.117) 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, 25 May 2017 18:43:32 +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 E5.BC.45291.3D527295; Thu, 25 May 2017 11:43:31 -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, 25 May 2017 11:43:27 -0700 X-AuditID: 0ac94369-166ac9800001b0eb-13-592725d36466 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 7B.E8.11415.FC527295; Thu, 25 May 2017 11:43:27 -0700 (PDT) From: Bart Van Assche To: Jens Axboe CC: , Christoph Hellwig , "Bart Van Assche" , Jens Axboe , Omar Sandoval Subject: [PATCH 08/19] block: Introduce request_queue.initialize_rq_fn() Date: Thu, 25 May 2017 11:43:16 -0700 Message-ID: <20170525184327.23570-9-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170525184327.23570-1-bart.vanassche@sandisk.com> References: <20170525184327.23570-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRmVeSWpSXmKPExsXCddJ5ke5lVfVIg9YjAhb/9xxjs1h9t5/N YuXqo0wWe29pWxy+d5XFgdVjYvM7do/LZ0s9dt9sYPP4vEkugCWKyyYlNSezLLVI3y6BK6Ph 8xrmgp8CFR+2f2RsYJzM18XIySEhYCLxfGEDUxcjF4eQwFImiXXfO9lAEkIC2xgl/v7x6mLk ACu6818MomYzo8TxJXeYQWrYBIwkvr2fyQJiiwgoSPT8XskGUsQssI5R4vze00BT2TmEBTwk 7paAlLAIqEo82LKOEcTmFbCXmPt6CzvEDfISZ7fsBBvJKeAg8WXqRTaQtUJANSduOIJMlBDo Y5U4++ExG0SvoMTJmU/A1jILSEgcfPGCGeJkdYmTS+YzTWAUmoWkbBaSsgWMTKsYxXIzc4pz 01MLDE31ihPzUjKLs/WS83M3MUJCO3MH490n3ocYBTgYlXh4OR6qRQqxJpYVV+YeYpTgYFYS 4VVWVI8U4k1JrKxKLcqPLyrNSS0+xCjNwaIkzntOZmqEkEB6YklqdmpqQWoRTJaJg1OqgdHt 9LKuCfN6Xp+coMO0y17m/BvthPCTmzm5y7MkHGUNDDwDSkw25+uyvjqrsmsXZ9YV1fjES/G9 t1exPl5z45RfZvjvZVWOt87WTGPKn2f6PkHiwhE+V9G0uxeZt5+ZuI71yY+JpxV5LRR/9fB8 s2PT072bwyb7NZ3pkPpFq6BcRu1jjEcrrimxFGckGmoxFxUnAgC+C40CaQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGJMWRmVeSWpSXmKPExsXCtZEjRfe8qnqkwaedZhb/9xxjs1h9t5/N 4uDPNkaLlauPMlnsvaVtcfjeVRYHNo+Jze/YPS6fLfXYfbOBzWPamvNMHp83yQWwRnHZpKTm ZJalFunbJXBlNHxew1zwU6Diw/aPjA2Mk/m6GDk4JARMJO78F+ti5OIQEtjIKLFq0lOWLkZO DjYBI4lv72eC2SICChI9v1eygRQxC2xglNiwdClrFyM7h7CAh8TdEpASFgFViQdb1jGC2LwC 9hLNC06D2RIC8hJnt+xkBrE5BRwkvky9yAayVgio5sQNxwmM3AsYGVYxiuVm5hTnpmcWGBrq FSfmpWQWZ+sl5+duYgSHBGfkDsanE80PMTJxcEo1MO5tvhBnyHJeSfaJctIrz32Cc6fc9lno ry3mVsEnwRTRuiHq6c8vF9U2SC6e3qrK73z68lumiDlmNezPPvj9vRzpVxeupcqxv9pnmUyU R+VcFpng0Ov5/ku2RKiK7pKyv/xHvbzZffK1o+xi6a7fF/w6aWO7hPWL4q6s9SnyUedmiMyf c5yvSYmlOCPRUIu5qDgRAK1wNEC5AQAA MIME-Version: 1.0 X-EOPAttributedMessage: 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)(39860400002)(39400400002)(39850400002)(39840400002)(39450400003)(39410400002)(2980300002)(438002)(199003)(189002)(9170700003)(110136004)(8676002)(38730400002)(8936002)(81166006)(86362001)(72206003)(54906002)(575784001)(53936002)(478600001)(5660300001)(1076002)(50226002)(77096006)(189998001)(5003940100001)(305945005)(6666003)(4326008)(76176999)(50986999)(47776003)(33646002)(36756003)(356003)(2950100002)(48376002)(6916009)(50466002)(2906002)(106466001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR04MB0507; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM04FT046; 1:q2TXthiTq0wXx7YB/3n9E7EQZPGqWDXOb1GQsCTrQVU04su4uoVjmJK5KmwAcccKJxC2eUA00lN/vGnIkOglvmzZr9ZzGUGnftSOpf5/jF1n4ROeFQba4dnGcKZoamuixcuMRCz60YN90/v40U/83koWMal9kdqTvK0EdDlTnqEugfHT3W4Hqzes8Pl/xbmgOiRfjqGc9h951hRN3wUR/VF5JUEdWwgVyw1dnANuZlfvMRvv60u6FP0yas0zK3kw54vIL/4jSoeP1PQxK3CC5OFV3nnpdznFvMWLc15YcWhspNvJ83Ehzm/LyfVtGk1OJK5AOws4HU2z74vpXFgVZpi9SbUJ2OjWGiaMyfRSquU1v4KUWU2aFIqyoj/VOkOrpbjSvOSsRLdFqWB9mZ2m9obKN/9eHnXdbQhzZ7qGhQxw3R3feykXARqAcVhAHDRBDf4yLUnF/gMFolFAvgxV2FAX0QATkSCLgd98437kW0XEvezekx9+cRAuWFHmj1wW X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR04MB0507: X-MS-Office365-Filtering-Correlation-Id: 8908fd4a-9117-4335-1160-08d4a39df1cd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:DM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DEnVWtMc1Fe3bsU77s=; 31:ZiQdkXUSfs7p5/E1Bn/fHuZqENu62VFOICKxgtK4xdAdbpXMu03lFVQig+IxS+IC3SVCgEMSga+uz/mJM4PoQ5ZlEkeMMMmJTJ3ywZv4Sw8cw6TbzDs36ceWoSou3Iq6lphUFOpbSdp26xjOC6tUPFyQ4V2/Fm6Y6PJigJSE1PnK1pO57t8Sqyus5IRmsJqPDZk3zehE2wOFdiF0bpaATwvG05JVKidekCxvl/spZRQ5OORD41pi024LWKVSu6ipdLppXEQFCnMd7l6LaYw4KlehBFvoCN3RYSfpTfZWO/M= WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0507; 20:/gw73fmpz2m/M+koOcxJI6Y3kLQbtMkDNbs6O22AqpR4m135b33d94h2QsJ3Ggf78cXAhwpQL+v8WXWVOBgcwvGha6ZM7cOChCrDW5O8chBostqu+Vr2SSXerfPCCwGrNx7tIWmv9Mnf7inTnT9HHSbpMVHLBtSvHA/+r+kFhcPxGfa5R/qlF93Q4rvXlvxjG2QeU32nLCiTh1lifjN6tKeeCxmI0P8UuxJgOvdX+4dNwYEV/3Z3ERnXgJRcXKTgRkb0FDd6UJj8vODtuRw+LaBjWLUXVO986/NEuU8y5FhVwOxoeDDPlkXkmMU1aUivQNYYHexk8EzH8auWNKZwd1FcRCu+LdqZOyt4mZP3gQjUwv0C3l6NQuwv4wymr8+ftUxcpj1mxJTEh5LxmJiqhVOw471Iv7BrWBHIBL0I6rgjOzPghSuWg0OykPv4VVV104Oj8bS/cjV01Cs/B3EZWXAn+7wVEry5xkSerB7ngZcWTsihhCE7EBjL13Va5DO/ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(67672495146484)(42932892334569)(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700054)(100105000095)(100000701054)(100105300095)(100000702054)(100105100095)(6040450)(601004)(2401047)(13016025)(5005006)(8121501046)(13018025)(3002001)(93006095)(93004095)(100000703054)(100105400095)(10201501046)(6055026)(6041248)(20161123564025)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123558100)(6072148)(100000704054)(100105200095)(100000705054)(100105500095); SRVR:DM5PR04MB0507; BCL:0; PCL:0; RULEID:(100000800054)(100110000095)(100000801054)(100110300095)(100000802054)(100110100095)(100000803054)(100110400095)(100000804054)(100110200095); SRVR:DM5PR04MB0507; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR04MB0507; 4:lwxkTq5PrksPhnmgzfetdKt6AYt4MJ0AHH7Ei5JrPA?= =?us-ascii?Q?kGVn3iDkX3KdxUGLCoDsUHJfU8IWDQj9nF0EQv/uYgSMfm5BwjB99/zOJKVC?= =?us-ascii?Q?or5QsbLIl0tN5O1uDQuoNM1+5p6zRxo57pTWrdKaJr6Yc7aQuvrYPNiYE5cz?= =?us-ascii?Q?EVZcqenuisub09xX/beXjBAM9fZ2azoF7csyezHLG01DfmFNeCmjqV3vnwR/?= =?us-ascii?Q?FdjxSR7M/nPSu3fpUsqAfmaEWF2zT+jeU5Q05N/DrD9983wCzoRwnzWGqMg0?= =?us-ascii?Q?Gzr9k4LoXxY86fITUfb3ziEC29XOUi8tUh5OOs+Jtk7hXuqlCZn4sIbGaIgH?= =?us-ascii?Q?jJ0ztds6/X7EPCRKCcdJYF7IGB3DPB4gtso1JkqyfI8LkYiVrK1Wk9BhOm9q?= =?us-ascii?Q?fDxkg+hPfqEGTN70H1sl24SEkJs1ErryYCJrbay7qT7hi5pqffx+ohYliMsZ?= =?us-ascii?Q?BQQIhA5YRbIovZwK1HqUoTN/20LT1/ie/3SfPLk7/mLX0O39eKmioPwHfbe3?= =?us-ascii?Q?qlCMrm9hjHBnBAPDQlK+RSQl8WzZ9CXDuLX/M++VuIx1B67PMf/IRFJ6QH9C?= =?us-ascii?Q?hgAS1ZS70rssRKyzUXkUlu56yQGmrEQH/TwVn+Gk8jU59j2BMPavOfNvaO9B?= =?us-ascii?Q?64ordpsyYUoruoo5wzZtimPD8C2EX8+WZwgirF72LYdFdhjRvdqts4vSNBt2?= =?us-ascii?Q?FtGZBbv0EtwZIw7TL5/3BERSf64tkhg3ZdwrfQJH7dpZP+5uOgjO2DBvl9/F?= =?us-ascii?Q?BG+uSh5WoKxy9fK7wrOUTCRkO9zqpZY+T7nsDh+5LXqbBTqakNMwx8/dCQXU?= =?us-ascii?Q?3eNxtcuYpdUXfgJa5TejFySIYrmIc3BltPpiu11WnNYStUa5x80jJkMTrQbW?= =?us-ascii?Q?oYyM7m8fIG4tl9DBNav39pWNEx4pc4wlyFHf0gud/+Q3fMqcu09+LlPTRBHe?= =?us-ascii?Q?bFPIBZ8OoBCV0aUTLxOwQEVHNDPAJ2KuEazYSrUiYtnduwYXdr0+RBpJGG+U?= =?us-ascii?Q?U0baCAqr8W+umhBPNwKKGYWCGfClLqSw9k2smx6+b/gN84nGzHmxtP3GnZbM?= =?us-ascii?Q?xUyRnctNtZBNB1TIz9Q/1vaDrY0PLNILUflDr8UBSNJnjyO7iSL85k+9Oq+Q?= =?us-ascii?Q?gdVY8JHIAa5snH0d6zpouZzb83YYcd+EwCfOrHAcCQIhoaVQExZmlm9GoYnu?= =?us-ascii?Q?bUpaJg4je1BAk+rQt1ydbGwe5pLbqmVrL8C6P+bAx3DM0faHAu7P4EfzLB/M?= =?us-ascii?Q?IvbEroJSgY1imnfwBvzKhlTxMRH9GSKIngXFB/IEkorxx0SRHTHgeVA1SD8G?= =?us-ascii?Q?aZDF7bigZplu/+UV6djU5/fKi2HkzHaJdGEoUmeKlUAVKbgiOVUMa/fPyhhx?= =?us-ascii?Q?HeOg=3D=3D?= X-Forefront-PRVS: 0318501FAE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR04MB0507; 23:Revv0BFgRXukc7vAdBnVFSOFsdJFfYiR+RIBK8XVS?= =?us-ascii?Q?MI8H/gAZkwlNIQu/g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m2L41Pulo5RXn1U+X5hjMPadi8Omg8ZZkezQCj8/C0szn5z64tOjAjVTKnewM1MLLaM/90St+9VjJXCAdARifDEX6ULACDpU/6Kh9P12KOwJduACCxhL8l8E2548kNgp3aDtZh+H9CbaUyoLD9ChXYJEOAa9k0A7oTWfcDHO11QrHE7/bwCgtbdj9wGoRehMsCJev9GjEwyFA5LcwJz9a3nxsU96HZ74de+KH6Sai8WrFupFDYCCh8yQa/UgmKo79OOE3Esy3r4B9A8OER8cQ4w==; 24:uAcy4RHXVB7dSltC2vb/e13VPLMB/WLYNrA/DTfjn1Iw2sAipPHbOlqh58gn13pLBvgPLb9cn4ATE6e/ss2Lg/hjCrTzwWu6OKbwFZ42zKo=; 7:RacmNu88jlodnwnSDP1e24IDsClUD5eMjE22LYMbJ0NWrNyA3WjnKm/c1Y31YTPhvL7MrbQISA8uSwPGWAg/y0KFELtQ6YUqUAxZ/3Lf5LgHR+ZiyDqzmhCAOYOJW0rG2L3nDdFS0vKJQI44bieuWbnX96guIlUYFkk6sH/MTXoZhG5G16QFdNf1ohcEPAdZUC4kSOC6zcTS4D/qnuRTRWQztZuTTCYfrZBmgBVxUR1Ny8w782Xll8mthA+MA1vJGXFNbHA5fRe1LpOqwOl/zknpyUOPuJZLJlvgyqAWOHwYOLodEUyByYnHKjMqo5Sc1kSBKND+7ro1F4F4I76qkA== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR04MB0507; 20:0WiVe+P5nW9FnxIeggqOQo3QxOqqik03dbFzHR3CvBjdaT7g7/SmNB1M6+RfwQ/YMS5wJ9/7Gh7g+sTApRzBD/CEuQ0lgvq9M6t3XIMBB8EZEPmck3Naq5VxVDZVYFPkiuqsaVc3Y9IhQ/+bxiNehh4Dmlb3TSDU7ThkiRExNzU= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 May 2017 18:43:32.4742 (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: DM5PR04MB0507 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 Several block drivers need to initialize the driver-private 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 a new callback function to struct request_queue. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke Cc: Jens Axboe Cc: Christoph Hellwig Cc: Omar Sandoval Cc: linux-block@vger.kernel.org --- block/blk-core.c | 3 +++ block/blk-mq.c | 3 +++ include/linux/blkdev.h | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/block/blk-core.c b/block/blk-core.c index 9416f6f495d4..fa453ed95973 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -126,6 +126,9 @@ void blk_rq_init(struct request_queue *q, struct request *rq) rq->start_time = jiffies; set_start_time_ns(rq); rq->part = NULL; + + if (q->initialize_rq_fn) + q->initialize_rq_fn(rq); } EXPORT_SYMBOL(blk_rq_init); diff --git a/block/blk-mq.c b/block/blk-mq.c index 9ae1d9ccf4df..a1620b36b95c 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -241,6 +241,9 @@ void blk_mq_rq_ctx_init(struct request_queue *q, struct blk_mq_ctx *ctx, rq->end_io_data = NULL; rq->next_rq = NULL; + if (q->initialize_rq_fn) + q->initialize_rq_fn(rq); + ctx->rq_dispatched[op_is_sync(op)]++; } EXPORT_SYMBOL_GPL(blk_mq_rq_ctx_init); diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 94fd2600584d..8a223a0c95d5 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;