]> git.baikalelectronics.ru Git - kernel.git/commit
blktrace: use existing disk debugfs directory
authorOmar Sandoval <osandov@fb.com>
Tue, 31 Jan 2017 22:53:22 +0000 (14:53 -0800)
committerJens Axboe <axboe@fb.com>
Thu, 2 Feb 2017 17:20:16 +0000 (10:20 -0700)
commit0e8613d6c220e7db93fdf9ba862518cfe5df25c8
tree1f5e064f9ecbbd55d8d72a23a4f3b7f66d411384
parent36c5c5709dae3c3ffe82584e8c39d8ee80bb8828
blktrace: use existing disk debugfs directory

We may already have a directory to put the blktrace stuff in if

1. The disk uses blk-mq
2. CONFIG_BLK_DEBUG_FS is enabled
3. We are tracing the whole disk and not a partition

Instead of hardcoding this very specific case, let's use the new
debugfs_lookup(). If the directory exists, we use it, otherwise we
create one and clean it up later.

Fixes: ffb725d7c038 ("blk-mq: create debugfs directory tree")
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
kernel/trace/blktrace.c