Skip to content

Commit

Permalink
cgroup: unexport cgroup_css()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tejun Heo committed Aug 9, 2013
1 parent d99c872 commit 95109b6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
13 changes: 0 additions & 13 deletions include/linux/cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -677,19 +677,6 @@ struct cgroup_subsys_state *css_parent(struct cgroup_subsys_state *css)
return &parent_cgrp->dummy_css;
}

/**
* cgroup_css - obtain a cgroup's css for the specified subsystem
* @cgrp: the cgroup of interest
* @subsys_id: the subsystem of interest
*
* Return @cgrp's css (cgroup_subsys_state) associated with @subsys_id.
*/
static inline struct cgroup_subsys_state *cgroup_css(struct cgroup *cgrp,
int subsys_id)
{
return cgrp->subsys[subsys_id];
}

/**
* task_css_set_check - obtain a task's css_set with extra access conditions
* @task: the task to obtain css_set for
Expand Down
13 changes: 13 additions & 0 deletions kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,19 @@ static int cgroup_destroy_locked(struct cgroup *cgrp);
static int cgroup_addrm_files(struct cgroup *cgrp, struct cftype cfts[],
bool is_add);

/**
* cgroup_css - obtain a cgroup's css for the specified subsystem
* @cgrp: the cgroup of interest
* @subsys_id: the subsystem of interest
*
* Return @cgrp's css (cgroup_subsys_state) associated with @subsys_id.
*/
static struct cgroup_subsys_state *cgroup_css(struct cgroup *cgrp,
int subsys_id)
{
return cgrp->subsys[subsys_id];
}

/* convenient tests for these bits */
static inline bool cgroup_is_dead(const struct cgroup *cgrp)
{
Expand Down

0 comments on commit 95109b6

Please sign in to comment.