diff options
author | Tejun Heo <tj@kernel.org> | 2014-05-16 13:22:48 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-05-16 13:22:48 -0400 |
commit | 5c9d535b893f30266ea29fe377cb9b002fcd76aa (patch) | |
tree | 27b1fd6e16c5b0c0729a93c4924289119033137c /kernel/cgroup.c | |
parent | 3b514d24e200fcdcde0a57c354a51d3677a86743 (diff) |
cgroup: remove css_parent()
cgroup in general is moving towards using cgroup_subsys_state as the
fundamental structural component and css_parent() was introduced to
convert from using cgroup->parent to css->parent. It was quite some
time ago and we're moving forward with making css more prominent.
This patch drops the trivial wrapper css_parent() and let the users
dereference css->parent. While at it, explicitly mark fields of css
which are public and immutable.
v2: New usage from device_cgroup.c converted.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: "David S. Miller" <davem@davemloft.net>
Acked-by: Li Zefan <lizefan@huawei.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r-- | kernel/cgroup.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 0343d7ee6d62..929bbbc539e9 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -3176,10 +3176,10 @@ css_next_descendant_pre(struct cgroup_subsys_state *pos, | |||
3176 | 3176 | ||
3177 | /* no child, visit my or the closest ancestor's next sibling */ | 3177 | /* no child, visit my or the closest ancestor's next sibling */ |
3178 | while (pos != root) { | 3178 | while (pos != root) { |
3179 | next = css_next_child(pos, css_parent(pos)); | 3179 | next = css_next_child(pos, pos->parent); |
3180 | if (next) | 3180 | if (next) |
3181 | return next; | 3181 | return next; |
3182 | pos = css_parent(pos); | 3182 | pos = pos->parent; |
3183 | } | 3183 | } |
3184 | 3184 | ||
3185 | return NULL; | 3185 | return NULL; |
@@ -3261,12 +3261,12 @@ css_next_descendant_post(struct cgroup_subsys_state *pos, | |||
3261 | return NULL; | 3261 | return NULL; |
3262 | 3262 | ||
3263 | /* if there's an unvisited sibling, visit its leftmost descendant */ | 3263 | /* if there's an unvisited sibling, visit its leftmost descendant */ |
3264 | next = css_next_child(pos, css_parent(pos)); | 3264 | next = css_next_child(pos, pos->parent); |
3265 | if (next) | 3265 | if (next) |
3266 | return css_leftmost_descendant(next); | 3266 | return css_leftmost_descendant(next); |
3267 | 3267 | ||
3268 | /* no sibling left, visit parent */ | 3268 | /* no sibling left, visit parent */ |
3269 | return css_parent(pos); | 3269 | return pos->parent; |
3270 | } | 3270 | } |
3271 | 3271 | ||
3272 | static bool cgroup_has_live_children(struct cgroup *cgrp) | 3272 | static bool cgroup_has_live_children(struct cgroup *cgrp) |