From patchwork Wed Feb 1 18:20:59 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: 9550521 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 0A1C660425 for ; Wed, 1 Feb 2017 18:21:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F097128425 for ; Wed, 1 Feb 2017 18:21:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E51F428435; Wed, 1 Feb 2017 18:21:13 +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=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 6AAE228433 for ; Wed, 1 Feb 2017 18:21:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751632AbdBASVN (ORCPT ); Wed, 1 Feb 2017 13:21:13 -0500 Received: from mail-sn1nam01on0051.outbound.protection.outlook.com ([104.47.32.51]:43836 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753322AbdBASVJ (ORCPT ); Wed, 1 Feb 2017 13:21:09 -0500 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=GsVt8VdaeUJSTJbaJAKo7OFBwuYTfafRjxod5OS6Mxo=; b=SDmrZ5RP2ywoVjUB8mSToN7+EB/XDJdY6YnxlTYjEw5EZY20jq8FLJCnlU6Iar90VexMZ/ucGMnYQo+c+ITUq0HsiUCo+i7uEhpgBi9JHag3Mgu+N34yXjvCxYcTDrNg1nNnVvSyWaLDhQfpZZvTS5+ATbRnOYmxSEHbT0A1LBM= Received: from BY1PR0201CA0038.namprd02.prod.outlook.com (10.160.191.176) by CO1PR02MB048.namprd02.prod.outlook.com (10.242.163.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Wed, 1 Feb 2017 18:21:07 +0000 Received: from BN1AFFO11FD034.protection.gbl (2a01:111:f400:7c10::154) by BY1PR0201CA0038.outlook.office365.com (2a01:111:e400:4814::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16 via Frontend Transport; Wed, 1 Feb 2017 18:21:06 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) 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.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 BN1AFFO11FD034.mail.protection.outlook.com (10.58.52.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.2 via Frontend Transport; Wed, 1 Feb 2017 18:21:06 +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 9C.4C.01420.9C422985; Wed, 1 Feb 2017 10:11:21 -0800 (PST) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Wed, 1 Feb 2017 10:21:00 -0800 X-AuditID: 0ac94371-7ee9b9800001058c-8b-589224c9a79a Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 51.FF.09762.C0722985; Wed, 1 Feb 2017 10:21:00 -0800 (PST) From: Bart Van Assche To: Jens Axboe CC: , Bart Van Assche , Omar Sandoval Subject: [PATCH 4/4] blk-mq-debug: Introduce debugfs_create_files() Date: Wed, 1 Feb 2017 10:20:59 -0800 Message-ID: <20170201182059.25601-5-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170201182059.25601-1-bart.vanassche@sandisk.com> References: <20170201182059.25601-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrJLMWRmVeSWpSXmKPExsXCddJ5ke5JlUkRBlt3W1usvtvPZrH3lrbF 4XtXWRyYPSY2v2P3uHy21OPzJrkA5igum5TUnMyy1CJ9uwSujMZvs1kLOsUr3s+dwNzA+EGo i5GTQ0LAROL1ystMXYxcHEICS5kkvp/6wA7hbGeUmPZyMRNM1aV/B1kgEpsZJf5s2c8GkmAT MJL49n4mC4gtIqAg0fN7JVCcg4NZoFBi9qIAkLCwgLPE62nz2UHCLAIqErfeqoCEeQXsJbY8 OcoCMV5eYlfbRVYQm1PAQeLTwi1g04WAal53/mQGWSsh8ItFYuen/ywQzYISJ2c+AbOZBSQk Dr54wQzRoC5xcsl8pgmMQrOQlM1CUraAkWkVo1huZk5xbnpqgaGJXnFiXkpmcbZecn7uJkZI ABfuYHx92/sQowAHoxIPr4DIpAgh1sSy4srcQ4wSHMxKIryVikAh3pTEyqrUovz4otKc1OJD jNIcLErivK2v+yOEBNITS1KzU1MLUotgskwcnFINjMJT5vk699xK9JaYN+PDT+2+nyrPJx+v /vz+0a5L/p/+8r+bukxcivOFWt/1Dttp8wIqHwS1vJ+Tusbr1XyLwwJ8hVXpGskX3okafd+r Uffi4fnDfx5kzJlTx+4sLSZ8ODP80OcL69bydsx4zJd/cqq5xWyLf1MtTi3/Or9J2/VZUPJs +5n/BX8psRRnJBpqMRcVJwIAJ3wxxVwCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprJJMWRmVeSWpSXmKPExsXCtZEjRZdHfVKEwd69Fhar7/azWRz82cZo sfeWtsXhe1dZHFg8Jja/Y/e4fLbUY9qa80wenzfJBbBEcdmkpOZklqUW6dslcGU0fpvNWtAp XvF+7gTmBsYPQl2MnBwSAiYSl/4dZOli5OIQEtjIKHFgfS8zSIJNwEji2/uZLCC2iICCRM/v lWwgNrNAoUTT226wGmEBZ4nX0+azdzFycLAIqErsfpIEEuYVsJd4v+MYG8R8eYldbRdZQWxO AQeJTwu3gMWFgGped/5knsDIvYCRYRWjWG5mTnFuemaBoZFecWJeSmZxtl5yfu4mRrDnOaN2 MF6faH6IkYmDU6qB0brBs+HQu++VzzcKNOxyfuXw8ZzWh5eBkkeVDbY8fqjas4d3zZ/pLwwm 6WqcY136pXXLlSsrY6MfChz+vaXry68iwzOzZ9ffivq3mvWtLOeEGa8ET2Ufz/910nRl9RLD Rzenyr9t4srnX5IivSov8NHH/58Tjj9ILXrcH7/29skV8/mt78ol3eJXYinOSDTUYi4qTgQA awXHeawBAAA= MIME-Version: 1.0 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)(39860400002)(39840400002)(39410400002)(39850400002)(39450400003)(2980300002)(438002)(189002)(199003)(81166006)(106466001)(8936002)(4326007)(81156014)(97736004)(69596002)(8676002)(47776003)(92566002)(50986999)(76176999)(86362001)(230783001)(50226002)(68736007)(2906002)(189998001)(48376002)(50466002)(5003940100001)(2270400002)(38730400001)(54906002)(110136003)(6916009)(36756003)(53936002)(33646002)(77096006)(5660300001)(626004)(305945005)(2950100002)(1076002)(356003); DIR:OUT; SFP:1101; SCL:1; SRVR:CO1PR02MB048; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD034; 1:V1YwcuwOVyOqubVBwMvbpKo6VVgmUd7xJYiaDQIc9SLH7/RlxH2r+acNuznUAjGjZdJz3K0/OBRBP6LP7MSwM83VkXCP93RLXUUrEj/qWjOMedvDdzLSPumkKRcClkRhMwQcAJp4G+mKJaOtdeYHFEB12e7myO7qwLblLZU39K9vGnPbf3wOVTdTgqyvp3YBmHDy1lRe8YgzVBJIaOLmyybs34YupZNDoO3Zl3iGSzk0BGZI3MbpR0DI1clLBhrcxtURShle1Bmk+CKN1GE2+wy+EqGdMR6kuou8pGbFJWBI3tgK6dXOXmyBa3+K69ikk0xGpbYvdFW2Yiz7imDT3Pau6Fa8729rGEgsKwKMxgrmEwkbbRgfeXVUbn3Y7qtZeB0zf1DzjihMfcwpWYRgX32qdjqspLuYDTixv7E/JN8SGPBU9mECtVrlPM4o0lzDuYpRodfJwNIx2BBpl06VOYIP4YFGNVVChVJIdBtytz6ucYPVbFSOM/RznkfwGfS8 X-MS-Office365-Filtering-Correlation-Id: 13468dde-38eb-4d48-d32e-08d44acf169c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:CO1PR02MB048; X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB048; 3:wE5Tc7iEDZ+ELe1e+PzNoCe9/xDu7lSJlRdqEkHq4fL0txUe3xi+WHLQIYH79hJrZz2byEn2AOb0uEbWkWtU6q9yxLvnygfN/9ncG3GnPf6EOXdCd3gyAuMzva78dLVIol3MNljcKAOMIPO4RIQ2JbxI2NJHgEhn1rHS21MvXwEzF1E8H9C9sCa0LWa8w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VDjfuIK56vwbfJ8698jYI8jgw/Vk+FRKMjUkjGSXZBRx5sq7OKXAe8V+qlpc7vs9e8hejGUuWlan7pWeQDINlYtA6oKgN9ags6gwLPfk4e6k9LSX3Zrlg7wHgualSkIzlGQpbn7G1hlVxV/bq2AdhWIoQ40+wD19DDCvO1N4jKP17CZSLw8agN6Y+4cZ59++eSQ3E+W5fCNJ6TdAjwcEySkwVI/ct/Yc/2YlFCaDlhz+bum6D5hUAP89ZSLlu1dIVwF1fov7l7w1kDaIv4ug0AoRtYqNnsmMWElzzGMzTfH9xWPXvjOvPgNVqrpIV+6nHN8FScrxBZBvLgoDpcXvaL4CbIgtQ8JRd88HY/idsIjWMOs4INHNzdfefaxKeildf5769mzqgwrnmy0T0eCQxTOkotrmQYuHdVE+fr0Yxzd3BeN3xyy0YjFVpGVAUmLdHZMYoNeofCaW3xaUit6tIs X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(67672495146484)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(13016025)(13018025)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123555025)(20161123562025)(20161123558025)(20161123560025)(6072148); SRVR:CO1PR02MB048; BCL:0; PCL:0; RULEID:; SRVR:CO1PR02MB048; X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB048; 4:rD4DB908wiReY1eETbCuweTQdyJplRR5DVatmq5reNJ8/CG+JMiG12zsp3QCYwTuwlsBIHwzSEWe9AflXK3L6PLh0CeP3/Fi0Q/wnDa/CsyjTwfPPdu+A2CmIZ9Lnztm8ABGxsWRuhacXdlLq/fOZcYTDjYW2f1cIJ1qCLo9mEJeZvUEoBNzocZqR0kD+dt+FRRBeeQ8Gp4KYO1nHm2+CFc65zR1yEArVI0JFhBQVNDLbrlK07Vlc540KZ88GfCBfyEC/wx/Ocpgo9tjQzhe+dWAxhOB1la0YwnYu2tImatrfYB4v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lLfeq+msaTHyb61+72O47uXmGyzshyvBTEBfXLh8cAGNaBhcEqcPSJci?= =?us-ascii?Q?U8O6aeBhijLOtUmxMElMT+GKz/5LFbIQtmdIb93LxukB2/q1PN/HxSTeNOhd?= =?us-ascii?Q?Gw2VUnZdygG8sQakN6PhutvdF7ZgdX6uN7utMM+5hTd21EeOTXvBXf+krVol?= =?us-ascii?Q?hchbFhet5KeCVFgwHKazG+dj2kKydVhl+s5UWzo+deQEv0iWJPELS69ER5E+?= =?us-ascii?Q?K9dKgX984fBu3DXSqycQ8WUBRfp/Cc0v9dPfKUCN5jPawku4WbejNC/ZVLHU?= =?us-ascii?Q?IeLpQF+MxwRiAFARiUmEQ7sMExSOQKhuiBF8a9FNULW3kO3DBWV7oWp6gyyu?= =?us-ascii?Q?zdYatriUzNpqxWW7uxGI/kZM3rkN4EmTmDC8qn8JJnDfrM9s7vWJ1HIJIUD5?= =?us-ascii?Q?WdH5sMwZEganmePpRKHBthMrRYp1Gv8GefZhF4NFVIXDxfEgHiDvOus0t9QP?= =?us-ascii?Q?kf4+F3YBX27RzON0S1oV6RZ1DQhKq9VPa8lKzCPYYPBs/arVhJaVjWwB53o4?= =?us-ascii?Q?aUovKx3Irlin+XAUHRJnlPYtk/c1pW4dSn4UP9WvcvH1rs+jqHAfLfnxxfMF?= =?us-ascii?Q?dIF89pGCAiI2um5oWcGKhZevnrwFlwV78/zVzXfH0OVRuB1KOQC0n222yKru?= =?us-ascii?Q?pLPPNT4CzgKOrjyfWwnGEnBtgUII0GFkSTEZZpXotsYv6/nltk7md5DT4/C3?= =?us-ascii?Q?oyaKquNyyvn6S4XK8r9AD9QZRi/q9BLBEvBkQIMDMTahlTXRlsYA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB048; 6:+rB4i4lwRSl0ap9ZjeJzB1yUm7zB1AOQF/B2+4M/pDgiDJyPYSpP1V+54pFz8v77aSdqVV7d8xSWR6oBeY7Mo+RRMU9tw4sIecwB5A9pe6fP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twC941/R/Oa2QAG1ZRkLH4XiT37HQY5S8CfZaUv+pcpQpqGDtuSlLpdRuvrzZCbwBKT2cO8kez99L5KauK6kXxD4KSiclkTzVwhBgsRJMf+uH+cIg3nuX+Qeb/JoH/1vFZXXUHIs5RnuKaWxOkIDQ0np3yZhe0zb0PYE5jiunzwcP7l X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2017 18:21:06.0400 (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: CO1PR02MB048 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 Replace the two debugfs_create_file() loops by a call to the new debugfs_create_files() function. Add an empty element at the end of the two attribute arrays such that the array size does not have to be passed to debugfs_create_files(). Signed-off-by: Bart Van Assche Cc: Omar Sandoval Reviewed-by: Omar Sandoval --- block/blk-mq-debugfs.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 846943728939..b3bc9f02a5f5 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -653,6 +653,7 @@ static const struct blk_mq_debugfs_attr blk_mq_debugfs_hctx_attrs[] = { {"queued", 0600, &hctx_queued_fops}, {"run", 0600, &hctx_run_fops}, {"active", 0400, &hctx_active_fops}, + {}, }; static const struct blk_mq_debugfs_attr blk_mq_debugfs_ctx_attrs[] = { @@ -660,6 +661,7 @@ static const struct blk_mq_debugfs_attr blk_mq_debugfs_ctx_attrs[] = { {"dispatched", 0600, &ctx_dispatched_fops}, {"merged", 0600, &ctx_merged_fops}, {"completed", 0600, &ctx_completed_fops}, + {}, }; int blk_mq_debugfs_register(struct request_queue *q, const char *name) @@ -688,27 +690,31 @@ void blk_mq_debugfs_unregister(struct request_queue *q) q->debugfs_dir = NULL; } +static bool debugfs_create_files(struct dentry *parent, void *data, + const struct blk_mq_debugfs_attr *attr) +{ + for (; attr->name; attr++) { + if (!debugfs_create_file(attr->name, attr->mode, parent, + data, attr->fops)) + return false; + } + return true; +} + static int blk_mq_debugfs_register_ctx(struct request_queue *q, struct blk_mq_ctx *ctx, struct dentry *hctx_dir) { struct dentry *ctx_dir; char name[20]; - int i; snprintf(name, sizeof(name), "cpu%u", ctx->cpu); ctx_dir = debugfs_create_dir(name, hctx_dir); if (!ctx_dir) return -ENOMEM; - for (i = 0; i < ARRAY_SIZE(blk_mq_debugfs_ctx_attrs); i++) { - const struct blk_mq_debugfs_attr *attr; - - attr = &blk_mq_debugfs_ctx_attrs[i]; - if (!debugfs_create_file(attr->name, attr->mode, ctx_dir, ctx, - attr->fops)) - return -ENOMEM; - } + if (!debugfs_create_files(ctx_dir, ctx, blk_mq_debugfs_ctx_attrs)) + return -ENOMEM; return 0; } @@ -726,14 +732,8 @@ static int blk_mq_debugfs_register_hctx(struct request_queue *q, if (!hctx_dir) return -ENOMEM; - for (i = 0; i < ARRAY_SIZE(blk_mq_debugfs_hctx_attrs); i++) { - const struct blk_mq_debugfs_attr *attr; - - attr = &blk_mq_debugfs_hctx_attrs[i]; - if (!debugfs_create_file(attr->name, attr->mode, hctx_dir, hctx, - attr->fops)) - return -ENOMEM; - } + if (!debugfs_create_files(hctx_dir, hctx, blk_mq_debugfs_hctx_attrs)) + return -ENOMEM; hctx_for_each_ctx(hctx, ctx, i) { if (blk_mq_debugfs_register_ctx(q, ctx, hctx_dir))