diff options
author | Li Zefan <lizefan@huawei.com> | 2013-08-19 10:05:24 +0800 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-08-19 09:52:18 -0400 |
commit | 1cb650b91ba582f6737457b7d22e368585596d2c (patch) | |
tree | 1a3d8d4a219dcca229dcc6dc47876091ef0f8438 /include/linux/cgroup.h | |
parent | 930913a31289202d232186b82854b26d7fb7cf4d (diff) | |
download | linux-1cb650b91ba582f6737457b7d22e368585596d2c.tar.gz linux-1cb650b91ba582f6737457b7d22e368585596d2c.tar.bz2 linux-1cb650b91ba582f6737457b7d22e368585596d2c.zip |
cgroup: change cgroup_from_id() to css_from_id()
Now we want cgroup core to always provide the css to use to the
subsystems, so change this API to css_from_id().
Uninline css_from_id(), because it's getting bigger and cgroup_css()
has been unexported.
While at it, remove the #ifdef, and shuffle the order of the args.
Signed-off-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r-- | include/linux/cgroup.h | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index c24bd0b9f93a..b685955d4b29 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -741,27 +741,11 @@ static inline struct cgroup *task_cgroup(struct task_struct *task, return task_css(task, subsys_id)->cgroup; } -/** - * cgroup_from_id - lookup cgroup by id - * @ss: cgroup subsys to be looked into - * @id: the cgroup id - * - * Returns the cgroup if there's valid one with @id, otherwise returns NULL. - * Should be called under rcu_read_lock(). - */ -static inline struct cgroup *cgroup_from_id(struct cgroup_subsys *ss, int id) -{ -#ifdef CONFIG_PROVE_RCU - rcu_lockdep_assert(rcu_read_lock_held() || - lockdep_is_held(&cgroup_mutex), - "cgroup_from_id() needs proper protection"); -#endif - return idr_find(&ss->root->cgroup_idr, id); -} - struct cgroup_subsys_state *css_next_child(struct cgroup_subsys_state *pos, struct cgroup_subsys_state *parent); +struct cgroup_subsys_state *css_from_id(int id, struct cgroup_subsys *ss); + /** * css_for_each_child - iterate through children of a css * @pos: the css * to use as the loop cursor |