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