kernfs: add kernfs_ops->open/release() callbacks
Add ->open/release() methods to kernfs_ops. ->open() is called when the file is opened and ->release() when the file is either released or severed. These callbacks can be used, for example, to manage persistent caching objects over multiple seq_file iterations. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Acked-by: Zefan Li <lizefan@huawei.com>
This commit is contained in:
@@ -468,7 +468,7 @@ static void kernfs_drain(struct kernfs_node *kn)
|
||||
rwsem_release(&kn->dep_map, 1, _RET_IP_);
|
||||
}
|
||||
|
||||
kernfs_unmap_bin_file(kn);
|
||||
kernfs_drain_open_files(kn);
|
||||
|
||||
mutex_lock(&kernfs_mutex);
|
||||
}
|
||||
|
Reference in New Issue
Block a user