From patchwork Thu Mar 30 18:21:26 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: 9654927 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 380E860113 for ; Thu, 30 Mar 2017 18:21:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C19E28528 for ; Thu, 30 Mar 2017 18:21:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20A712856A; Thu, 30 Mar 2017 18:21:42 +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 7D14628528 for ; Thu, 30 Mar 2017 18:21:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934007AbdC3SVl (ORCPT ); Thu, 30 Mar 2017 14:21:41 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:63538 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933547AbdC3SVj (ORCPT ); Thu, 30 Mar 2017 14:21:39 -0400 X-IronPort-AV: E=Sophos;i="5.35,258,1483977600"; d="scan'208";a="109391812" Received: from mail-cys01nam02lp0047.outbound.protection.outlook.com (HELO NAM02-CY1-obe.outbound.protection.outlook.com) ([207.46.163.47]) by ob1.hgst.iphmx.com with ESMTP; 31 Mar 2017 02:21:37 +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=H2ApYE/hO2fkG6bXMBrlk6fEoeo8ETdOa/qE6ykCh8g=; b=i+Vz94rnsLpleicSos8YxEuXCOOMZRxhwpMyE+CFPzs+QZXqGkbG5BGiy5f0He5Hxk9eembzbcZ91t9ICyMDi/p398A/8jQ4qTdGsiLwWOgSdbFotW2shrHDrzMyUmmM9vW7/4BTiX0tMSMfx8MJiM4Lb383DHRT7I31mAXbIRc= Received: from CO2PR04CA0123.namprd04.prod.outlook.com (10.165.95.25) by BLUPR04MB101.namprd04.prod.outlook.com (10.255.213.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.991.14; Thu, 30 Mar 2017 18:21:36 +0000 Received: from SN1NAM04FT019.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4c::207) by CO2PR04CA0123.outlook.office365.com (2603:10b6:104:7::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10 via Frontend Transport; Thu, 30 Mar 2017 18:21:35 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; 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 SN1NAM04FT019.mail.protection.outlook.com (10.152.88.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1005.5 via Frontend Transport; Thu, 30 Mar 2017 18:21:35 +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 F1.6E.29323.EAC4DD85; Thu, 30 Mar 2017 11:21:34 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Thu, 30 Mar 2017 11:21:32 -0700 X-AuditID: 0ac94369-548749800000728b-1c-58dd4cae57f5 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 9A.DA.18148.BAC4DD85; Thu, 30 Mar 2017 11:21:31 -0700 (PDT) From: Bart Van Assche To: Jens Axboe CC: , Bart Van Assche , Omar Sandoval , Hannes Reinecke Subject: [PATCH 1/2] blk-mq: Export queue state through /sys/kernel/debug/block/*/state Date: Thu, 30 Mar 2017 11:21:26 -0700 Message-ID: <20170330182127.24288-2-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170330182127.24288-1-bart.vanassche@sandisk.com> References: <20170330182127.24288-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRmVeSWpSXmKPExsXCddJ5ke46n7sRBt2zzC1W3+1ns1jwZi+b xd5b2haH711lcWDxmNj8jt3j8tlSj/VbrrJ4fN4kF8ASxWWTkpqTWZZapG+XwJXx4cQ9toJG xYp7bZOZGhj/SHUxcnJICJhIvL+9jbWLkYtDSGApk8SKP2vYIZwdjBLvVk1lhan6eGohC0Ri I6PEgYMvWUASbAJGEt/ezwSzRQQUJHp+r2QDKWIWmMIoMe3cH0aQhLBAuMSmz3fBJrEIqEpM +3oZLM4rYC/R13WBGWKDvMSiTTPABnEKOEjMnfsALC4EVLNz7TuwoRICXawSk1e8ZYVoFpQ4 OfMJWAOzgITEwRcvoBrUJU4umc80gVFoFpKyWUjKFjAyrWIUy83MKc5NTy0wNNUrTsxLySzO 1kvOz93ECAntzB2Md594H2IU4GBU4uHdIXg3Qog1say4MvcQowQHs5IIb4c1UIg3JbGyKrUo P76oNCe1+BCjNAeLkjjvOZmpEUIC6YklqdmpqQWpRTBZJg5OqQbG1i1t0dqe2xa3pjze6C/6 co3AD9YLwTP4p4cIiNjxzfJcdEV+4sowu1VewTWb7JZIZLOt/yTxo98wnaM1+s/mefYb1K9m lHFO0hIMuNLG36xw5dD9purDF7dw23/K9ly/tWry12j7/Y46/eZzC68fq0mc1vd62/f3PYmb lF1M1gt/nlO99ORDJZbijERDLeai4kQAJH3y5GkCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKJMWRmVeSWpSXmKPExsXCtZGTTXe1z90Ig5k/hC1W3+1nszj4s43R YsGbvWwWe29pWxy+d5XFgdVjYvM7do/LZ0s9pq05z+SxfstVFo/Pm+QCWKO4bFJSczLLUov0 7RK4Mj6cuMdW0KhYca9tMlMD4x+pLkZODgkBE4mPpxaydDFycQgJrGeUeDn1HTtIgk3ASOLb +5ksILaIgIJEz++VbCBFzAJTGCW+7N3EBpIQFgiX2PT5LiuIzSKgKjHt62VGEJtXwF7i+f7/ 7BAb5CUWbZoBNohTwEFi7twHzCC2EFDNzrXv2CYwci9gZFjFKJabmVOcm55ZYGikV5yYl5JZ nK2XnJ+7iRESEFE7GK9PND/EyMTBKdXAmKhya/PHSSJO14Xu7js4OW/j4fcxc4OUfD84/vuh VcFqnSqVtpMvfGau48zn8ReFTPKbBA+vjY5dtY51f1Nszaqdav9qal+t+/HyxuzSiQ7nji09 OGvd3IrqxxN/zzflVY3denf3rrOrl5f3H15j/p5nZ7rwp4cz9zUtXM500POx9LmnXK8VtESU WIozEg21mIuKEwELBv6muAEAAA== 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)(39400400002)(39450400003)(39860400002)(39850400002)(39840400002)(39410400002)(2980300002)(438002)(189002)(199003)(9170700003)(76176999)(50226002)(54906002)(4326008)(50986999)(81166006)(8936002)(5003940100001)(47776003)(33646002)(48376002)(50466002)(8676002)(77096006)(110136004)(38730400002)(1076002)(106466001)(5660300001)(53936002)(86362001)(2906002)(305945005)(189998001)(36756003)(6666003)(2950100002)(356003)(6916009); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR04MB101; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM04FT019; 1:rAeNCx7FmDdiABW4CuEisyLUam1IZTtZxdZfY0hqR/yZdnTeI0J+nj5nS7hGywFuAzfa94txXHmIFFIfWQ+Xn8z5wamow5LoMJxtHT+mHTqpmNfgIa+rSfKoTheaT6pG3sF7mtxR9U50mJvPkv2VQDmaJD/O5bbi61gen/OU1lg5lsToIsbOv9UiWQ0LVkKyHCQgv4WGvkJYPwIC4oIG2MssMUQf80udV5lgOfedtdgWUwBoPqC9YVlXbGBAg3ECkRED3hfAunqRL1BvVkmi92ueTaIBtkN7sLTC+yY9cyorlHp1N6dYRIL90staY/1uwKnd1SrOBZUs4QsMRl2Yc3FDYYatRHOj6wnrMMwR1ezKFUBG082ZCB/LisfrdvYmYxsE7cTD1+Du47XnwRB8aDjAIX05Or+BmipdFp/IeZUh9ChzKaKa50mJDqGriyYt1IbKI5spTQjJRcjAfD6M6W1tq28eKVhQ8SNQxH0v9K0tU9HPGuYaRciud5eCN59Afg+nv9PkkGn6mTv5YDWVfvHR0TRsifBOZS0F0l6qbOU= X-MS-Office365-Filtering-Correlation-Id: bc8a1211-36a2-4e0d-17ac-08d477999975 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081)(201702281549075); SRVR:BLUPR04MB101; X-Micros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QZbjMNq6eT4g==; 31:taBmKOxwolLdVywJtH3tohvUGSuivE4mzMkgz2yTtUZ3SRYtRCyEG3VCUv7uZbOCc6j9y31lTbbaeqxXhi9nRAgZzxCQzzrrwwjMg0JwN5JVre1N0WOTw+0AK+uniJJm6qFt9uYCqUL9+gLD2xQlh+68DS9GpivOW8izhZmRoOjWIb1QC3oUlw/qmNaXyzPRRGkJi1E7QryD4sdyN4mno4aP+wU9xL6QB/s0x71PBvSuP+xPSzr8MERdPun6GbANwpFGNzNdRcWOdVyq8rOr3g== WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; BLUPR04MB101; 20:PI+ERjCYjzkY3LSMdkZ9jaJiQa4uR8gvZoHQtdS7WFi3zTRv2HrF5FQNaP/oUnuq9VD/RNlNYODAtWVjX548EpJEO7qC/B/JZuWVxPyMU213NxDNxeAy8jz1Ou6oluZDZwD+wu47vrNwIB+qWTADveqk1EZvMl3FTCuqsAR5iAR4IYaH0N2C876B7w7f3M4d7D8RNt6TZ257iRRT3YrUWkoCTTYVU/hM+AdwNqlD6Qim4HndPobv+RmCuJuVENPSBGZXPdJBJzSDV9wOGPh8kzSUBUn09Bf+Pvb50IGqRpKMZLNe6CSiwx/SMyDBjWPQv47SQbY/unlNvH4rzvSs8L1f61n3QXf6n1/0xxGOqcg+1W9vMgLcx7qjl54CBIUj+ygKAvGGfzoZaI721DTS4x9VzAAz+WfhiVb/R9uFS0rCRPQaoKCHEnpI6Id1HbYNDO6TZvSOWaZaKgZwsPUYnlVjtehI9E0on7xttIGKunVDlrn3REOxeOzgLycZpEb+ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(13018025)(13016025)(3002001)(93006067)(93004067)(10201501046)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(6072148); SRVR:BLUPR04MB101; BCL:0; PCL:0; RULEID:; SRVR:BLUPR04MB101; X-Microsoft-Exchange-Diagnostics: 1; BLUPR04MB101; 4:V96Ruc21gVfxpWh/l2qVZLdVvLJvFW+1NZ/cA471DOS71IcRmw070DuPTxTdgJGrrGADCf4N+Agx48wiNH2bKTAHknOC+9BKYU7wVArIEq6REnZd1U+KQUpCbKZ7KbWQak2OJloLTvujyy7YG4/t/2vbVTbtsnuLNUECJnZ3Dh31RAFfClKclWmmZ1KomYn/d11oH1+mx8MGxTk7vP/vxT/gy+yDy3duqHZU1oWJQlPE1BD7xVGOgG4zaiAbQecg6FWTQio1lsOGsHUuPqrE5V8MrG/8JFD9NRwnQ73OoLf0ASlWrsazCyFzkmsQS7iMaVgjyhLdaXSig87KgcV/geyL2HwE/FMHORvJNVYiJr4j+Kxt2czl62YTzR9W0m46CRan5OJs7YYGXyWljUot2Bkzh5qUa2W3tE+pGhvTcVwjCqcEd0P5c0wirbG4+XWH9DOXOMWiSiEfY4A0jTNjjkxux93b7PrDWZkN/iX3AQZ0+9S5ze2QKS9jNg4zRqTZA4E8a1VTbn+QvT68z9mq+uZ+rADGxPwXwd5C2kujVB8ee/pgWKyGGe/l1I5AOMVRHpo5S/ocUyYyA6FAJXydGpSiJiXVXBVTaqI2l1UGBPh9x2pmrEZZj9fO9W0vhysCcE6cF06ousEqeiVK8preR3lwUaY7TOnq8IUSf946GAZp2rayBkDt7ida1ura0zAEnJjbxE5DSBTbMrJT4OxolohktHPdBMWQ7zLDg9oHknCdPK52ALU+dydW9OWomM2EoUQGFGbMfbuURv+l/c7rbND2R6OJJr0V8SYzptA63t62xQN/Wpa1Esa3GNfTh3/Hsogvp9H1ZpHFR98hGq8I1w5IZ0I01zp/yIJrlK5PIGQ= X-Forefront-PRVS: 02622CEF0A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR04MB101; 23:gDF7YVGAIL/rLSu4qTipgvTVjrPvOaQFPztx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+e0tRy6LgDoFw7dgUC1uApCz4PAzmf7cnteNrl8qmdZht8oKdUtVUmBwE2vZnNVMtnv+VsGyeChTxckm6mDlTXnthLzvHbtNMGlqP6CuaYT3MlCzbpcUKSPVHMBWSi8PXgXF8B3rQasCnPVT/2OKY96L/J0J6GZWfY+uUQH9T/P2mgpgZddke0PHYxXjlkAVaBL36GKStSkudQHMydlH1iyvDqADJxx69YNTwvlB1iHUzqZRGnBGglyMGfZYppbVb38BrU3tYN3oIRssU3K7yyQ==; 20:CTKov03vARoPxdRRgkeA/QfKrgq+rbTNWXTY053jHVya/WLIyUk2pfaobNwBErPwA7ZyFM7PNwVqAtogcMWPVoOlxoCAIZZ0zddnSeUCJx2u9wLtHVpUgKh5pBl0bA9k7OsT4f8oxjAZ0wILTWGi3Lf3M4FsXvsjItSPS9MJJAA= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2017 18:21:35.0465 (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: BLUPR04MB101 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 Make it possible to check whether or not a block layer queue has been stopped. Make it possible to start and to run a blk-mq queue from user space. Signed-off-by: Bart Van Assche Cc: Omar Sandoval Cc: Hannes Reinecke --- block/blk-mq-debugfs.c | 107 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 4b3f962a9c7a..9e86056d47cd 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -43,6 +43,110 @@ static int blk_mq_debugfs_seq_open(struct inode *inode, struct file *file, return ret; } +static int blk_flags_show(struct seq_file *m, const unsigned long flags, + const char *const *flag_name, int flag_name_count) +{ + bool sep = false; + int i; + + for (i = 0; i < sizeof(flags) * BITS_PER_BYTE; i++) { + if (!(flags & BIT(i))) + continue; + if (sep) + seq_puts(m, " "); + sep = true; + if (i < flag_name_count && flag_name[i]) + seq_puts(m, flag_name[i]); + else + seq_printf(m, "%d", i); + } + seq_puts(m, "\n"); + return 0; +} + +static const char *const blk_queue_flag_name[] = { + [QUEUE_FLAG_QUEUED] = "QUEUED", + [QUEUE_FLAG_STOPPED] = "STOPPED", + [QUEUE_FLAG_SYNCFULL] = "SYNCFULL", + [QUEUE_FLAG_ASYNCFULL] = "ASYNCFULL", + [QUEUE_FLAG_DYING] = "DYING", + [QUEUE_FLAG_BYPASS] = "BYPASS", + [QUEUE_FLAG_BIDI] = "BIDI", + [QUEUE_FLAG_NOMERGES] = "NOMERGES", + [QUEUE_FLAG_SAME_COMP] = "SAME_COMP", + [QUEUE_FLAG_FAIL_IO] = "FAIL_IO", + [QUEUE_FLAG_STACKABLE] = "STACKABLE", + [QUEUE_FLAG_NONROT] = "NONROT", + [QUEUE_FLAG_IO_STAT] = "IO_STAT", + [QUEUE_FLAG_DISCARD] = "DISCARD", + [QUEUE_FLAG_NOXMERGES] = "NOXMERGES", + [QUEUE_FLAG_ADD_RANDOM] = "ADD_RANDOM", + [QUEUE_FLAG_SECERASE] = "SECERASE", + [QUEUE_FLAG_SAME_FORCE] = "SAME_FORCE", + [QUEUE_FLAG_DEAD] = "DEAD", + [QUEUE_FLAG_INIT_DONE] = "INIT_DONE", + [QUEUE_FLAG_NO_SG_MERGE] = "NO_SG_MERGE", + [QUEUE_FLAG_POLL] = "POLL", + [QUEUE_FLAG_WC] = "WC", + [QUEUE_FLAG_FUA] = "FUA", + [QUEUE_FLAG_FLUSH_NQ] = "FLUSH_NQ", + [QUEUE_FLAG_DAX] = "DAX", + [QUEUE_FLAG_STATS] = "STATS", + [QUEUE_FLAG_RESTART] = "RESTART", + [QUEUE_FLAG_POLL_STATS] = "POLL_STATS", + [QUEUE_FLAG_REGISTERED] = "REGISTERED", +}; + +static int blk_queue_flags_show(struct seq_file *m, void *v) +{ + struct request_queue *q = m->private; + + blk_flags_show(m, q->queue_flags, blk_queue_flag_name, + ARRAY_SIZE(blk_queue_flag_name)); + return 0; +} + +static ssize_t blk_queue_flags_store(struct file *file, const char __user *ubuf, + size_t len, loff_t *offp) +{ + struct request_queue *q = file_inode(file)->i_private; + char op[16] = { }, *s; + + len = min(len, sizeof(op) - 1); + if (copy_from_user(op, ubuf, len)) + return -EFAULT; + s = op; + strsep(&s, " \t\n"); /* strip trailing whitespace */ + if (strcmp(op, "run") == 0) { + blk_mq_run_hw_queues(q, true); + } else if (strcmp(op, "start") == 0) { + blk_mq_start_stopped_hw_queues(q, true); + } else { + pr_err("%s: unsupported operation %s. Use either 'run' or 'start'\n", + __func__, op); + return -EINVAL; + } + return len; +} + +static int blk_queue_flags_open(struct inode *inode, struct file *file) +{ + return single_open(file, blk_queue_flags_show, inode->i_private); +} + +static const struct file_operations blk_queue_flags_fops = { + .open = blk_queue_flags_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, + .write = blk_queue_flags_store, +}; + +static const struct blk_mq_debugfs_attr blk_queue_attrs[] = { + {"state", 0600, &blk_queue_flags_fops}, + {}, +}; + static void print_stat(struct seq_file *m, struct blk_rq_stat *stat) { if (stat->nr_samples) { @@ -735,6 +839,9 @@ int blk_mq_debugfs_register_hctxs(struct request_queue *q) if (!q->debugfs_dir) return -ENOENT; + if (!debugfs_create_files(q->debugfs_dir, q, blk_queue_attrs)) + goto err; + q->mq_debugfs_dir = debugfs_create_dir("mq", q->debugfs_dir); if (!q->mq_debugfs_dir) goto err;