Johannes Weiner | 5d1ea48 | 2014-12-10 15:44:55 -0800 | [diff] [blame] | 1 | #ifndef __LINUX_SWAP_CGROUP_H |
| 2 | #define __LINUX_SWAP_CGROUP_H |
KAMEZAWA Hiroyuki | 52d4b9a | 2008-10-18 20:28:16 -0700 | [diff] [blame] | 3 | |
KAMEZAWA Hiroyuki | 27a7faa | 2009-01-07 18:07:58 -0800 | [diff] [blame] | 4 | #include <linux/swap.h> |
Jaswinder Singh Rajput | 9757275 | 2009-09-20 16:20:44 +0530 | [diff] [blame] | 5 | |
Andrew Morton | c255a45 | 2012-07-31 16:43:02 -0700 | [diff] [blame] | 6 | #ifdef CONFIG_MEMCG_SWAP |
Johannes Weiner | 5d1ea48 | 2014-12-10 15:44:55 -0800 | [diff] [blame] | 7 | |
Daisuke Nishimura | 0249144 | 2010-03-10 15:22:17 -0800 | [diff] [blame] | 8 | extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent, |
| 9 | unsigned short old, unsigned short new); |
KAMEZAWA Hiroyuki | a3b2d69 | 2009-04-02 16:57:45 -0700 | [diff] [blame] | 10 | extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id); |
Bob Liu | 9fb4b7c | 2012-01-12 17:18:48 -0800 | [diff] [blame] | 11 | extern unsigned short lookup_swap_cgroup_id(swp_entry_t ent); |
KAMEZAWA Hiroyuki | 27a7faa | 2009-01-07 18:07:58 -0800 | [diff] [blame] | 12 | extern int swap_cgroup_swapon(int type, unsigned long max_pages); |
| 13 | extern void swap_cgroup_swapoff(int type); |
Johannes Weiner | 5d1ea48 | 2014-12-10 15:44:55 -0800 | [diff] [blame] | 14 | |
KAMEZAWA Hiroyuki | 27a7faa | 2009-01-07 18:07:58 -0800 | [diff] [blame] | 15 | #else |
KAMEZAWA Hiroyuki | 27a7faa | 2009-01-07 18:07:58 -0800 | [diff] [blame] | 16 | |
| 17 | static inline |
KAMEZAWA Hiroyuki | a3b2d69 | 2009-04-02 16:57:45 -0700 | [diff] [blame] | 18 | unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id) |
KAMEZAWA Hiroyuki | 27a7faa | 2009-01-07 18:07:58 -0800 | [diff] [blame] | 19 | { |
KAMEZAWA Hiroyuki | a3b2d69 | 2009-04-02 16:57:45 -0700 | [diff] [blame] | 20 | return 0; |
KAMEZAWA Hiroyuki | 27a7faa | 2009-01-07 18:07:58 -0800 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | static inline |
Bob Liu | 9fb4b7c | 2012-01-12 17:18:48 -0800 | [diff] [blame] | 24 | unsigned short lookup_swap_cgroup_id(swp_entry_t ent) |
KAMEZAWA Hiroyuki | 27a7faa | 2009-01-07 18:07:58 -0800 | [diff] [blame] | 25 | { |
KAMEZAWA Hiroyuki | a3b2d69 | 2009-04-02 16:57:45 -0700 | [diff] [blame] | 26 | return 0; |
KAMEZAWA Hiroyuki | 27a7faa | 2009-01-07 18:07:58 -0800 | [diff] [blame] | 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 | |
Andrew Morton | c255a45 | 2012-07-31 16:43:02 -0700 | [diff] [blame] | 40 | #endif /* CONFIG_MEMCG_SWAP */ |
Johannes Weiner | 6b3ae58 | 2011-03-23 16:42:30 -0700 | [diff] [blame] | 41 | |
Johannes Weiner | 5d1ea48 | 2014-12-10 15:44:55 -0800 | [diff] [blame] | 42 | #endif /* __LINUX_SWAP_CGROUP_H */ |