UPSTREAM: debugfs: add debugfs_lookup()
authorOmar Sandoval <osandov@fb.com>
Tue, 31 Jan 2017 22:53:17 +0000 (14:53 -0800)
committerHuang, Tao <huangtao@rock-chips.com>
Wed, 26 Jul 2017 07:07:32 +0000 (15:07 +0800)
commitf31b9c8fe74cecdd169d19170c1d6067325a9ac9
tree186959ca93d703750a799ab5941e1a853da61a21
parent0a3e4581f0ce66169df0fb32daccb6daa03f39aa
UPSTREAM: debugfs: add debugfs_lookup()

We don't always have easy access to the dentry of a file or directory we
created in debugfs. Add a helper which allows us to get a dentry we
previously created.

The motivation for this change is a problem with blktrace and the blk-mq
debugfs entries introduced in 07e4fead45e6 ("blk-mq: create debugfs
directory tree"). Namely, in some cases, the directory that blktrace
needs to create may already exist, but in other cases, it may not. We
_could_ rely on a bunch of implied knowledge to decide whether to create
the directory or not, but it's much cleaner on our end to just look it
up.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit a7c5437b0bbec5165df6eb1efc5e37dc40b9e05d)

Change-Id: I77b6f2c7df32f904099d23771a53065315cfdc12
fs/debugfs/inode.c
include/linux/debugfs.h