aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/memcontrol.h
diff options
context:
space:
mode:
authorHirokazu Takahashi <taka@valinux.co.jp>2009-01-07 21:08:02 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-08 11:31:05 -0500
commitf8d665422603ee1b8ed04dcad4242f14d623c941 (patch)
treed872a12113998ed99ce22247091c481b9f465faa /include/linux/memcontrol.h
parent08e552c69c6930d64722de3ec18c51844d06ee28 (diff)
memcg: add mem_cgroup_disabled()
We check mem_cgroup is disabled or not by checking mem_cgroup_subsys.disabled. I think it has more references than expected, now. replacing if (mem_cgroup_subsys.disabled) with if (mem_cgroup_disabled()) give us good look, I think. [kamezawa.hiroyu@jp.fujitsu.com: fix typo] Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Li Zefan <lizf@cn.fujitsu.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/memcontrol.h')
-rw-r--r--include/linux/memcontrol.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 32c07b1852d6..472efd09118c 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -19,7 +19,7 @@
19 19
20#ifndef _LINUX_MEMCONTROL_H 20#ifndef _LINUX_MEMCONTROL_H
21#define _LINUX_MEMCONTROL_H 21#define _LINUX_MEMCONTROL_H
22 22#include <linux/cgroup.h>
23struct mem_cgroup; 23struct mem_cgroup;
24struct page_cgroup; 24struct page_cgroup;
25struct page; 25struct page;
@@ -87,6 +87,14 @@ extern long mem_cgroup_calc_reclaim(struct mem_cgroup *mem, struct zone *zone,
87#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP 87#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
88extern int do_swap_account; 88extern int do_swap_account;
89#endif 89#endif
90
91static inline bool mem_cgroup_disabled(void)
92{
93 if (mem_cgroup_subsys.disabled)
94 return true;
95 return false;
96}
97
90#else /* CONFIG_CGROUP_MEM_RES_CTLR */ 98#else /* CONFIG_CGROUP_MEM_RES_CTLR */
91struct mem_cgroup; 99struct mem_cgroup;
92 100
@@ -214,6 +222,11 @@ static inline long mem_cgroup_calc_reclaim(struct mem_cgroup *mem,
214{ 222{
215 return 0; 223 return 0;
216} 224}
225
226static inline bool mem_cgroup_disabled(void)
227{
228 return true;
229}
217#endif /* CONFIG_CGROUP_MEM_CONT */ 230#endif /* CONFIG_CGROUP_MEM_CONT */
218 231
219#endif /* _LINUX_MEMCONTROL_H */ 232#endif /* _LINUX_MEMCONTROL_H */