From patchwork Fri Jan 27 20:49:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 9542655 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 5BAFB601D7 for ; Fri, 27 Jan 2017 20:58:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BDAB27F99 for ; Fri, 27 Jan 2017 20:58:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3CCC728249; Fri, 27 Jan 2017 20:58:51 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 8058A27F99 for ; Fri, 27 Jan 2017 20:58:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751165AbdA0U6u (ORCPT ); Fri, 27 Jan 2017 15:58:50 -0500 Received: from mail-pf0-f182.google.com ([209.85.192.182]:36391 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750839AbdA0U6t (ORCPT ); Fri, 27 Jan 2017 15:58:49 -0500 Received: by mail-pf0-f182.google.com with SMTP id 189so75808290pfu.3 for ; Fri, 27 Jan 2017 12:58:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FAACrVSvwFJbQYedOECW1p4IPV9kpcAbIPmzoFj4JIE=; b=xDy3BAbah+47HOHyiFbOD+cJ5ftPrkEL0Qw/MFt33w3JWJaKW0HmXFFnlCbl5LUjjl ngeyRUKYB8pFENPORC8aFFb/H88UkQzuowxiugHFzpTCc1SdbUu14dvWmk17Ow3M/0Ls 85rX6maIdsfn3NzhZ/V9Ajub/0sDTSsamsPttIe058oxS+cy2X/GwFgCM9i4JGBBgaa9 3bRKFTgvxN9l/KY+bQdqZTb980ZZ4uWbjwTMTPZAnlh6rR2tMK0R97FaYNG+J3WmkhN3 N5u6VLxWbhzQ/w47Ib6IWvPy/V9DeQaKGz8l0YR7nt+LUXYtJLh5cZ6q2r3FJsmFQMoJ YjUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FAACrVSvwFJbQYedOECW1p4IPV9kpcAbIPmzoFj4JIE=; b=k4O+OqkPfYch2GrHKuuybL45JDSSXM6sCf56VsjxeDAGxYxnYmRlR2h+8wgpRiQdyQ 6Cd+qCQlJFk8pPYYRmdBB4SKudLHNcJB9H12SBEmJrXg4Ix+ZXRbypGS6ez3xFXC6Ax/ 8mAbZ+qw0MW8oSRZolzCACqF63rMm7QrQdDSVgki24F2yKb+B6gwDOBynvT/TZ+Ep5/c NNvorKQHbC68XvIGYvvh6HbmjryQ3vpKyA7ySCagjUu+CsR0i+NKSE2gXL6cU6uAjOhY 8f3TD/67Ym4Xyul7qjC7JqBqLzYQR9uSmkbMF2bjcChydsN1b8JK8V2gvSgBIV/vtvgR Vlmw== X-Gm-Message-State: AIkVDXJVE14k2GN4Zoq6w9JONf+yFF6hJ9DiyxQ4f58Ui7E4/rw7M/591nOL1raetDzHJ0Qd X-Received: by 10.99.109.143 with SMTP id i137mr11533607pgc.11.1485550182198; Fri, 27 Jan 2017 12:49:42 -0800 (PST) Received: from vader.thefacebook.com ([2620:10d:c090:200::9:9b50]) by smtp.gmail.com with ESMTPSA id j185sm13433722pgd.35.2017.01.27.12.49.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jan 2017 12:49:41 -0800 (PST) From: Omar Sandoval To: Jens Axboe , linux-block@vger.kernel.org Cc: kernel-team@fb.com Subject: [PATCH v2] blk-mq: fix debugfs compilation issues Date: Fri, 27 Jan 2017 12:49:06 -0800 Message-Id: <8ff253c312f1af002b99065b0a1e355af2d3ee9a.1485550075.git.osandov@fb.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <9980eb1d180dc482953b8e473f607bec7411e2b1.1485548245.git.osandov@fb.com> References: <9980eb1d180dc482953b8e473f607bec7411e2b1.1485548245.git.osandov@fb.com> 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 From: Omar Sandoval This fixes a couple of problems: 1. In the !CONFIG_DEBUG_FS case, the stub definitions were bogus. 2. In the !CONFIG_BLOCK case, blk-mq-debugfs.c shouldn't be compiled at all. Fix the stub definitions and add a CONFIG_BLK_DEBUG_FS Kconfig option. Fixes: 07e4fead45e6 ("blk-mq: create debugfs directory tree") Signed-off-by: Omar Sandoval --- block/Kconfig | 9 +++++++++ block/Makefile | 2 +- block/blk-mq.h | 11 ++++++----- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/block/Kconfig b/block/Kconfig index 8bf114a3858a..0a31ed745258 100644 --- a/block/Kconfig +++ b/block/Kconfig @@ -147,6 +147,15 @@ config BLK_WBT_MQ Multiqueue currently doesn't have support for IO scheduling, enabling this option is recommended. +config BLK_DEBUG_FS + bool "Block layer debugging information in debugfs" + default y + depends on DEBUG_FS + ---help--- + Include block layer debugging information in debugfs. This information + is only useful for kernel developers, but it doesn't incur any cost at + runtime. + menu "Partition Types" source "block/partitions/Kconfig" diff --git a/block/Makefile b/block/Makefile index 6cabe6bd2882..317165f8708c 100644 --- a/block/Makefile +++ b/block/Makefile @@ -26,4 +26,4 @@ obj-$(CONFIG_BLK_DEV_INTEGRITY) += bio-integrity.o blk-integrity.o t10-pi.o obj-$(CONFIG_BLK_MQ_PCI) += blk-mq-pci.o obj-$(CONFIG_BLK_DEV_ZONED) += blk-zoned.o obj-$(CONFIG_BLK_WBT) += blk-wbt.o -obj-$(CONFIG_DEBUG_FS) += blk-mq-debugfs.o +obj-$(CONFIG_BLK_DEBUG_FS) += blk-mq-debugfs.o diff --git a/block/blk-mq.h b/block/blk-mq.h index 57cdbf6c0cee..b52abd62b1b0 100644 --- a/block/blk-mq.h +++ b/block/blk-mq.h @@ -84,7 +84,7 @@ extern void blk_mq_hctx_kobj_init(struct blk_mq_hw_ctx *hctx); /* * debugfs helpers */ -#ifdef CONFIG_DEBUG_FS +#ifdef CONFIG_BLK_DEBUG_FS void blk_mq_debugfs_init(void); int blk_mq_debugfs_register(struct request_queue *q, const char *name); void blk_mq_debugfs_unregister(struct request_queue *q); @@ -95,21 +95,22 @@ static inline void blk_mq_debugfs_init(void) { } -int blk_mq_debugfs_register(struct request_queue *q, const char *name); +static inline int blk_mq_debugfs_register(struct request_queue *q, + const char *name) { return 0; } -void blk_mq_debugfs_unregister(struct request_queue *q) +static inline void blk_mq_debugfs_unregister(struct request_queue *q) { } -int blk_mq_debugfs_register_hctxs(struct request_queue *q) +static inline int blk_mq_debugfs_register_hctxs(struct request_queue *q) { return 0; } -void blk_mq_debugfs_unregister_hctxs(struct request_queue *q) +static inline void blk_mq_debugfs_unregister_hctxs(struct request_queue *q) { } #endif