From: Li Zefan Subject: Re: [PATCH 2/3] cgroup: add cgroup_name() API Date: Wed, 27 Feb 2013 18:49:12 +0800 Message-ID: <512DE4A8.5050303@huawei.com> References: <512B01FA.5020506@huawei.com> <512B020D.9040504@huawei.com> <20130226022703.GA13837@htj.dyndns.org> <512C8D84.7090707@huawei.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Tejun Heo Cc: Al Viro , LKML , Cgroups On 2013/2/26 21:26, Tejun Heo wrote: > Hello, > > On Tue, Feb 26, 2013 at 2:25 AM, Li Zefan wrote: >> Sure we can. We'll have to allocate cgrp->name in cgroup_remount() and >> cgroup_init(), and free cgrp->name in cgroup_kill_sb(). It looks to me >> the current version is a bit simpler. > > Can't we just set it to constant "/"? Root cgroup init is a separate > path anyway. > Well, cgrp->name is a pointer to struct cgroup_name. At first I tried to declare cgrp->name as char *, and use container_of() to get struct cgroup_name, but it didn't result in simpler code. So seems there's no way that is a pure win over another.