aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/cgroup_subsys.h6
-rw-r--r--include/linux/hugetlb_cgroup.h37
2 files changed, 43 insertions, 0 deletions
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h
index 0bd390ce98b2..5b41ce079024 100644
--- a/include/linux/cgroup_subsys.h
+++ b/include/linux/cgroup_subsys.h
@@ -72,3 +72,9 @@ SUBSYS(net_prio)
72#endif 72#endif
73 73
74/* */ 74/* */
75
76#ifdef CONFIG_CGROUP_HUGETLB
77SUBSYS(hugetlb)
78#endif
79
80/* */
diff --git a/include/linux/hugetlb_cgroup.h b/include/linux/hugetlb_cgroup.h
new file mode 100644
index 000000000000..f19889e56b47
--- /dev/null
+++ b/include/linux/hugetlb_cgroup.h
@@ -0,0 +1,37 @@
1/*
2 * Copyright IBM Corporation, 2012
3 * Author Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2.1 of the GNU Lesser General Public License
7 * as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it would be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 *
13 */
14
15#ifndef _LINUX_HUGETLB_CGROUP_H
16#define _LINUX_HUGETLB_CGROUP_H
17
18#include <linux/res_counter.h>
19
20struct hugetlb_cgroup;
21
22#ifdef CONFIG_CGROUP_HUGETLB
23static inline bool hugetlb_cgroup_disabled(void)
24{
25 if (hugetlb_subsys.disabled)
26 return true;
27 return false;
28}
29
30#else
31static inline bool hugetlb_cgroup_disabled(void)
32{
33 return true;
34}
35
36#endif /* CONFIG_MEM_RES_CTLR_HUGETLB */
37#endif