diff options
author | Tejun Heo <tj@kernel.org> | 2014-02-03 20:09:12 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-08 00:52:48 +0100 |
commit | d35258ef702cca0c4e66d799f8e38b78c02ce8a5 (patch) | |
tree | f3d98795cf620ad32edd4df982d015cfeedd1a97 /tools | |
parent | kernfs: add missing kernfs_active() checks in directory operations (diff) | |
download | linux-d35258ef702cca0c4e66d799f8e38b78c02ce8a5.tar.xz linux-d35258ef702cca0c4e66d799f8e38b78c02ce8a5.zip |
kernfs: allow nodes to be created in the deactivated state
Currently, kernfs_nodes are made visible to userland on creation,
which makes it difficult for kernfs users to atomically succeed or
fail creation of multiple nodes. In addition, if something fails
after creating some nodes, the created nodes might already be in use
and their active refs need to be drained for removal, which has the
potential to introduce tricky reverse locking dependency on active_ref
depending on how the error path is synchronized.
This patch introduces per-root flag KERNFS_ROOT_CREATE_DEACTIVATED.
If set, all nodes under the root are created in the deactivated state
and stay invisible to userland until explicitly enabled by the new
kernfs_activate() API. Also, nodes which have never been activated
are guaranteed to bypass draining on removal thus allowing error paths
to not worry about lockding dependency on active_ref draining.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions