aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorBart Van Assche2017-04-26 15:47:49 -0500
committerJens Axboe2017-04-26 16:09:04 -0500
commit4c9e4019f1880bea7ae6e9603d14c2ed0f1c4e23 (patch)
tree2c82638c517be9601808ab270d1d3bc423831a7b /block
parent2d0364c8c1a97a1d44760895a982221c06af0f35 (diff)
downloadkernel-4c9e4019f1880bea7ae6e9603d14c2ed0f1c4e23.tar.gz
kernel-4c9e4019f1880bea7ae6e9603d14c2ed0f1c4e23.tar.xz
kernel-4c9e4019f1880bea7ae6e9603d14c2ed0f1c4e23.zip
blk-mq: Let blk_mq_debugfs_register() look up the queue name
A later patch will move the call of blk_mq_debugfs_register() to a function to which the queue name is not passed as an argument. To avoid having to add a 'name' argument to multiple callers, let blk_mq_debugfs_register() look up the queue name. Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Omar Sandoval <osandov@fb.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq-debugfs.c5
-rw-r--r--block/blk-mq-sysfs.c2
-rw-r--r--block/blk-mq.h5
3 files changed, 6 insertions, 6 deletions
diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index 3057641d5d15..e9282b945f6b 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -785,12 +785,13 @@ static const struct blk_mq_debugfs_attr blk_mq_debugfs_ctx_attrs[] = {
785 {}, 785 {},
786}; 786};
787 787
788int blk_mq_debugfs_register(struct request_queue *q, const char *name) 788int blk_mq_debugfs_register(struct request_queue *q)
789{ 789{
790 if (!blk_debugfs_root) 790 if (!blk_debugfs_root)
791 return -ENOENT; 791 return -ENOENT;
792 792
793 q->debugfs_dir = debugfs_create_dir(name, blk_debugfs_root); 793 q->debugfs_dir = debugfs_create_dir(kobject_name(q->kobj.parent),
794 blk_debugfs_root);
794 if (!q->debugfs_dir) 795 if (!q->debugfs_dir)
795 goto err; 796 goto err;
796 797
diff --git a/block/blk-mq-sysfs.c b/block/blk-mq-sysfs.c
index a2dbb1a48e72..afb3451cf8a5 100644
--- a/block/blk-mq-sysfs.c
+++ b/block/blk-mq-sysfs.c
@@ -318,7 +318,7 @@ int __blk_mq_register_dev(struct device *dev, struct request_queue *q)
318 318
319 kobject_uevent(&q->mq_kobj, KOBJ_ADD); 319 kobject_uevent(&q->mq_kobj, KOBJ_ADD);
320 320
321 blk_mq_debugfs_register(q, kobject_name(&dev->kobj)); 321 blk_mq_debugfs_register(q);
322 322
323 queue_for_each_hw_ctx(q, hctx, i) { 323 queue_for_each_hw_ctx(q, hctx, i) {
324 ret = blk_mq_register_hctx(hctx); 324 ret = blk_mq_register_hctx(hctx);
diff --git a/block/blk-mq.h b/block/blk-mq.h
index 7d955c756810..9049c0f11505 100644
--- a/block/blk-mq.h
+++ b/block/blk-mq.h
@@ -87,13 +87,12 @@ extern void blk_mq_hctx_kobj_init(struct blk_mq_hw_ctx *hctx);
87 * debugfs helpers 87 * debugfs helpers
88 */ 88 */
89#ifdef CONFIG_BLK_DEBUG_FS 89#ifdef CONFIG_BLK_DEBUG_FS
90int blk_mq_debugfs_register(struct request_queue *q, const char *name); 90int blk_mq_debugfs_register(struct request_queue *q);
91void blk_mq_debugfs_unregister(struct request_queue *q); 91void blk_mq_debugfs_unregister(struct request_queue *q);
92int blk_mq_debugfs_register_hctxs(struct request_queue *q); 92int blk_mq_debugfs_register_hctxs(struct request_queue *q);
93void blk_mq_debugfs_unregister_hctxs(struct request_queue *q); 93void blk_mq_debugfs_unregister_hctxs(struct request_queue *q);
94#else 94#else
95static inline int blk_mq_debugfs_register(struct request_queue *q, 95static inline int blk_mq_debugfs_register(struct request_queue *q)
96 const char *name)
97{ 96{
98 return 0; 97 return 0;
99} 98}