diff options
author | Shaohua Li <shli@fb.com> | 2017-07-12 21:49:48 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-07-29 18:00:03 +0300 |
commit | ba16b2846a8c6965d0d35be3968bc10f6277812d (patch) | |
tree | 332d1796149f4e5eb713fcf95b44cc6177965158 /fs/kernfs/kernfs-internal.h | |
parent | 4a3ef68acacf31570066e69593de5cc49cc91638 (diff) | |
download | linux-ba16b2846a8c6965d0d35be3968bc10f6277812d.tar.xz |
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>
Diffstat (limited to 'fs/kernfs/kernfs-internal.h')
-rw-r--r-- | fs/kernfs/kernfs-internal.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/kernfs/kernfs-internal.h b/fs/kernfs/kernfs-internal.h index 2d5144ab4251..e9c226f29828 100644 --- a/fs/kernfs/kernfs-internal.h +++ b/fs/kernfs/kernfs-internal.h @@ -98,6 +98,8 @@ int kernfs_add_one(struct kernfs_node *kn); struct kernfs_node *kernfs_new_node(struct kernfs_node *parent, const char *name, umode_t mode, unsigned flags); +struct kernfs_node *kernfs_find_and_get_node_by_ino(struct kernfs_root *root, + unsigned int ino); /* * file.c |