Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755079AbbKQWy6 (ORCPT ); Tue, 17 Nov 2015 17:54:58 -0500 Received: from ares41.inai.de ([46.4.122.207]:35882 "EHLO ares41.inai.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751694AbbKQWy4 (ORCPT ); Tue, 17 Nov 2015 17:54:56 -0500 Date: Tue, 17 Nov 2015 23:54:54 +0100 (CET) From: Jan Engelhardt To: Tejun Heo cc: davem@davemloft.net, pablo@netfilter.org, kaber@trash.net, kadlec@blackhole.kfki.hu, lizefan@huawei.com, hannes@cmpxchg.org, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, daniel@iogearbox.net, daniel.wagner@bmw-carit.de, nhorman@tuxdriver.com Subject: Re: [PATCH 1/5] cgroup: record ancestor IDs and reimplement cgroup_is_descendant() using it In-Reply-To: <1447789240-29394-2-git-send-email-tj@kernel.org> Message-ID: References: <1447789240-29394-1-git-send-email-tj@kernel.org> <1447789240-29394-2-git-send-email-tj@kernel.org> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 605 Lines: 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) >+{ >+ if (cgrp->root != ancestor->root || cgrp->level < ancestor->level) >+ return false; >+ return cgrp->ancestor_ids[ancestor->level] == ancestor->id; >+} -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/