mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
kernfs: replace kernfs_node->u.completion with kernfs_root->deactivate_waitq
kernfs_node->u.completion is used to notify deactivation completion from kernfs_put_active() to kernfs_deactivate(). We now allow multiple racing removals of the same node and the current removal scheme is no longer correct - kernfs_remove() invocation may return before the node is properly deactivated if it races against another removal. The removal path will be restructured to address the issue. To help such restructure which requires supporting multiple waiters, this patch replaces kernfs_node->u.completion with kernfs_root->deactivate_waitq. This makes deactivation event notifications share a per-root waitqueue_head; however, the wait path is quite cold and this will also allow shaving one pointer off kernfs_node. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d92d2e6bd7
commit
ea1c472dfe
2 changed files with 13 additions and 18 deletions
|
@ -15,7 +15,7 @@
|
|||
#include <linux/lockdep.h>
|
||||
#include <linux/rbtree.h>
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/completion.h>
|
||||
#include <linux/wait.h>
|
||||
|
||||
struct file;
|
||||
struct iattr;
|
||||
|
@ -91,7 +91,6 @@ struct kernfs_node {
|
|||
struct rb_node rb;
|
||||
|
||||
union {
|
||||
struct completion *completion;
|
||||
struct kernfs_node *removed_list;
|
||||
} u;
|
||||
|
||||
|
@ -132,6 +131,7 @@ struct kernfs_root {
|
|||
/* private fields, do not use outside kernfs proper */
|
||||
struct ida ino_ida;
|
||||
struct kernfs_dir_ops *dir_ops;
|
||||
wait_queue_head_t deactivate_waitq;
|
||||
};
|
||||
|
||||
struct kernfs_open_file {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue