Re: [PATCH 06/12] cgroups: Add res counter common ancestorsearching

From: Andrew Morton
Date: Tue Sep 06 2011 - 18:22:04 EST


On Tue, 6 Sep 2011 02:13:00 +0200
Frederic Weisbecker <fweisbec@xxxxxxxxx> wrote:

> +struct res_counter *
> +res_counter_common_ancestor(struct res_counter *r1, struct res_counter *r2)
> +{
> + struct res_counter *iter;
> +
> + while (r1) {
> + iter = r2;
> + while (iter) {
> + if (iter == r1)
> + return iter;
> + iter = iter->parent;
> + }
> +
> + r1 = r1->parent;
> + }
> +
> + return NULL;
> +}

cgroup_mutex, one assumes?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/