summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-02-03 14:02:55 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-07 15:42:40 -0800
commitabd54f028ec30976d6e797e7474ec91d96186a0c (patch)
tree3fc9f5240ec0dfdcb210499878e08a18a678157f /include
parenta6607930b6cd829fc7f680b48a937d827e0bb931 (diff)
downloadop-kernel-dev-abd54f028ec30976d6e797e7474ec91d96186a0c.zip
op-kernel-dev-abd54f028ec30976d6e797e7474ec91d96186a0c.tar.gz
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. v2: Refreshed on top of ("kernfs: make kernfs_deactivate() honor KERNFS_LOCKDEP flag"). Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/kernfs.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h
index 5be9f02..295a3bf 100644
--- a/include/linux/kernfs.h
+++ b/include/linux/kernfs.h
@@ -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 dentry;
@@ -92,7 +92,6 @@ struct kernfs_node {
struct rb_node rb;
union {
- struct completion *completion;
struct kernfs_node *removed_list;
} u;
@@ -133,6 +132,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 {
OpenPOWER on IntegriCloud