From patchwork Wed May 24 00:34:06 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: 9744757 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 6D8A2602A7 for ; Wed, 24 May 2017 00:35:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60F5F28867 for ; Wed, 24 May 2017 00:35:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 557FB2886A; Wed, 24 May 2017 00:35:56 +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 C054F28867 for ; Wed, 24 May 2017 00:35:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968981AbdEXAfy (ORCPT ); Tue, 23 May 2017 20:35:54 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:21533 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763421AbdEXAeo (ORCPT ); Tue, 23 May 2017 20:34:44 -0400 X-IronPort-AV: E=Sophos;i="5.38,383,1491235200"; d="scan'208";a="21089180" Received: from mail-by2nam01lp0178.outbound.protection.outlook.com (HELO NAM01-BY2-obe.outbound.protection.outlook.com) ([216.32.181.178]) by ob1.hgst.iphmx.com with ESMTP; 24 May 2017 08:34:32 +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=no4C5TrsiY4rJmLdw8dqOA76uM5G9WbwmcD3iLR5dcM=; b=bxbteXZr+kq9oKuMBuTj/0o+ZXC5rCavXAR9ExCus0TMOVTKVZF9ABuRnqvp0PHkunSvKU2dfmIN8FkaZZBuWs5FtKce78ND/ZGMmgx3H6qABbiXqNgHb4ieAQMtbakmRhYoRmE8WnxJURpvArapASANZVUBFIZ06pBViwyW0Wk= Received: from CY4PR04CA0044.namprd04.prod.outlook.com (10.172.133.30) by BN6PR04MB0356.namprd04.prod.outlook.com (10.173.198.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14; Wed, 24 May 2017 00:34:29 +0000 Received: from CO1NAM04FT042.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4d::206) by CY4PR04CA0044.outlook.office365.com (2603:10b6:903:c6::30) 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; Wed, 24 May 2017 00:34:28 +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 CO1NAM04FT042.mail.protection.outlook.com (10.152.91.197) 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; Wed, 24 May 2017 00:34:27 +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 7C.43.45291.215D4295; Tue, 23 May 2017 17:34:27 -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; Tue, 23 May 2017 17:34:23 -0700 X-AuditID: 0ac94369-166ac9800001b0eb-02-5924d512ec19 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 46.A3.18148.F05D4295; Tue, 23 May 2017 17:34:23 -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 17/31] block: Introduce request_queue.initialize_rq_fn() Date: Tue, 23 May 2017 17:34:06 -0700 Message-ID: <20170524003420.5381-18-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170524003420.5381-1-bart.vanassche@sandisk.com> References: <20170524003420.5381-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrELMWRmVeSWpSXmKPExsXCddJ5ka7wVZVIg9bzzBb/9xxjs1jwZi+b xcrVR5ksNvZzWOy9pW3RfX0Hm8Xy4/+YLA7fu8riwOExsfkdu8e0SafYPHbfbGDz+Pj0FovH +i1XWTw+b5ILYIvisklJzcksSy3St0vgylg+5wVrwQeBiu1NxxgbGLv4uhg5OSQETCRmT37H CGILCSxlkji9wK2LkQvI3sYocevmS2aYos6WU6wQiY2MEhtOLmEDSbAJGEl8ez+TBcQWESiU uLStgxGkiFngPaPEtffP2EESwgIeEs+3fQFbwSKgKjGh7Q3YVF4Be4mne28yQmyQlzi7ZSdY nBMo3vVqAlAvB9A2O4lF2ytAZkoIrGOVWP7oByNEr6DEyZlPwBY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ributedMessage: 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)(39400400002)(39850400002)(39410400002)(39450400003)(39860400002)(39840400002)(2980300002)(438002)(189002)(199003)(9170700003)(5660300001)(189998001)(48376002)(50466002)(38730400002)(77096006)(47776003)(86362001)(305945005)(2906002)(72206003)(1076002)(4326008)(53936002)(33646002)(50986999)(478600001)(2950100002)(76176999)(6666003)(356003)(5003940100001)(81166006)(50226002)(8676002)(106466001)(36756003)(8936002)(54906002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN6PR04MB0356; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM04FT042; 1:D9GUDfxTVAz9jr7DGqTs4/+FwZmbsm5VfozFf7QaygS4WKy7X+qO8Df1zysLQxak1dHgTN8gLBtYgJIKp34BKiCSpIV1ddi+HVJ3+s0ee/a0ubOLMPNVADQTSAy7o6Ps6MyUr15bkStBn2I/egrqT+kUm5Mu/AoEovg6CXpY3ALKgM7hMKAAulBIlcrxXPB7TVes13EeR38zJgRV3U9jhhCTAR31ZHaEl2bD/4vVOHXbdw49ijuZNoeXxhx4i2Zdbb0EOWp96fH3vvctTnXrNeZPVBBcD+d5apCX/Nd5WtyTZNMdh84eT5YLyT382THBkQsDrAncVWtx6iozYhQ31Qn4E2QxXH4U7JKoyokEBnZFkHqEadiKGYpXDH2Juq/oaj2xTw3gvc+Wve0o+gfN0kj1ehvIrzRFYPgNRZ4KfxPXNgegXRuujPyc9wukYRI0RBi/Nxr/+Es8C1UpSrpLHGoPQnw9XUVfrImP/4XsFp0a5dnJUlZqd6JXNshF0hPyYrJXt/75ZRKQGs9hrBA2vc9z1T8UT0X9wq2zlWEFrT8= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN6PR04MB0356: X-MS-Office365-Filtering-Correlation-Id: f2254c67-06cb-4dce-2110-08d4a23ca303 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:BN6PR04MB0356; X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0356; 3:ksgo4XtwVGM9KnM7zppJ6O1fbxmJmG3QC07zT0UdO0EfUF4P5uU5nWFc12JAP5z5wAeTUuNKl61talkqDJ/bVkhaFXmdMBThc8u0GL5IjvPVljqV94CQl39zdtSUApGJLxvVUvz7pGwYZYFm8+X0NqKouqjOaO6zmcBzY+zuLuznfvx9zpbVifzzR9jOKk2tL1jL62i1YTeI1/PJLumNaCJdti9fQcgdp9odx3KzEYPwRJCcjNVdWiv9nRfrzgBjDKXrgCfn3BdYNMJaHQkZNyq9Jmm+QnSDtNsCHxnO1Q+xky2j/Nmpwlx0U+tXSPXLV0VyLklsTArmQW7x6x1OLqNLfX1n3y7Fdn/xjrNNBzaEd0b7w4CTC/JI+LUc1HYxY2UrnhNf19ThRcx806eFFwEMZpsCOdSX9VUG9nES3SKKW5aNTaKRdILYfTNl/fVlGtOh9fpJvTfhP5HlXBByRxnBxMSeuqKOqglqs93BGD+olezneekRdf2PhduHPvGT X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0356; 25:l2TVJhG6hikHt7Ns0OTmj3l9lfQJyuRZXrGAzftqtoL+LIANCFwLJZ10njZZIV4tJRDHJIC2+mSyYvFR8pQLVEx33dFgUn6FHfC/uW/3z6uDu0Kp1cqAClw2FG7tV4tXUQ2aBMbIzrKa5G/e9el20CvceYJNVXIiYXxWGfanT3qklv/jwUxb5reZVEL2lI0NRZNz/br/4AFD5k+v0pOJcQDj41TDfi75HrpSHTKhEgZ9FumASuRAEeW7WeOYLxXh7V63RQ7QF7gX6nkNd3TZqWSSIm+YRrC3MfmmtMmonbF+0QvBTxKcEZrsOhFLFO8a9wIkaFpvCgPsk8oNpwC4HkUdQKbPgDroDqQDWIJnVNXf6JtocUjlRJl5rOaZ+6h+mTsTSius8BrtqG+JamVRnttNiAn1tynF4Rrf4jlcBkVjFmlXCXArPTNLaeKlDm9wPFq+2ZiiPfUGpIM9XX91+2iYnMa7dZ1O69p5W33GSjA=; 31:MZVc4BNS7i2q8+CJ/4D1gRyVWpbm+nl8kWirHD6jGoQL/wSvhi4Up+vb/WzOFLF7ontOdep6X7NCKu+eTCXLdgLjGpQZbDES9VMSODsu8dm88IPfzkdufeBI4jto0epBtTr1KI8xWj1HxkNIH3uRy8gW+3W8lrz+z4uEj9nA70iShn2+rjoysIDSgYK76EUAzn70VD+JvK3Am9sDFitPufwVUqg5272jPcaNdmm61IzzMAm0MyM3FXrgtGjjd85Mo3tQWzbfByedgnjiwGIA3AlYvIq8BWeZySo7bf00s+Q= WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; BN6PR04MB0356; 20:I0ZeHKP0aOf2xJuXc0SNrlpsNi539lEmrbgdK6bGDFvwDb357YYF3BlHvbHFv4FghC8p7r9NeY/XoMuP3gyKmTDDp8xv10m2YBVuZ9J0EhCKczffBjD7NPb45bxuy9R8ZzPHVChVWRDo4ME+nG+V4pFjayApr/iXU8z93kP97h/2E85Fg42PyfxuOEXdfamyEjwCAmZpWUh7qCShY1BGD2/6fP/iEHhSUGB45YIkvDq6JSmnFOdoQpyE8tKsJivY/ftkzB/1m3DwHVNiEqp3nGA6omPzKgVQjhoENND5j+cP1VuphYnKeHn4ibi7AVi4BcfUXNYcPiDtDKZuIEqePCwKhuktFCkXbmE2NNKEHItsaj48gIklx1GdngK2QJKc/yvjEa8bB+2DdIKx+PHewaldvM4Lzn9kCROQgE0hVUVPx9U3X3G1xhJrCiAv2EeIbXUBVkXhDtuwYI2qxgj7SGTYrWO0clRDwP64Ocz0Iz+I/vYUdeBRBUkcgAhc2Cnq 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)(8121501046)(13018025)(10201501046)(93006095)(93004095)(3002001)(6055026)(6041248)(20161123560025)(20161123562025)(20161123558100)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148); SRVR:BN6PR04MB0356; BCL:0; PCL:0; RULEID:; SRVR:BN6PR04MB0356; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR04MB0356; 4:ueEHCfp3sQ+bguQx55V70C/tTTStt7CaHu3WtjuTf3?= =?us-ascii?Q?S3suT2eht6alIARl3zGrUUBtM9WDuIIXQqf8AgdcMt+3Ataf6IEtnnu6BOPG?= =?us-ascii?Q?VipvQoFm102l/lHstAh7B4N5KQCcUeopk1kQbqtw2NJVksuIkBSrd/TT8DDz?= =?us-ascii?Q?rmmk2CdEoxTtIHPxE/1G2j6nHwMIUVAF94wkvLXzEeX4ppRIn0oKNkIluPmh?= =?us-ascii?Q?QTeQtokM8nUbewwpPqvFPzuFx5GcettzvsbKxSC2Z0LR4HmmNQZyVryJBnBA?= =?us-ascii?Q?6mjCGHCsyIxeVZCs1uOelOyDuW7tvSgPE6t8lizoh7HYkEXA7yuib08TFeqB?= =?us-ascii?Q?S7y++7brEdIPbyCXInlqndtH09vRb6oqdGJzpKc9IMwZ6VnuNDGvm02PtePP?= =?us-ascii?Q?MNNXhJht3JlF0GVvXCZdE8+4Z2YYfgUwBADWLinHN0SuWpFCEEOIgxta2fGO?= =?us-ascii?Q?CkiIq/dS6q/LtNC+JO39quE2say3fv2Z6637JeRJnsl4JC3pwmMI6JhdRGZi?= =?us-ascii?Q?LM/U0heprqhSi7TvSYQz8s0g5iKl0AuApujG7trgGZ6vC5qJ6Qax5y/jwYnq?= =?us-ascii?Q?yPsgW2+cpE3UC8dGGrEtggbT/S3GxcXmUl68O5ra8ranttPBvu8i23vCO3mp?= =?us-ascii?Q?yp6+PTSpP2TL3qi1lDiuE5Pfpofwmiu4t9qfINi6ysJGJooAJzLu7pBwgh98?= =?us-ascii?Q?ewAVt9fSiDcblxKCEjQHcX0280JlCOnFDPR7cHOQBmQznq+qB+wk0WwyQpzI?= =?us-ascii?Q?8f1YqYkmlv9KGGN72bkhp7JxdexO3oCDkYZ/2v5ZZrx2xuXTxJuVdax5XCqC?= =?us-ascii?Q?3o0U3+XAcLBb7iWtJqHLKhnkpMY05xYj4qMMc7Ee98wDzZLsfOLRG75gCeJV?= =?us-ascii?Q?i+70DLvrN6Iom4TrFr/IeNXUnxjiFexFKzEbCKLmXIEqUaYlO4gXQE962C67?= =?us-ascii?Q?maj3l6RV9KKBCWMxH4Eu5f2i+f5UAIxSuYpWFx0o+C/P8IjekH7Rk0vh/G34?= =?us-ascii?Q?0=3D?= X-Forefront-PRVS: 031763BCAF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR04MB0356; 23:GBF7C7/8eXUDM7peIA4OytocoyDWJP+nlKnnwop12?= =?us-ascii?Q?BlJ3780wYtFW6Tv+K4hpkgYVcfOp26Pzomvo3PVtorpz/OfWpXR7fEZOVmEQ?= =?us-ascii?Q?X3o4MAcRf9+l8Mun66F+kLcS0fFhenH3RVrryfS3CvQXh6ZH6JiHTx7SldI1?= =?us-ascii?Q?ivWJb7pX7EIphxiWAr++KftyVehOrGkSR0WGb3CAMn5t0Lmz4o8VSiIU8Mlg?= =?us-ascii?Q?lzZY3vl9maavMMJOc1+smZyq5/eyI0tdOtvi1l+/bAuiKzuZXnMD/zGkgIr8?= =?us-ascii?Q?JRPDsrz6iHSroDEN317uwU6Sc4SpGUWA8YOdrqVi/EuR/4rsE5nD7elBrzoY?= =?us-ascii?Q?Fpg60508ZJX5vBpI8ZnGgnPiJw2siNUiE497Re7Pvl+d2vVlc5SD/ZTuXFNI?= =?us-ascii?Q?ch3zB2EXmTrpZg8L0RCtqs83DGHnZ/0p8QtAQTIYbbJT2VKe2ToADe2ghDgF?= =?us-ascii?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HbsA69CA8kY3OXeL/IFuIrAiAnIABt5B/CWt2AR4NWxoxgyAodk= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2017 00:34:27.7711 (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: BN6PR04MB0356 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 Cc: Jens Axboe Cc: Christoph Hellwig Cc: Omar Sandoval Cc: Hannes Reinecke Cc: linux-block@vger.kernel.org Reviewed-by: Hannes Reinecke --- 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 55a7b76db7c2..8a680f7bb168 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 6416a5834b05..e3c03d429371 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;