diff options
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r-- | kernel/cgroup.c | 49 |
1 files changed, 0 insertions, 49 deletions
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 | */ |