aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-08-08 20:11:27 -0400
committerTejun Heo <tj@kernel.org>2013-08-08 20:11:27 -0400
commit95109b627ba6a043c181fa5fa45d1c754dd44fbc (patch)
treec01adf53fc1ea85cfe23bbe4c7b6b59d203cf2d3
parentd99c8727e7bbc01b70e2c57e6127bfab26b868fd (diff)
cgroup: unexport cgroup_css()
cgroup_css() no longer has any user left outside cgroup.c proper and we don't want subsystems to grow new usages of the function. cgroup core should always provide the css to use to the subsystems, which will make dynamic creation and destruction of css's across the lifetime of a cgroup much more manageable than exposing the cgroup directly to subsystems and let them dereference css's from it. Make cgroup_css() a static function in cgroup.c. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com>
-rw-r--r--include/linux/cgroup.h13
-rw-r--r--kernel/cgroup.c13
2 files changed, 13 insertions, 13 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index d9a970568be9..c40e508d54e9 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -678,19 +678,6 @@ struct cgroup_subsys_state *css_parent(struct cgroup_subsys_state *css)
678} 678}
679 679
680/** 680/**
681 * cgroup_css - obtain a cgroup's css for the specified subsystem
682 * @cgrp: the cgroup of interest
683 * @subsys_id: the subsystem of interest
684 *
685 * Return @cgrp's css (cgroup_subsys_state) associated with @subsys_id.
686 */
687static inline struct cgroup_subsys_state *cgroup_css(struct cgroup *cgrp,
688 int subsys_id)
689{
690 return cgrp->subsys[subsys_id];
691}
692
693/**
694 * task_css_set_check - obtain a task's css_set with extra access conditions 681 * task_css_set_check - obtain a task's css_set with extra access conditions
695 * @task: the task to obtain css_set for 682 * @task: the task to obtain css_set for
696 * @__c: extra condition expression to be passed to rcu_dereference_check() 683 * @__c: extra condition expression to be passed to rcu_dereference_check()
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index e5bfb2a81dcb..c02a288a4e3d 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -222,6 +222,19 @@ static int cgroup_destroy_locked(struct cgroup *cgrp);
222static int cgroup_addrm_files(struct cgroup *cgrp, struct cftype cfts[], 222static int cgroup_addrm_files(struct cgroup *cgrp, struct cftype cfts[],
223 bool is_add); 223 bool is_add);
224 224
225/**
226 * cgroup_css - obtain a cgroup's css for the specified subsystem
227 * @cgrp: the cgroup of interest
228 * @subsys_id: the subsystem of interest
229 *
230 * Return @cgrp's css (cgroup_subsys_state) associated with @subsys_id.
231 */
232static struct cgroup_subsys_state *cgroup_css(struct cgroup *cgrp,
233 int subsys_id)
234{
235 return cgrp->subsys[subsys_id];
236}
237
225/* convenient tests for these bits */ 238/* convenient tests for these bits */
226static inline bool cgroup_is_dead(const struct cgroup *cgrp) 239static inline bool cgroup_is_dead(const struct cgroup *cgrp)
227{ 240{