aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/swap_cgroup.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/swap_cgroup.h')
-rw-r--r--include/linux/swap_cgroup.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/linux/swap_cgroup.h b/include/linux/swap_cgroup.h
new file mode 100644
index 000000000000..145306bdc92f
--- /dev/null
+++ b/include/linux/swap_cgroup.h
@@ -0,0 +1,42 @@
1#ifndef __LINUX_SWAP_CGROUP_H
2#define __LINUX_SWAP_CGROUP_H
3
4#include <linux/swap.h>
5
6#ifdef CONFIG_MEMCG_SWAP
7
8extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent,
9 unsigned short old, unsigned short new);
10extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id);
11extern unsigned short lookup_swap_cgroup_id(swp_entry_t ent);
12extern int swap_cgroup_swapon(int type, unsigned long max_pages);
13extern void swap_cgroup_swapoff(int type);
14
15#else
16
17static inline
18unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id)
19{
20 return 0;
21}
22
23static inline
24unsigned short lookup_swap_cgroup_id(swp_entry_t ent)
25{
26 return 0;
27}
28
29static inline int
30swap_cgroup_swapon(int type, unsigned long max_pages)
31{
32 return 0;
33}
34
35static inline void swap_cgroup_swapoff(int type)
36{
37 return;
38}
39
40#endif /* CONFIG_MEMCG_SWAP */
41
42#endif /* __LINUX_SWAP_CGROUP_H */