From patchwork Tue Oct 18 21:49:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9383199 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 3EB5F607D0 for ; Tue, 18 Oct 2016 22:04:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C9AD2977C for ; Tue, 18 Oct 2016 22:04:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2146629790; Tue, 18 Oct 2016 22:04:26 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 6DC0E2977C for ; Tue, 18 Oct 2016 22:04:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934111AbcJRWEW (ORCPT ); Tue, 18 Oct 2016 18:04:22 -0400 Received: from mail-by2nam03on0051.outbound.protection.outlook.com ([104.47.42.51]:49440 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934021AbcJRWEU (ORCPT ); Tue, 18 Oct 2016 18:04:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=sd+1dXv/1mtctU7nAE5jN8vo7lTHi84lpIw3V8T/ltM=; b=OnBePyzvL9qHvVZLkIHmOqufcRe2+rDkPEpXfln8nwUkXJN+zW3MlLxMA6FI1nSBgUk6qjZEsxUmhnnZEDtDS3OZ4ILfLHdUE9CLktI30CszT3y/xenKTX3ILZozadh4K3kSVvixq9I91NgeX+F1qrfMkM0lC2hbWT+oAOCCTV8= Received: from BN6PR02CA0028.namprd02.prod.outlook.com (10.173.146.142) by BLUPR02MB1617.namprd02.prod.outlook.com (10.162.212.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.659.11; Tue, 18 Oct 2016 21:49:17 +0000 Received: from BY2FFO11FD040.protection.gbl (2a01:111:f400:7c0c::142) by BN6PR02CA0028.outlook.office365.com (2603:10b6:404:5f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.12 via Frontend Transport; Tue, 18 Oct 2016 21:49:11 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; lst.de; dkim=none (message not signed) header.d=none;lst.de; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 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 BY2FFO11FD040.mail.protection.outlook.com (10.1.14.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.7 via Frontend Transport; Tue, 18 Oct 2016 21:49:10 +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 B1.FD.61581.A9696085; Tue, 18 Oct 2016 14:39:38 -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, 18 Oct 2016 14:49:09 -0700 X-AuditID: 0ac94371-5f3ff7000000f08d-81-5806969aabee Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 29.A3.03615.5D896085; Tue, 18 Oct 2016 14:49:09 -0700 (PDT) Subject: [PATCH v3 02/11] blk-mq: Introduce blk_mq_hctx_stopped() To: Jens Axboe References: CC: Christoph Hellwig , James Bottomley , "Martin K. Petersen" , Mike Snitzer , Doug Ledford , Keith Busch , Ming Lin , Laurence Oberman , "linux-block@vger.kernel.org" , "linux-scsi@vger.kernel.org" , "linux-rdma@vger.kernel.org" , "linux-nvme@lists.infradead.org" From: Bart Van Assche Message-ID: Date: Tue, 18 Oct 2016 14:49:09 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrDIsWRmVeSWpSXmKPExsXCddJ5ke6saWwRBs/Xm1j833OMzeLl+Q+s FitXH2WyWDUxz+Le0S9MFntvaVvMX/aU3eLZoV4Wi+7rO9gszn94xWSx/Pg/Jov23g5mi7aN XxkdeD0mNr9j91i85yWTx4NDm1k8Ni+p99h9s4HN4+PTWywe7/ddZfN4+3Inq8fnTXIBnFFc NimpOZllqUX6dglcGZv/f2AtuChdcWPDO5YGxkbxLkYODgkBE4n50zS7GLk4hASWMklMeXWe GcLZxiix+c47li5GTrCijb9/MoLYQFWMEiv/qILYwgKOEmtP7mYDsUUEZCW+737NBlFjJ/F2 /U4WkEHMAntZJB5evsUKkmATMJL49n4mC8hmXqCiGffCQEwWAVWJjtUVIBWiAhESm77OAVvL KyAocXLmE7BqTgF7iasHwkFMZgFNifW79EEqmAXkJba/nQN2sYTAFDaJf1OvMEFcoC5xcs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qREZpuy5fPnrxbISl3kL9785sOyeSvcPf0MIqJfdyuxFGckGmoxFxUn AgBmla4mOAIAAA== 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:(10009020)(6009001)(7916002)(2980300002)(438002)(189002)(199003)(4001350100001)(11100500001)(77096005)(2906002)(305945005)(7846002)(19580395003)(4326007)(31686004)(189998001)(86362001)(53416004)(68736007)(586003)(31696002)(230700001)(229853001)(19580405001)(106466001)(97736004)(6916009)(23676002)(36756003)(64126003)(92566002)(69596002)(33646002)(2950100002)(2270400002)(65806001)(50466002)(110136003)(65826007)(76176999)(50986999)(7416002)(356003)(626004)(83506001)(81156014)(54356999)(81166006)(65956001)(87936001)(5660300001)(47776003)(8676002)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR02MB1617; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD040; 1:OzXpwGB+l9/dBpaSdMXVxHMYaFOF3yiOsGff7BaY2s+63Hg8Nf665Kwzqqlj8zhjyoST4EoC5Lp7sNQ46OaCwQztX3sIEcgLuMcTWNyuIVjFZ7aK5vRuAeBXp0Qrxx4DAirJpj5AeJsL+8PqD8TFszs96Ih6kyHT6GatKMXoubVEklRC0AkspBtPM5eXcoxIitAeGrOngrGmtjMJxleGaXHFrhF8h2npxaQxfw7eKP9IIVdlnc/evmxqajejaXQESvIph9O81xKoDVxrOtVgwXKncvgRSIs+KFKSh1GCDY2jRR96BhehVoiVZ/uBo0O05iurVprSHzxj4/bV9RrtlVT5Sg8l2BkAuqn9c8nvZZXT6uaEQnoHcTuui+6shNJfIfxnTQam+1XMHW4M1ifRAf1h7+PzBjNk945KUggAILvspNsoBxHcpV27aj0PKoAgQjtJuyvSvEzGhfmpAf7AWSAw/4QttXnwj4VxekgkG4GnuwnSAvPfcMUfrN+knXzV9HNB/sFbX4D6y0C7PrHYynAcSEddM1gw3s6zgi2P0kChvbxIa9CuvRctNes6rVD9 X-MS-Office365-Filtering-Correlation-Id: f7b55125-d1d9-4677-eca0-08d3f7a09825 X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1617; 2:/iB3wduoFPDxoaW5ewZ8JYkHnQUEm7RhrQTsPazh9G5J31Mzm7FQRPO2XHJ/jhpC0Oa+N9j/gl18bZvGYayBKO6e5qMvVhktnQsh+DvCYxjyUSpOHSR4/Ku5A/0llEP/TJ1DOltgxHgVE+B6V4ObRG7syDcQGJYseNsop9cD9cWjbsgqeakv7RodiWDNacVW0rorV7BZ3P4PGmrrj7f3/g==; 3:inOCc5i7mWfUtX/NHliKZ+4btWhAYThGCWzTvattvR5YykOvq+ms1AvzsNxW98A9oqtrt8BE5KuLNg1CA2fuEzNeFBBJk1ve7jCtu68d7zEkZqPK4RTprWQfOknCELS1fseZOdapIZJZROLcuHqiYBa6lvHEkMj/uBW1hCUK5GelX+Y3xShQ9J5OBBn4tG6bHSOAH8jvd0dmFU/OI1lXH9WosiQTAKYXXO52N/oMggyMFid7p7TadDCmJZdY7HDh/fCk6OUHrZgLgy+CD15CD4fnwpqG1r2S/XOut+LyaZY=; 25:fwCJ1LKMAVfeQoO2QE60H45RvYbq9QvxoU5ULoMqLCes1PxlD44hS2Q6/1exA7pV2B5YS9YvSWpM5j1dagM/60W5JYxloniIrfUbH4F3BhnNFqKgmbCUg6Jk+9NMpuiXEVB/QKEr4hpA51YfHhNOlpSbB8JrMRBZ7Q/5SUriiC7cFo8quehfPyp2cbbTMbkjN9IaFWAw/zkxZitDFb6pBVvLAu/EoKh4w6D4Z27pxbYKhQSdRLA676FP+WYy2jOBeFygPBwRwHNQ+G4/fJipcFWJjvDC4lrTinPskpnUOoHLGmdPAFckX0okFM5bLmtOpPYwnxgiTy9c39r4zcPiKoJImABLxRK9jGcaqTYFYAAltU2nv4W5iigI8Owuvj/vDtOH8dldJMd8F7HPIErqm7pCDoPYZ1z oGJb1YXC85l9zpK6UUC1RP61cHqQ9HNFD X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:BLUPR02MB1617; X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1617; 31:aV1qWCZ5wq9IhDz7jUr5bYI7NomZJfKp48OyLDu6ZUHVhP7zUH8Y20ZyjX1Ut0w8p7Ex2pW+gQ8KdUzBm6rFyD4451uhYvqqxokj9Ji6x3ys4ZtlZLmjJRI7Bay9GB345BGFbnRleO+59APzikshKDDq3omhDkgxXxyHXA03jCUBG6vHoeSN8eZ5ysccfnzMXPwRR+4D6WhrGczDSGc6fY1shQ+AXxkgb/h7rzhWLuCGyXoOR/4AF05U5o2p535sYgNTDw4puWecyxWnvEhCpA==; 20:gzEL9VWB4FmwjKRTLlyVcvTf492yHwk1LHTrn/N+QeWeCsmzAJOxmsKHFgTdpgkkD7rZocfu8m6xvqjMfyPmdU6CNXKZ3KzHqVpPfzsUJ7bWZva/QUHaLXtJ1Zt15eMJ9mPUvH4+kcqnpTZQjASgzT0ypH7JiKWYNAARwl2G0H6G/Pe6m9Vy6Sm0dkucvvcYUvHkWl0JlAXsk6Ws3K3BAKre77Jvlu61jgvBCqm2F+fmTqy8bgg3CXrof/X4p+Vib+O7dHivDeK8j1AFwcllikKWqRiIJvS6pGOOwOC0ZQAWvAECf5LY+i/CjB8QmnetYifo59yrvAoYZEj711cNWpgls3qsG1kbSJiCYArb7nH56MbPIB3l28leNgr1NGo8gXa0CFXKOt/uKcf2OU9b387Qw8g+Wgi5Sa1vvkp8ow17S9aP17ycD/I+HM2HP4aRTXU0vjUuUc4HS7Zq4or7Uwm+Usi9UJRN7GDtAxOhRAMx0a3nQHxkeRMjIG/cELo8 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(13016025)(13018025)(10201501046)(3002001)(6055026); SRVR:BLUPR02MB1617; BCL:0; PCL:0; RULEID:; SRVR:BLUPR02MB1617; X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1617; 4:G4hq9ot55uT1/XcTRUgC6Epb/40NfEKrPqq0WfWy86sXnGWeLcVA0lHFoYG5fC3Va1w2zHhZtVQQfOvkB4lupljUpHLMCFDfTqLWdmJpJyxyH78ImWWeRzP4yF8aE4Nwxw54FoM6288l186zlfCjq3/5oY2UMHRJ7CizEJaEILcRgpK8l7fh38T3/aecJplP7GJbXeQiqdx5+sUC+s9hgaLxUNguz3LJocfOSW0E30oADHm6vqZYqdCABJHRHSO2jgfp84bGD0G5xDVLzuz2icN4gAViB9Oak3JyUQVdCjZdGiDFqXY7ZLJ9LI39CdMSqOKGVQvZO/RqL5XzUHjBPJmMc3fsqZldP1BAkwBesEMn4CQf5fdIbYgprIiZaPWjGlXnNDwhgZwcUz5q39WU9TrwVdTkvRLACy1/2/Bz3WasHB0F3bidVNbQy4NetYXZouLrqJfMgtzcyHXr0Zd2gzYVn9dy6v60aP4TMe7uspQiow486DaD83v+bpJjzy9H X-Forefront-PRVS: 00997889E7 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTFVQUjAyTUIxNjE3OzIzOlA5aW02LzlaZzEzS0EvZG84SDFCOGtGYjVu?= =?utf-8?B?MlNqcDMvVWFHRmZpWE9DZUpJc0FmcG1rMGFZWDZ4Um9Ec2dpRTFRcTJGckQ4?= =?utf-8?B?bGcwYis4UFJxdUY3ZlRzdVA1cHd4VHY3N0w0ckxRY1BHVnRrUmdaQlozM3Vk?= =?utf-8?B?S2syK1JJZE1obUdPVmJtSFkrNTJPV21pOE1SN1hPT3lERUNCWi9oRHhHa3Bi?= =?utf-8?B?VmpUeHN6OXFpR1JNTjRKMEZXRlpScHptcWsyU0tqS1MrZndvV2xrVklielc3?= =?utf-8?B?SEdGRFp0VlBhVHB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5:yFq6UhXWM7JOLHfP1gywyxYAx7yceSo3Umj9Ch1ITdK5srPB3SaaLa9ObpBma8JVPX6Dknz38/hkV53y/7d64NlQtcEk/n8bFNju6uJqZUymZkKvjWqHw2wtx8VxEoXl2B52EO2II55nQfjbPm/amg==; 24:5jnbPb+kdT3LY8jRHq5BdJ8LY2TdSMWCcy1WUDxJ5yXl0UEF+NX2ANgWOgCGQUB9t0IrZVMUj7pvYFTf98NbXwlE2Y+JfzEefnho9MGTcig= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB1617; 7:KGswsypKl9ZRFl90PJ+8x4cDjzRXISQK40BbUD4GmktzMSU9a+3iua4uN4rthAGtWPDTg4C/WpvtNAvE8ZAQZaQNA+vCVI+AxTwBDywm2in+0TiFO4d9XIk5UJqo3ceSLsdEO8BkDpiLu8Xtp/L4Rx/28jpnGANuFNUPHB87pRCoqk1m++t6a+KpCNrziTd83QHqpWkVzd+GNkrIwp1pOnqDWoCk6tmj6GapZ1hkpZ4lk7OnOBFjze3Sgm8W/WASVuQkaSp5N1KLMj8gH7vTEbqHHOqPcf7t3WgJ5SMZyg5h++HJbM82CaoAQ4lYIUFrglfPvmjz+H/ByZL13T8n2sdvStZy2klealwRxk6jsMY=; 20:+ecb1KgyZLn5aBYrs02FpDA0i+fUJcOm9dd/XyvTmwtbOSsEKNr8Lo9EW7UJ46rXr4XEHjdngFco0PS9c+YxjrRjV5FIAIcJrPwoExGVPW8OfYoURBaD4v5Wzl6ayKQI7T6o5xTkjiY0QcquwXOk8B/uEJr6KfmjvVSYkqJTWHPvzt86J/KlaBRygfVaoaJiiXwgDDzENFYt2t4Qz0gvzxDfsA3Dx81YnO+aJC+Cl+Z+d7M5PB961ZB5zC7GjptE X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2016 21:49:10.7418 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR02MB1617 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 Multiple functions test the BLK_MQ_S_STOPPED bit so introduce a helper function that performs this test. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Sagi Grimberg Cc: Johannes Thumshirn --- block/blk-mq.c | 12 ++++++------ drivers/md/dm-rq.c | 2 +- include/linux/blk-mq.h | 5 +++++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index b5dcafb..b52b3a6 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -787,7 +787,7 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx) struct list_head *dptr; int queued; - if (unlikely(test_bit(BLK_MQ_S_STOPPED, &hctx->state))) + if (unlikely(blk_mq_hctx_stopped(hctx))) return; WARN_ON(!cpumask_test_cpu(raw_smp_processor_id(), hctx->cpumask) && @@ -912,8 +912,8 @@ static int blk_mq_hctx_next_cpu(struct blk_mq_hw_ctx *hctx) void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async) { - if (unlikely(test_bit(BLK_MQ_S_STOPPED, &hctx->state) || - !blk_mq_hw_queue_mapped(hctx))) + if (unlikely(blk_mq_hctx_stopped(hctx) || + !blk_mq_hw_queue_mapped(hctx))) return; if (!async && !(hctx->flags & BLK_MQ_F_BLOCKING)) { @@ -938,7 +938,7 @@ void blk_mq_run_hw_queues(struct request_queue *q, bool async) queue_for_each_hw_ctx(q, hctx, i) { if ((!blk_mq_hctx_has_pending(hctx) && list_empty_careful(&hctx->dispatch)) || - test_bit(BLK_MQ_S_STOPPED, &hctx->state)) + blk_mq_hctx_stopped(hctx)) continue; blk_mq_run_hw_queue(hctx, async); @@ -988,7 +988,7 @@ void blk_mq_start_stopped_hw_queues(struct request_queue *q, bool async) int i; queue_for_each_hw_ctx(q, hctx, i) { - if (!test_bit(BLK_MQ_S_STOPPED, &hctx->state)) + if (!blk_mq_hctx_stopped(hctx)) continue; clear_bit(BLK_MQ_S_STOPPED, &hctx->state); @@ -1332,7 +1332,7 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) blk_mq_put_ctx(data.ctx); if (!old_rq) goto done; - if (test_bit(BLK_MQ_S_STOPPED, &data.hctx->state) || + if (blk_mq_hctx_stopped(data.hctx) || blk_mq_direct_issue_request(old_rq, &cookie) != 0) blk_mq_insert_request(old_rq, false, true, true); goto done; diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c index dc75bea..76d1666 100644 --- a/drivers/md/dm-rq.c +++ b/drivers/md/dm-rq.c @@ -909,7 +909,7 @@ static int dm_mq_queue_rq(struct blk_mq_hw_ctx *hctx, * hctx that it really shouldn't. The following check guards * against this rarity (albeit _not_ race-free). */ - if (unlikely(test_bit(BLK_MQ_S_STOPPED, &hctx->state))) + if (unlikely(blk_mq_hctx_stopped(hctx))) return BLK_MQ_RQ_QUEUE_BUSY; if (ti->type->busy && ti->type->busy(ti)) diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 535ab2e..bb000c3 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -239,6 +239,11 @@ int blk_mq_reinit_tagset(struct blk_mq_tag_set *set); void blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, int nr_hw_queues); +static inline bool blk_mq_hctx_stopped(struct blk_mq_hw_ctx *hctx) +{ + return test_bit(BLK_MQ_S_STOPPED, &hctx->state); +} + /* * Driver command data is immediately after the request. So subtract request * size to get back to the original request, add request size to get the PDU.