Tejun Heo 6387698699 cgroup: add css_parent()
Currently, controllers have to explicitly follow the cgroup hierarchy
to find the parent of a given css.  cgroup is moving towards using
cgroup_subsys_state as the main controller interface construct, so
let's provide a way to climb the hierarchy using just csses.

This patch implements css_parent() which, given a css, returns its
parent.  The function is guarnateed to valid non-NULL parent css as
long as the target css is not at the top of the hierarchy.

freezer, cpuset, cpu, cpuacct, hugetlb, memory, net_cls and devices
are converted to use css_parent() instead of accessing cgroup->parent
directly.

* __parent_ca() is dropped from cpuacct and its usage is replaced with
  parent_ca().  The only difference between the two was NULL test on
  cgroup->parent which is now embedded in css_parent() making the
  distinction moot.  Note that eventually a css->parent field will be
  added to css and the NULL check in css_parent() will go away.

This patch shouldn't cause any behavior differences.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
2013-08-08 20:11:23 -04:00
..
2013-08-08 20:11:23 -04:00
2011-01-19 23:31:12 -08:00
2012-09-24 16:31:37 -04:00
2011-01-19 23:31:12 -08:00
2011-01-19 23:31:12 -08:00
2011-01-19 23:31:12 -08:00
2012-07-12 07:54:46 -07:00
2013-06-11 02:51:03 -07:00
2013-06-11 02:51:03 -07:00
2012-04-01 18:11:37 -04:00
2012-12-12 00:16:47 -05:00
2012-04-01 18:11:37 -04:00
2012-04-01 18:11:37 -04:00
2013-06-11 02:51:03 -07:00
2012-04-01 18:11:37 -04:00
2012-07-12 08:33:18 -07:00
2012-04-01 18:11:37 -04:00