From patchwork Fri May 19 18:30:05 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: 9737919 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 607AD601C2 for ; Fri, 19 May 2017 18:31:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58A422856E for ; Fri, 19 May 2017 18:31:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D6C628573; Fri, 19 May 2017 18:31:55 +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=unavailable 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 357C02856F for ; Fri, 19 May 2017 18:31:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756162AbdESSae (ORCPT ); Fri, 19 May 2017 14:30:34 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:43736 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755871AbdESSa0 (ORCPT ); Fri, 19 May 2017 14:30:26 -0400 X-IronPort-AV: E=Sophos;i="5.38,365,1491235200"; d="scan'208";a="20047664" Received: from mail-by2nam03lp0048.outbound.protection.outlook.com (HELO NAM03-BY2-obe.outbound.protection.outlook.com) ([216.32.180.48]) by ob1.hgst.iphmx.com with ESMTP; 20 May 2017 02:30:24 +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=9WoHIay+u/BcH3ilzDkIS8tUpWTp9DG6C+LYrVIo2lI=; b=rzPsyUQoSu6yfWo2kJuYQAGci8AKGteUsrISzhbWvuKhPArlG8/AOSOG7rwSee8rKPsiQ1aMP5YA10aZt44xoQzyKEh5GOXv+JUSpoXh7Ib5AkOaSsUxevME3UN0WnwTnvDRs8GmRqdtsGXry4jkVm60JVeIKJ6/sxGlEuAxWC0= Received: from BN6PR04CA0006.namprd04.prod.outlook.com (10.172.194.16) by BN6PR04MB0355.namprd04.prod.outlook.com (10.173.198.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14; Fri, 19 May 2017 18:30:22 +0000 Received: from SN1NAM04FT031.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4c::200) by BN6PR04CA0006.outlook.office365.com (2603:10b6:404:cb::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14 via Frontend Transport; Fri, 19 May 2017 18:30:22 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; fb.com; dkim=none (message not signed) header.d=none;fb.com; 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 SN1NAM04FT031.mail.protection.outlook.com (10.152.88.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1075.5 via Frontend Transport; Fri, 19 May 2017 18:30:21 +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 38.5A.29323.DB93F195; Fri, 19 May 2017 11:30:21 -0700 (PDT) Received: from milsmgip12.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; Fri, 19 May 2017 11:30:19 -0700 X-AuditID: 0ac94369-548749800000728b-9d-591f39bdf584 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 3C.37.18148.AB93F195; Fri, 19 May 2017 11:30:18 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , James Bottomley CC: , Bart Van Assche , Jens Axboe , Christoph Hellwig , Omar Sandoval , Hannes Reinecke , Subject: [PATCH 07/18] block: Introduce request_queue.initialize_rq_fn() Date: Fri, 19 May 2017 11:30:05 -0700 Message-ID: <20170519183016.12646-8-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170519183016.12646-1-bart.vanassche@sandisk.com> References: <20170519183016.12646-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrELMWRmVeSWpSXmKPExsXCddJ5ke5eS/lIg5a9Mhb/9xxjs1jwZi+b xcrVR5ksNvZzWOy9pW3RfX0Hm8Xy4/+YLA7fu8riwOExsfkdu8e0SafYPHbfbGDz+Pj0FovH +i1XWTw+b5ILYIvisklJzcksSy3St0vgyuhffY2t4INAxc0Fh5kaGLv4uhg5OSQETCQOTJ7B 0sXIxSEksJRJ4mnDZ2YIZxujxMeWeaxdjBxgVVN6kyHimxkljqzfxQbSzSZgJPHt/UwWEFtE oFDi0rYORpAiZoH3jBKXLyxiBEkIC3hIrHzYzg5iswioSjxdcBXM5hWwl7h1pJsJ4gx5ibNb djKD2JwCDhIvjy9kB1ksBFRzv68eZKaEwCZWiRdr3jNB9Ap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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)(39450400003)(39410400002)(39400400002)(39850400002)(39860400002)(39840400002)(2980300002)(438002)(189002)(199003)(9170700003)(38730400002)(4326008)(5660300001)(77096006)(8676002)(54906002)(2950100002)(81166006)(47776003)(6666003)(478600001)(5003940100001)(2906002)(50986999)(76176999)(53936002)(106466001)(356003)(1076002)(72206003)(305945005)(33646002)(50466002)(8936002)(50226002)(48376002)(36756003)(189998001)(86362001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN6PR04MB0355; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM04FT031; 1:luoFsJcXg23s1fcJ9NdJVM7Yxnusinmaka1zEa0NVssGrN1p6C8UHnofs3So0vbbe+9t26fHJzFHGWy3vyo9LMsQKqh2m7CLEe3ql4+zRCIMOXcbeaiSoPwBT1k9x4aaWjozqolovqeqecw9jz8loVf+Rg3t/TZx4UnnyglK/U4WYL48zp9q2u+OdSgVhu3qA1jqgmWCa/BA1OrOEeNfENSv88ueUyUgLhBgq0ElB4hedoY6eYtrUh/S73wlj1sPdg3Ln/lllrCQpZZjEO9uumczORsMw8L+gfvWXYwOLW18b7PFXv2+jAsd2yFafMNHW3G8dc5zWKXuxsArHz07muUBCMJwpcHuZbgHLyDgti9GW5gGVwCXS3Q6N/xMJ1yB+rhrxaLjzbanKuX+5D92c6GuXklp3vvBxJYgeETUT6D4/azwp2QyiPXX3jxd3CI4l6Roe2vMQxJtb5Uz5mg6sdsjboPFZwIT23HYhbAJYGCEWv119Xq9PyXnZtN+C0nrJO5pb9MyJZagzCXCFWaXQr7x5yyIxtdAXtBZAmfBr8o= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN6PR04MB0355: X-MS-Office365-Filtering-Correlation-Id: be941fac-ee19-4433-d0ba-08d49ee51c57 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:BN6PR04MB0355; X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0355; 3:XATSWyV3hvimGeqF6Yx2znRpTmRvH4kZrVLXTAc/bPqZ8SY8tOeyp/KQsNwbN623jz3BBemWiIOQV7hdN4jOI3uo6jtp9naDQNTKQ5T8QTLxMtapo/XCi7aqzD7/+S6NzKFGjTX8S9q04oZH+Fqy3L+8NktegjEFYoTUg+g7WBNCEhpw4cqq9sbVDOy360HJRiky9AkAHDS4qIwiBpznK95jlPvDJL1FuUmjXhEfEax59MMhK68GyzGc3m4rjFgC+8pLTNi3sk/JCE+G6i8avun0I07LHE/pnnwVypEi+BfERjMBW80mY6+1qCh4N42WXLcC7gIhanZMPSRFQ1zDfdRVPgWq+ioxRr0+VF+jDL+tXIyokX+XT5SSZ41YvQa79bmN06sY6Z277OLEnPlDe6OFzdYg25LywF8qM7j1yZ8MO5CrEtiooQ6spgpJ1GwAH58B2371sBrMlCHtRfqGOXCpzT1oSNnaByWFQRpJtUXuX4Pg+uoVDuLgDoL8xPW3 X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0355; 25:NeyJFJQjKa34QLVREXz3t9mLTlQGR9euYDLOaNbYUFSEixx5u69olNWv8VswSsWjK9q1dFc2LP8ANyWZx4Ulzlf5ii0LYVu0jgqdboBHCuOPH09q4qnuOVodt6Wr+2SzzyJ/gLmZsvgbB2d+9rLqjYHAFWt+d6LQTun8xMNP++IE3bO7mlOlHIJg5BSU6bTuHXLMn47hraAlyivVem/fvIHGsaApsSVFMstHD+IaC+cz8kADjZW47BHnFQmj+QAV0p9Kgimbts8OlUK09nI9ndC06d5dG4ayYIWFxzJelfudOTypsbQzKNO6ZPQ4uLQ3EonKwPv1HfGwgpHYi5RKzzRxVeeqf9Ki9bpGBTrgndwFMm2MvuLQMSUjZgwoqL8KSk0GbCk+KJZ7yRAHYOxEdCs1U5YURhpFd0U4EOm4i0hqyk2UiTPSvv8qJcx0ZNitJCEy7aMCRVfn7xzwI5SwAkw5/puXvJ3dwDVS+j0w9d8=; 31:YkroIjX5dVAIZp9kHfoSzn64h/YAP0kplWd4P1+aiC3iP1aJqTXQwsXf6Grfd/ETyl0QZfNar8p9pnLWfIrVc9NNptcI+GBPGZLnaVoR5tNcV5zJXaGGpbCI0hy8L9pxsJ3BTApnjdGODNDUt1gXf2LFDmO2Ui/XFX1cZmFcjvzqTwxuk5r5i2q4SmcAcfFWttv8kVEHlbDbNanKFGmD36IygDYHFOiItzeKjgVinqT67WNU7mpTo8mNoC7GbiMEMa8Co+YwDAAJnfHIsvlThQ== WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0355; 20:B+piQiUqyKhU19e0npmcnO8jzSN7xAq+IqAAQ+4HrIPBGUXalOhNGwkbGsHGsJNmO0cFCBrYxpVQkpJ05x75z6/Q9h1q3hmFfemVq40Z1ZIrrzwCNoX+Q0rTUX24soMHFsaKHP7Pa3KpTZUyikkUiYB1nR30Jfc0DF1IrcyKg8fztG6Eo56s+LHeclSvATdntvniZe9j1YwwBVM/nFaMenZlIH3Ts841lRMoSfBf4Ws7hRIdXyWO9jxEiO9mKz400gMdoBs6BEkmEJC0OcE094ZKy/IJMjWfWAYWIBsjY4hYBpq8gDzFsTwGt3gEqQp+FF/WG+F9ea2fjqq14cj/DisNPx52lUyEqrEYl5XQ7fLh9PQC9zY5Qe5V0BRh4PWM5Un5iD+wllYBP2iyGsSELMVf5pBYf7mspYLNkPmpv1VUMdsD+xSLZ18gMoJBszzJyuub95o5nK5ipb1x+UnqHOjWB//nfHNGjxgPZJkklF+QZAHiG5WHDfDncWpRAQjc 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:(6040450)(601004)(2401047)(13016025)(5005006)(13018025)(8121501046)(3002001)(10201501046)(93006095)(93004095)(6055026)(6041248)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(20161123555025)(6072148); SRVR:BN6PR04MB0355; BCL:0; PCL:0; RULEID:; SRVR:BN6PR04MB0355; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR04MB0355; 4:Ulp0/AHLD+XV3REghcmhmBN6vt/+KuSg8K4HdQONF9?= =?us-ascii?Q?to/TLBFGI2fGFpemUreXZVM2+8gifhZsyjjJStB+NolsmPm/354ieu50rLKC?= =?us-ascii?Q?3+dHmFo/czn64m0h2KiF+5cCOAuv2tmDBQWaYexisPi0sMc6UlhoK8Ur/Vlq?= =?us-ascii?Q?PFe3AdbJllrIaqrEXius1BVRt42OReixECEkcndI2RkiBM1Gf0hVmlGnIcUr?= =?us-ascii?Q?AN1D2laMYRgOn52CIXi76g+dUEC2V+XK4ESoVcugLIChO78d8Q3mCtIkvwmE?= =?us-ascii?Q?ld2+uNYqG3VGwTCeyf5UI43trCkw0BYXDTkyEntSQ4nPl3r1fnLMB/jWgttG?= =?us-ascii?Q?I/sXsQRdAV1YVz4mEyJ4NURgHkuNgnl9uYiPQ4UFJeEmGgccJ1RPiwdIGG7p?= =?us-ascii?Q?v3qolmTNjodKXZ+WWBk7KSxF9gKaJRme/5caNe8/dAd/l1q7ib2yoZHzdNjt?= =?us-ascii?Q?zDoZC8fRY0+MnFzWTjRfajZHUmBMXu08+O0jzTr7Wcj8Ch4fjWcWfUQOV7/B?= =?us-ascii?Q?mTALrbcDPD9o3cw5abfFhwrMSSUZj88CWuoYZ/Bkii6LI6Asa5Yk8N0t/iiP?= =?us-ascii?Q?kQ8ErytQf+RkEwa6oolijkLtjKIP0XJiKUbfcNMZ2jFvRNYlZhbAV25NF7WN?= =?us-ascii?Q?x9w8/ld5p3AATE3mB+F50umqdWI2eEcSZrIis8lNujYo5Dx6QOTEZ+UXFo/K?= =?us-ascii?Q?vgsvOQJIvX04kOivY41svt717Ikvhe/00P0fXWV+lHACPQv62ZZcJuGF+XSZ?= =?us-ascii?Q?HBghqi7JZ+ahsby/M2wYISNWrcHjsStjmF0dWIB/BzeCuts3PaJIOrz+HK+a?= =?us-ascii?Q?TsiaNjPC5GWOn0/SjTH8eYCFCRy0dKimX1DPu4BP4HV/IKTk7vGx8S8o9dai?= =?us-ascii?Q?n3MV4xHokgtalOaKSxNdv6M5brVmcpFYOmEqBweXxUmYD2EjxClZCVp7PmtF?= =?us-ascii?Q?Bt/Jarfoe8nBOPc50lUsQzoM9AESAwe2TQPrKOQ3kFnCAPipX+m7nrUpTDel?= =?us-ascii?Q?E=3D?= X-Forefront-PRVS: 031257FE13 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR04MB0355; 23:IzDqXuIxR7up65sxwrsGAJO6XFBHvjPEy1WxrSbL7?= =?us-ascii?Q?AZL0I0S4fFQYrHeHyYdSP+lz1dyXy0t7gSGZU+r3mydUZOjdAgj9EqmUeUC0?= =?us-ascii?Q?2gdu+6E0MIs8XMtbywq6ual+wTfU2XlEdfCPm+8KFwdQcLhiovwQREn3Itoc?= =?us-ascii?Q?QhlSE77fNlociy2+BfTleCvkqs1ZJ80/WoVRcVP6p1nKRrqmHL7jOMVIO8ZD?= =?us-ascii?Q?GEYJMRLyApKIottZ05LjTXAmsol262eNt+/jB/AEQRhyPK1+/IJdxA0+2NYR?= =?us-ascii?Q?VWaud1jcnSMsOqsOOOO/sb26YTxAe2arzs4xVUZOcbhsqLfalqRIik6mQ0SD?= =?us-ascii?Q?KF8nwYMjmnyN+LEdGonjTQPOlwAsvoch5zwDlX6DaxRktSvRHzdDQuYB+GN6?= =?us-ascii?Q?gPzNh9oQ1vHoMracrYCUn8u7FHU2KBvIGO4IXtw7/g+pFiX2QmxvKNGGIY29?= =?us-ascii?Q?7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HfaU5ijSWDa/DQn36A3WNIcXIDTBbFG7VpQqO7pQn8Kmg= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2017 18:30:21.9267 (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: BN6PR04MB0355 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 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 Cc: Jens Axboe Cc: Christoph Hellwig Cc: Omar Sandoval Cc: Hannes Reinecke 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 a69d420b7ff0..f2540d164679 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 a69ad122ed66..2af43d4e5b96 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 75b71374e1ba..2ee8da93619d 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;