Skip to content

Commit

Permalink
cgroup: remove cgroup_is_descendant()
Browse files Browse the repository at this point in the history
It was used by ns cgroup, and ns cgroup was removed long ago.

Signed-off-by: Li Zefan <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
  • Loading branch information
lizf-os authored and htejun committed Mar 12, 2013
1 parent cfb5966 commit e7b2dcc
Showing 2 changed files with 0 additions and 31 deletions.
3 changes: 0 additions & 3 deletions include/linux/cgroup.h
Original file line number Diff line number Diff line change
@@ -448,9 +448,6 @@ int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen);

int cgroup_task_count(const struct cgroup *cgrp);

/* Return true if cgrp is a descendant of the task's cgroup */
int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task);

/*
* Control Group taskset, used to pass around set of tasks to cgroup_subsys
* methods.
28 changes: 0 additions & 28 deletions kernel/cgroup.c
Original file line number Diff line number Diff line change
@@ -5035,34 +5035,6 @@ void cgroup_exit(struct task_struct *tsk, int run_callbacks)
put_css_set_taskexit(cg);
}

/**
* cgroup_is_descendant - see if @cgrp is a descendant of @task's cgrp
* @cgrp: the cgroup in question
* @task: the task in question
*
* See if @cgrp is a descendant of @task's cgroup in the appropriate
* hierarchy.
*
* If we are sending in dummytop, then presumably we are creating
* the top cgroup in the subsystem.
*
* Called only by the ns (nsproxy) cgroup.
*/
int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task)
{
int ret;
struct cgroup *target;

if (cgrp == dummytop)
return 1;

target = task_cgroup_from_root(task, cgrp->root);
while (cgrp != target && cgrp!= cgrp->top_cgroup)
cgrp = cgrp->parent;
ret = (cgrp == target);
return ret;
}

static void check_for_release(struct cgroup *cgrp)
{
/* All of these checks rely on RCU to keep the cgroup

0 comments on commit e7b2dcc

Please sign in to comment.