2014-12-11 07:44:55 +08:00
|
|
|
#ifndef __LINUX_SWAP_CGROUP_H
|
|
|
|
#define __LINUX_SWAP_CGROUP_H
|
2008-10-19 11:28:16 +08:00
|
|
|
|
2009-01-08 10:07:58 +08:00
|
|
|
#include <linux/swap.h>
|
2009-09-20 18:50:44 +08:00
|
|
|
|
2012-08-01 07:43:02 +08:00
|
|
|
#ifdef CONFIG_MEMCG_SWAP
|
2014-12-11 07:44:55 +08:00
|
|
|
|
2010-03-11 07:22:17 +08:00
|
|
|
extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent,
|
|
|
|
unsigned short old, unsigned short new);
|
2009-04-03 07:57:45 +08:00
|
|
|
extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id);
|
2012-01-13 09:18:48 +08:00
|
|
|
extern unsigned short lookup_swap_cgroup_id(swp_entry_t ent);
|
2009-01-08 10:07:58 +08:00
|
|
|
extern int swap_cgroup_swapon(int type, unsigned long max_pages);
|
|
|
|
extern void swap_cgroup_swapoff(int type);
|
2014-12-11 07:44:55 +08:00
|
|
|
|
2009-01-08 10:07:58 +08:00
|
|
|
#else
|
|
|
|
|
|
|
|
static inline
|
2009-04-03 07:57:45 +08:00
|
|
|
unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id)
|
2009-01-08 10:07:58 +08:00
|
|
|
{
|
2009-04-03 07:57:45 +08:00
|
|
|
return 0;
|
2009-01-08 10:07:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline
|
2012-01-13 09:18:48 +08:00
|
|
|
unsigned short lookup_swap_cgroup_id(swp_entry_t ent)
|
2009-01-08 10:07:58 +08:00
|
|
|
{
|
2009-04-03 07:57:45 +08:00
|
|
|
return 0;
|
2009-01-08 10:07:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
|
|
|
swap_cgroup_swapon(int type, unsigned long max_pages)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void swap_cgroup_swapoff(int type)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-08-01 07:43:02 +08:00
|
|
|
#endif /* CONFIG_MEMCG_SWAP */
|
2011-03-24 07:42:30 +08:00
|
|
|
|
2014-12-11 07:44:55 +08:00
|
|
|
#endif /* __LINUX_SWAP_CGROUP_H */
|