Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936503Ab3DHPn1 (ORCPT ); Mon, 8 Apr 2013 11:43:27 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:53177 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936279Ab3DHPn0 (ORCPT ); Mon, 8 Apr 2013 11:43:26 -0400 Date: Mon, 8 Apr 2013 08:43:19 -0700 From: Tejun Heo To: Li Zefan Cc: Andrew Morton , Glauber Costa , KAMEZAWA Hiroyuki , Michal Hocko , Johannes Weiner , LKML , Cgroups , linux-mm@kvack.org Subject: Re: [PATCH 2/8] cgroup: implement cgroup_from_id() Message-ID: <20130408154319.GD3021@htj.dyndns.org> References: <51627DA9.7020507@huawei.com> <51627DEB.4090104@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51627DEB.4090104@huawei.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 739 Lines: 25 On Mon, Apr 08, 2013 at 04:20:59PM +0800, Li Zefan wrote: > +/** > + * cgroup_from_id - lookup cgroup by id > + * @ss: cgroup subsys to be looked into. > + * @id: the id > + * > + * Returns pointer to cgroup if there is valid one with id. > + * NULL if not. Should be called under rcu_read_lock() > + */ > +struct cgroup *cgroup_from_id(struct cgroup_subsys *ss, int id) > +{ rcu_lockdep_assert(rcu_read_lock_held(), ...); > + return idr_find(&ss->root->cgroup_idr, id); Thanks. -- tejun -- 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/