Re: [PATCH 1/5] cgroup: record ancestor IDs and reimplement cgroup_is_descendant() using it

From
Jan Engelhardt <hidden>
Date
2015-11-17 22:54:58
Also in
cgroups, lkml, netfilter-devel
Reply to
Tejun Heo, 2015-11-17
On Tuesday 2015-11-17 20:40, Tejun Heo wrote:
+static inline bool cgroup_is_descendant(struct cgroup *cgrp,
+					struct cgroup *ancestor)
(const struct group *cgrp, const struct group *ancestor)
quoted hunk ↗ jump to hunk
+{
+	if (cgrp->root != ancestor->root || cgrp->level < ancestor->level)
+		return false;
+	return cgrp->ancestor_ids[ancestor->level] == ancestor->id;
+}
Thread (22 messages) 22 messages, 4 authors, last reply 2015-11-17
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help