Commit | Line | Data |
---|---|---|
5d1ea48b JW |
1 | #ifndef __LINUX_SWAP_CGROUP_H |
2 | #define __LINUX_SWAP_CGROUP_H | |
52d4b9ac | 3 | |
27a7faa0 | 4 | #include <linux/swap.h> |
97572751 | 5 | |
c255a458 | 6 | #ifdef CONFIG_MEMCG_SWAP |
5d1ea48b | 7 | |
02491447 DN |
8 | extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent, |
9 | unsigned short old, unsigned short new); | |
a3b2d692 | 10 | extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id); |
9fb4b7cc | 11 | extern unsigned short lookup_swap_cgroup_id(swp_entry_t ent); |
27a7faa0 KH |
12 | extern int swap_cgroup_swapon(int type, unsigned long max_pages); |
13 | extern void swap_cgroup_swapoff(int type); | |
5d1ea48b | 14 | |
27a7faa0 | 15 | #else |
27a7faa0 KH |
16 | |
17 | static inline | |
a3b2d692 | 18 | unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id) |
27a7faa0 | 19 | { |
a3b2d692 | 20 | return 0; |
27a7faa0 KH |
21 | } |
22 | ||
23 | static inline | |
9fb4b7cc | 24 | unsigned short lookup_swap_cgroup_id(swp_entry_t ent) |
27a7faa0 | 25 | { |
a3b2d692 | 26 | return 0; |
27a7faa0 KH |
27 | } |
28 | ||
29 | static inline int | |
30 | swap_cgroup_swapon(int type, unsigned long max_pages) | |
31 | { | |
32 | return 0; | |
33 | } | |
34 | ||
35 | static inline void swap_cgroup_swapoff(int type) | |
36 | { | |
37 | return; | |
38 | } | |
39 | ||
c255a458 | 40 | #endif /* CONFIG_MEMCG_SWAP */ |
6b3ae58e | 41 | |
5d1ea48b | 42 | #endif /* __LINUX_SWAP_CGROUP_H */ |