diff options
author | Tejun Heo <tj@kernel.org> | 2015-10-15 16:41:50 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2015-10-15 16:41:50 -0400 |
commit | 052c3f3a0b03651d94050d917ebc1df46a31c2f0 (patch) | |
tree | b27c394febdb8b51735934e1e4f41a1911667165 | |
parent | ad2ed2b35b76f01a876230a3a632efbc81d3fcd6 (diff) |
cgroup: relocate cgroup_[try]get/put()
Relocate cgroup_get(), cgroup_tryget() and cgroup_put() upwards. This
is pure code reorganization to prepare for future changes.
Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r-- | kernel/cgroup.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 855313d01e85..ab5c9a5a0596 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -428,6 +428,22 @@ static inline bool cgroup_is_dead(const struct cgroup *cgrp) | |||
428 | return !(cgrp->self.flags & CSS_ONLINE); | 428 | return !(cgrp->self.flags & CSS_ONLINE); |
429 | } | 429 | } |
430 | 430 | ||
431 | static void cgroup_get(struct cgroup *cgrp) | ||
432 | { | ||
433 | WARN_ON_ONCE(cgroup_is_dead(cgrp)); | ||
434 | css_get(&cgrp->self); | ||
435 | } | ||
436 | |||
437 | static bool cgroup_tryget(struct cgroup *cgrp) | ||
438 | { | ||
439 | return css_tryget(&cgrp->self); | ||
440 | } | ||
441 | |||
442 | static void cgroup_put(struct cgroup *cgrp) | ||
443 | { | ||
444 | css_put(&cgrp->self); | ||
445 | } | ||
446 | |||
431 | struct cgroup_subsys_state *of_css(struct kernfs_open_file *of) | 447 | struct cgroup_subsys_state *of_css(struct kernfs_open_file *of) |
432 | { | 448 | { |
433 | struct cgroup *cgrp = of->kn->parent->priv; | 449 | struct cgroup *cgrp = of->kn->parent->priv; |
@@ -1177,22 +1193,6 @@ static umode_t cgroup_file_mode(const struct cftype *cft) | |||
1177 | return mode; | 1193 | return mode; |
1178 | } | 1194 | } |
1179 | 1195 | ||
1180 | static void cgroup_get(struct cgroup *cgrp) | ||
1181 | { | ||
1182 | WARN_ON_ONCE(cgroup_is_dead(cgrp)); | ||
1183 | css_get(&cgrp->self); | ||
1184 | } | ||
1185 | |||
1186 | static bool cgroup_tryget(struct cgroup *cgrp) | ||
1187 | { | ||
1188 | return css_tryget(&cgrp->self); | ||
1189 | } | ||
1190 | |||
1191 | static void cgroup_put(struct cgroup *cgrp) | ||
1192 | { | ||
1193 | css_put(&cgrp->self); | ||
1194 | } | ||
1195 | |||
1196 | /** | 1196 | /** |
1197 | * cgroup_calc_child_subsys_mask - calculate child_subsys_mask | 1197 | * cgroup_calc_child_subsys_mask - calculate child_subsys_mask |
1198 | * @cgrp: the target cgroup | 1198 | * @cgrp: the target cgroup |