swap_cgroup.h 932 字节
Newer Older
1 2
#ifndef __LINUX_SWAP_CGROUP_H
#define __LINUX_SWAP_CGROUP_H
3

4
#include <linux/swap.h>
5

A
Andrew Morton 已提交
6
#ifdef CONFIG_MEMCG_SWAP
7

8 9
extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent,
					unsigned short old, unsigned short new);
10 11
extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id,
					 unsigned int nr_ents);
12
extern unsigned short lookup_swap_cgroup_id(swp_entry_t ent);
13 14
extern int swap_cgroup_swapon(int type, unsigned long max_pages);
extern void swap_cgroup_swapoff(int type);
15

16 17 18
#else

static inline
19 20
unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id,
				  unsigned int nr_ents)
21
{
22
	return 0;
23 24 25
}

static inline
26
unsigned short lookup_swap_cgroup_id(swp_entry_t ent)
27
{
28
	return 0;
29 30 31 32 33 34 35 36 37 38 39 40 41
}

static inline int
swap_cgroup_swapon(int type, unsigned long max_pages)
{
	return 0;
}

static inline void swap_cgroup_swapoff(int type)
{
	return;
}

A
Andrew Morton 已提交
42
#endif /* CONFIG_MEMCG_SWAP */
43

44
#endif /* __LINUX_SWAP_CGROUP_H */