linux-kernel-test/fs/sysfs
Tejun Heo d35258ef70 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>
2014-02-07 15:52:48 -08:00
..
dir.c kernfs: add @mode to kernfs_create_dir[_ns]() 2013-12-17 08:59:15 -08:00
file.c sysfs, driver-core: remove unused {sysfs|device}_schedule_callback_owner() 2014-02-07 15:42:41 -08:00
group.c kernfs: add @mode to kernfs_create_dir[_ns]() 2013-12-17 08:59:15 -08:00
Kconfig kconfig: rename CONFIG_EMBEDDED to CONFIG_EXPERT 2011-01-20 17:02:05 -08:00
Makefile sysfs, kernfs: move inode code to fs/kernfs/inode.c 2013-11-29 17:55:10 -08:00
mount.c kernfs: allow nodes to be created in the deactivated state 2014-02-07 15:52:48 -08:00
symlink.c kernfs: s/sysfs/kernfs/ in constants 2013-12-11 17:39:20 -08:00
sysfs.h kernfs: s/sysfs_dirent/kernfs_node/ and rename its friends accordingly 2013-12-11 15:28:36 -08:00