diff options
author | Michal Hocko <mhocko@suse.cz> | 2013-04-29 18:07:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 18:54:33 -0400 |
commit | 6d2488f64a240191f0733c1f32d73607916b01b7 (patch) | |
tree | 8e83c602ae560623ee9a8fc2959ce8d61e52eb03 | |
parent | 16248d8fe65ea116cc30b915e05a1c29496da120 (diff) |
cgroup: remove css_get_next
Now that we have generic and well ordered cgroup tree walkers there is
no need to keep css_get_next in the place.
Signed-off-by: Michal Hocko <mhocko@suse.cz>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Li Zefan <lizefan@huawei.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Ying Han <yinghan@google.com>
Cc: Tejun Heo <htejun@gmail.com>
Cc: Glauber Costa <glommer@parallels.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | include/linux/cgroup.h | 7 | ||||
-rw-r--r-- | kernel/cgroup.c | 49 |
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 | ||
688 | struct cgroup_subsys_state *css_lookup(struct cgroup_subsys *ss, int id); | 688 | struct 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 | */ | ||
694 | struct 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 */ |
698 | bool css_is_ancestor(struct cgroup_subsys_state *cg, | 691 | bool 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 | } |
5417 | EXPORT_SYMBOL_GPL(css_lookup); | 5417 | EXPORT_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 | */ | ||
5429 | struct cgroup_subsys_state * | ||
5430 | css_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 | */ |