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 /kernel/cgroup.c | |
parent | ad2ed2b35b76f01a876230a3a632efbc81d3fcd6 (diff) | |
download | op-kernel-dev-052c3f3a0b03651d94050d917ebc1df46a31c2f0.zip op-kernel-dev-052c3f3a0b03651d94050d917ebc1df46a31c2f0.tar.gz |
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>
Diffstat (limited to 'kernel/cgroup.c')
-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 855313d..ab5c9a5 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -428,6 +428,22 @@ static inline bool cgroup_is_dead(const struct cgroup *cgrp) return !(cgrp->self.flags & CSS_ONLINE); } +static void cgroup_get(struct cgroup *cgrp) +{ + WARN_ON_ONCE(cgroup_is_dead(cgrp)); + css_get(&cgrp->self); +} + +static bool cgroup_tryget(struct cgroup *cgrp) +{ + return css_tryget(&cgrp->self); +} + +static void cgroup_put(struct cgroup *cgrp) +{ + css_put(&cgrp->self); +} + struct cgroup_subsys_state *of_css(struct kernfs_open_file *of) { struct cgroup *cgrp = of->kn->parent->priv; @@ -1177,22 +1193,6 @@ static umode_t cgroup_file_mode(const struct cftype *cft) return mode; } -static void cgroup_get(struct cgroup *cgrp) -{ - WARN_ON_ONCE(cgroup_is_dead(cgrp)); - css_get(&cgrp->self); -} - -static bool cgroup_tryget(struct cgroup *cgrp) -{ - return css_tryget(&cgrp->self); -} - -static void cgroup_put(struct cgroup *cgrp) -{ - css_put(&cgrp->self); -} - /** * cgroup_calc_child_subsys_mask - calculate child_subsys_mask * @cgrp: the target cgroup |