Skip to content

Commit

Permalink
blk-mq: Let blk_mq_debugfs_register() look up the queue name
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Omar Sandoval <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Bart Van Assche authored and axboe committed Apr 26, 2017
1 parent 2d0364c commit 4c9e401
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions block/blk-mq-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,12 +785,13 @@ static const struct blk_mq_debugfs_attr blk_mq_debugfs_ctx_attrs[] = {
{},
};

int blk_mq_debugfs_register(struct request_queue *q, const char *name)
int blk_mq_debugfs_register(struct request_queue *q)
{
if (!blk_debugfs_root)
return -ENOENT;

q->debugfs_dir = debugfs_create_dir(name, blk_debugfs_root);
q->debugfs_dir = debugfs_create_dir(kobject_name(q->kobj.parent),
blk_debugfs_root);
if (!q->debugfs_dir)
goto err;

Expand Down
2 changes: 1 addition & 1 deletion block/blk-mq-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ int __blk_mq_register_dev(struct device *dev, struct request_queue *q)

kobject_uevent(&q->mq_kobj, KOBJ_ADD);

blk_mq_debugfs_register(q, kobject_name(&dev->kobj));
blk_mq_debugfs_register(q);

queue_for_each_hw_ctx(q, hctx, i) {
ret = blk_mq_register_hctx(hctx);
Expand Down
5 changes: 2 additions & 3 deletions block/blk-mq.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,12 @@ extern void blk_mq_hctx_kobj_init(struct blk_mq_hw_ctx *hctx);
* debugfs helpers
*/
#ifdef CONFIG_BLK_DEBUG_FS
int blk_mq_debugfs_register(struct request_queue *q, const char *name);
int blk_mq_debugfs_register(struct request_queue *q);
void blk_mq_debugfs_unregister(struct request_queue *q);
int blk_mq_debugfs_register_hctxs(struct request_queue *q);
void blk_mq_debugfs_unregister_hctxs(struct request_queue *q);
#else
static inline int blk_mq_debugfs_register(struct request_queue *q,
const char *name)
static inline int blk_mq_debugfs_register(struct request_queue *q)
{
return 0;
}
Expand Down

0 comments on commit 4c9e401

Please sign in to comment.