Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
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,
11 unsigned int nr_ents);
12extern unsigned short lookup_swap_cgroup_id(swp_entry_t ent);
13extern int swap_cgroup_swapon(int type, unsigned long max_pages);
14extern void swap_cgroup_swapoff(int type);
15
16#else
17
18static inline
19unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id,
20 unsigned int nr_ents)
21{
22 return 0;
23}
24
25static inline
26unsigned short lookup_swap_cgroup_id(swp_entry_t ent)
27{
28 return 0;
29}
30
31static inline int
32swap_cgroup_swapon(int type, unsigned long max_pages)
33{
34 return 0;
35}
36
37static inline void swap_cgroup_swapoff(int type)
38{
39 return;
40}
41
42#endif /* CONFIG_MEMCG_SWAP */
43
44#endif /* __LINUX_SWAP_CGROUP_H */