kernfs: add an API to get kernfs node from inode number
authorShaohua Li <shli@fb.com>
Wed, 12 Jul 2017 18:49:48 +0000 (11:49 -0700)
committerJens Axboe <axboe@kernel.dk>
Sat, 29 Jul 2017 15:00:03 +0000 (09:00 -0600)
commitba16b2846a8c6965d0d35be3968bc10f6277812d
tree332d1796149f4e5eb713fcf95b44cc6177965158
parent4a3ef68acacf31570066e69593de5cc49cc91638
kernfs: add an API to get kernfs node from inode number

Add an API to get kernfs node from inode number. We will need this to
implement exportfs operations.

This API will be used in blktrace too later, so it should be as fast as
possible. To make the API lock free, kernfs node is freed in RCU
context. And we depend on kernfs_node count/ino number to filter out
stale kernfs nodes.

Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/kernfs/dir.c
fs/kernfs/kernfs-internal.h
fs/kernfs/mount.c