aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/cgroup.h7
-rw-r--r--kernel/cgroup.c49
2 files changed, 0 insertions, 56 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 900af5964f55..470073bf93d0 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -687,13 +687,6 @@ void free_css_id(struct cgroup_subsys *ss, struct cgroup_subsys_state *css);
687 687
688struct cgroup_subsys_state *css_lookup(struct cgroup_subsys *ss, int id); 688struct cgroup_subsys_state *css_lookup(struct cgroup_subsys *ss, int id);
689 689
690/*
691 * Get a cgroup whose id is greater than or equal to id under tree of root.
692 * Returning a cgroup_subsys_state or NULL.
693 */
694struct cgroup_subsys_state *css_get_next(struct cgroup_subsys *ss, int id,
695 struct cgroup_subsys_state *root, int *foundid);
696
697/* Returns true if root is ancestor of cg */ 690/* Returns true if root is ancestor of cg */
698bool css_is_ancestor(struct cgroup_subsys_state *cg, 691bool css_is_ancestor(struct cgroup_subsys_state *cg,
699 const struct cgroup_subsys_state *root); 692 const struct cgroup_subsys_state *root);
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index a32f9432666c..dfaf50d4705e 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -5416,55 +5416,6 @@ struct cgroup_subsys_state *css_lookup(struct cgroup_subsys *ss, int id)
5416} 5416}
5417EXPORT_SYMBOL_GPL(css_lookup); 5417EXPORT_SYMBOL_GPL(css_lookup);
5418 5418
5419/**
5420 * css_get_next - lookup next cgroup under specified hierarchy.
5421 * @ss: pointer to subsystem
5422 * @id: current position of iteration.
5423 * @root: pointer to css. search tree under this.
5424 * @foundid: position of found object.
5425 *
5426 * Search next css under the specified hierarchy of rootid. Calling under
5427 * rcu_read_lock() is necessary. Returns NULL if it reaches the end.
5428 */
5429struct cgroup_subsys_state *
5430css_get_next(struct cgroup_subsys *ss, int id,
5431 struct cgroup_subsys_state *root, int *foundid)
5432{
5433 struct cgroup_subsys_state *ret = NULL;
5434 struct css_id *tmp;
5435 int tmpid;
5436 int rootid = css_id(root);
5437 int depth = css_depth(root);
5438
5439 if (!rootid)
5440 return NULL;
5441
5442 BUG_ON(!ss->use_id);
5443 WARN_ON_ONCE(!rcu_read_lock_held());
5444
5445 /* fill start point for scan */
5446 tmpid = id;
5447 while (1) {
5448 /*
5449 * scan next entry from bitmap(tree), tmpid is updated after
5450 * idr_get_next().
5451 */
5452 tmp = idr_get_next(&ss->idr, &tmpid);
5453 if (!tmp)
5454 break;
5455 if (tmp->depth >= depth && tmp->stack[depth] == rootid) {
5456 ret = rcu_dereference(tmp->css);
5457 if (ret) {
5458 *foundid = tmpid;
5459 break;
5460 }
5461 }
5462 /* continue to scan from next id */
5463 tmpid = tmpid + 1;
5464 }
5465 return ret;
5466}
5467
5468/* 5419/*
5469 * get corresponding css from file open on cgroupfs directory 5420 * get corresponding css from file open on cgroupfs directory
5470 */ 5421 */