cgroup: update subsystem rebind restrictions
authorTejun Heo <tj@kernel.org>
Wed, 23 Apr 2014 15:13:16 +0000 (11:13 -0400)
committerTejun Heo <tj@kernel.org>
Wed, 23 Apr 2014 15:13:16 +0000 (11:13 -0400)
commit7fd8c565d8a501486d63d7ee07fd6582e97db437
treeb8042efd732c62e945d0825384c2bf50b82a3d9f
parent6803c006282768ec850760766a6e4eb1a6ff87df
cgroup: update subsystem rebind restrictions

Because the default root couldn't have any non-root csses attached to
it, rebinding away from it was always allowed; however, the default
hierarchy will soon host the unified hierarchy and have non-root csses
so the rebind restrictions need to be updated accordingly.

Instead of special casing rebinding from the default hierarchy and
then checking whether the source hierarchy has children cgroups, which
implies non-root csses for !dfl hierarchies, simply check whether the
source hierarchy has non-root csses for the subsystem using
css_next_child().

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