[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4FD9A6B6.50503@huawei.com>
Date: Thu, 14 Jun 2012 16:54:14 +0800
From: Li Zefan <lizefan@...wei.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
CC: <linux-mm@...ck.org>, <kamezawa.hiroyu@...fujitsu.com>,
<dhillf@...il.com>, <rientjes@...gle.com>, <mhocko@...e.cz>,
<akpm@...ux-foundation.org>, <hannes@...xchg.org>,
<linux-kernel@...r.kernel.org>, <cgroups@...r.kernel.org>
Subject: Re: [PATCH -V9 09/15] mm/hugetlb: Add new HugeTLB cgroup
> +static inline
> +struct hugetlb_cgroup *hugetlb_cgroup_from_css(struct cgroup_subsys_state *s)
> +{
> + if (s)
Neither cgroup_subsys_state() or task_subsys_state() will ever return NULL,
so here 's' won't be NULL.
> + return container_of(s, struct hugetlb_cgroup, css);
> + return NULL;
> +}
> +
> +static inline
> +struct hugetlb_cgroup *hugetlb_cgroup_from_cgroup(struct cgroup *cgroup)
> +{
> + return hugetlb_cgroup_from_css(cgroup_subsys_state(cgroup,
> + hugetlb_subsys_id));
> +}
> +
> +static inline
> +struct hugetlb_cgroup *hugetlb_cgroup_from_task(struct task_struct *task)
> +{
> + return hugetlb_cgroup_from_css(task_subsys_state(task,
> + hugetlb_subsys_id));
> +}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists