diff options
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r-- | include/linux/cgroup.h | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index b8bcbdeb2eac..b622d6608605 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -569,20 +569,11 @@ static inline bool cgroup_is_descendant(struct cgroup *cgrp, | |||
569 | static inline struct cgroup *cgroup_ancestor(struct cgroup *cgrp, | 569 | static inline struct cgroup *cgroup_ancestor(struct cgroup *cgrp, |
570 | int ancestor_level) | 570 | int ancestor_level) |
571 | { | 571 | { |
572 | struct cgroup *ptr; | ||
573 | |||
574 | if (cgrp->level < ancestor_level) | 572 | if (cgrp->level < ancestor_level) |
575 | return NULL; | 573 | return NULL; |
576 | 574 | while (cgrp && cgrp->level > ancestor_level) | |
577 | for (ptr = cgrp; | 575 | cgrp = cgroup_parent(cgrp); |
578 | ptr && ptr->level > ancestor_level; | 576 | return cgrp; |
579 | ptr = cgroup_parent(ptr)) | ||
580 | ; | ||
581 | |||
582 | if (ptr && ptr->level == ancestor_level) | ||
583 | return ptr; | ||
584 | |||
585 | return NULL; | ||
586 | } | 577 | } |
587 | 578 | ||
588 | /** | 579 | /** |