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 /security | |
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 'security')
-rw-r--r-- | security/device_cgroup.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/security/device_cgroup.c b/security/device_cgroup.c index 7dbac4061b1c..ce14a31b1337 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c | |||
@@ -182,7 +182,7 @@ static inline bool is_devcg_online(const struct dev_cgroup *devcg) | |||
182 | static int devcgroup_online(struct cgroup_subsys_state *css) | 182 | static int devcgroup_online(struct cgroup_subsys_state *css) |
183 | { | 183 | { |
184 | struct dev_cgroup *dev_cgroup = css_to_devcgroup(css); | 184 | struct dev_cgroup *dev_cgroup = css_to_devcgroup(css); |
185 | struct dev_cgroup *parent_dev_cgroup = css_to_devcgroup(css_parent(css)); | 185 | struct dev_cgroup *parent_dev_cgroup = css_to_devcgroup(css->parent); |
186 | int ret = 0; | 186 | int ret = 0; |
187 | 187 | ||
188 | mutex_lock(&devcgroup_mutex); | 188 | mutex_lock(&devcgroup_mutex); |
@@ -455,7 +455,7 @@ static bool verify_new_ex(struct dev_cgroup *dev_cgroup, | |||
455 | static int parent_has_perm(struct dev_cgroup *childcg, | 455 | static int parent_has_perm(struct dev_cgroup *childcg, |
456 | struct dev_exception_item *ex) | 456 | struct dev_exception_item *ex) |
457 | { | 457 | { |
458 | struct dev_cgroup *parent = css_to_devcgroup(css_parent(&childcg->css)); | 458 | struct dev_cgroup *parent = css_to_devcgroup(childcg->css.parent); |
459 | 459 | ||
460 | if (!parent) | 460 | if (!parent) |
461 | return 1; | 461 | return 1; |
@@ -476,7 +476,7 @@ static int parent_has_perm(struct dev_cgroup *childcg, | |||
476 | static bool parent_allows_removal(struct dev_cgroup *childcg, | 476 | static bool parent_allows_removal(struct dev_cgroup *childcg, |
477 | struct dev_exception_item *ex) | 477 | struct dev_exception_item *ex) |
478 | { | 478 | { |
479 | struct dev_cgroup *parent = css_to_devcgroup(css_parent(&childcg->css)); | 479 | struct dev_cgroup *parent = css_to_devcgroup(childcg->css.parent); |
480 | 480 | ||
481 | if (!parent) | 481 | if (!parent) |
482 | return true; | 482 | return true; |
@@ -614,7 +614,7 @@ static int devcgroup_update_access(struct dev_cgroup *devcgroup, | |||
614 | char temp[12]; /* 11 + 1 characters needed for a u32 */ | 614 | char temp[12]; /* 11 + 1 characters needed for a u32 */ |
615 | int count, rc = 0; | 615 | int count, rc = 0; |
616 | struct dev_exception_item ex; | 616 | struct dev_exception_item ex; |
617 | struct dev_cgroup *parent = css_to_devcgroup(css_parent(&devcgroup->css)); | 617 | struct dev_cgroup *parent = css_to_devcgroup(devcgroup->css.parent); |
618 | 618 | ||
619 | if (!capable(CAP_SYS_ADMIN)) | 619 | if (!capable(CAP_SYS_ADMIN)) |
620 | return -EPERM; | 620 | return -EPERM; |