OSDN Git Service

cgroup: use cgroup_kn_lock_live() in other cgroup kernfs methods
authorTejun Heo <tj@kernel.org>
Tue, 13 May 2014 16:19:23 +0000 (12:19 -0400)
committerTejun Heo <tj@kernel.org>
Tue, 13 May 2014 16:19:23 +0000 (12:19 -0400)
commite76ecaeef65c497153ceacf59c2e21c070d43f64
tree5acc9ee3074440a3802526998ffdbd6fc0c2beff
parenta9746d8da786bc79b3b4ae1baa0fbbc4b795c1b7
cgroup: use cgroup_kn_lock_live() in other cgroup kernfs methods

Make __cgroup_procs_write() and cgroup_release_agent_write() use
cgroup_kn_lock_live() and cgroup_kn_unlock() instead of
cgroup_lock_live_group().  This puts the operations under both
cgroup_tree_mutex and cgroup_mutex protection without circular
dependency from kernfs active protection.  Also, this means that
cgroup_mutex is no longer nested below kernfs active protection.
There is no longer any place where the two locks interact.

This leaves cgroup_lock_live_group() without any user.  Removed.

This will help simplifying cgroup locking.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
kernel/cgroup.c