From patchwork Thu Sep 7 16:16:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 9942499 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 481206038C for ; Thu, 7 Sep 2017 16:17:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2030F28539 for ; Thu, 7 Sep 2017 16:17:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 14F68286CA; Thu, 7 Sep 2017 16:17:33 +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,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 7E22028539 for ; Thu, 7 Sep 2017 16:17:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755518AbdIGQRb (ORCPT ); Thu, 7 Sep 2017 12:17:31 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:6565 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754958AbdIGQRb (ORCPT ); Thu, 7 Sep 2017 12:17:31 -0400 X-IronPort-AV: E=Sophos;i="5.42,359,1500912000"; d="scan'208";a="145339978" Received: from sjappemgw12.hgst.com (HELO sjappemgw11.hgst.com) ([199.255.44.66]) by ob1.hgst.iphmx.com with ESMTP; 08 Sep 2017 00:21:41 +0800 Received: from washi.fujisawa.hgst.com ([10.149.53.254]) by sjappemgw11.hgst.com with ESMTP; 07 Sep 2017 09:16:42 -0700 From: Damien Le Moal To: linux-scsi@vger.kernel.org, "Martin K . Petersen" , linux-block@vger.kernel.org, Jens Axboe Cc: Christoph Hellwig , Bart Van Assche Subject: [PATCH V2 01/12] block: Fix declaration of blk-mq debugfs functions Date: Fri, 8 Sep 2017 01:16:29 +0900 Message-Id: <20170907161640.30465-2-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170907161640.30465-1-damien.lemoal@wdc.com> References: <20170907161640.30465-1-damien.lemoal@wdc.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 __blk_mq_debugfs_rq_show() and blk_mq_debugfs_rq_show() are exported symbols but ar eonly declared in the block internal file block/blk-mq-debugfs.h. which is not cleanly accessible to files outside of the block directory. Move the declaration of these functions to the new file include/linux/blk-mq-debugfs.h file to make the declarations cleanly available to other modules. While at it, also move the definition of the blk_mq_debugfs_attr structure to allow scheduler modules outside of the block directory to define debugfs attributes. Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn --- block/blk-mq-debugfs.h | 14 +------------- include/linux/blk-mq-debugfs.h | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 include/linux/blk-mq-debugfs.h diff --git a/block/blk-mq-debugfs.h b/block/blk-mq-debugfs.h index a182e6f97565..4ffeae84b83a 100644 --- a/block/blk-mq-debugfs.h +++ b/block/blk-mq-debugfs.h @@ -3,19 +3,7 @@ #ifdef CONFIG_BLK_DEBUG_FS -#include - -struct blk_mq_debugfs_attr { - const char *name; - umode_t mode; - int (*show)(void *, struct seq_file *); - ssize_t (*write)(void *, const char __user *, size_t, loff_t *); - /* Set either .show or .seq_ops. */ - const struct seq_operations *seq_ops; -}; - -int __blk_mq_debugfs_rq_show(struct seq_file *m, struct request *rq); -int blk_mq_debugfs_rq_show(struct seq_file *m, void *v); +#include int blk_mq_debugfs_register(struct request_queue *q); void blk_mq_debugfs_unregister(struct request_queue *q); diff --git a/include/linux/blk-mq-debugfs.h b/include/linux/blk-mq-debugfs.h new file mode 100644 index 000000000000..211537f61dce --- /dev/null +++ b/include/linux/blk-mq-debugfs.h @@ -0,0 +1,23 @@ +#ifndef BLK_MQ_DEBUGFS_H +#define BLK_MQ_DEBUGFS_H + +#ifdef CONFIG_BLK_DEBUG_FS + +#include +#include + +struct blk_mq_debugfs_attr { + const char *name; + umode_t mode; + int (*show)(void *, struct seq_file *); + ssize_t (*write)(void *, const char __user *, size_t, loff_t *); + /* Set either .show or .seq_ops. */ + const struct seq_operations *seq_ops; +}; + +int __blk_mq_debugfs_rq_show(struct seq_file *m, struct request *rq); +int blk_mq_debugfs_rq_show(struct seq_file *m, void *v); + +#endif + +#endif