Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / include / linux / swap_cgroup.h
bloba12dd1c3966c909be0c15ac9b08245f12f739d36
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __LINUX_SWAP_CGROUP_H
3 #define __LINUX_SWAP_CGROUP_H
5 #include <linux/swap.h>
7 #ifdef CONFIG_MEMCG_SWAP
9 extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent,
10 unsigned short old, unsigned short new);
11 extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id,
12 unsigned int nr_ents);
13 extern unsigned short lookup_swap_cgroup_id(swp_entry_t ent);
14 extern int swap_cgroup_swapon(int type, unsigned long max_pages);
15 extern void swap_cgroup_swapoff(int type);
17 #else
19 static inline
20 unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id,
21 unsigned int nr_ents)
23 return 0;
26 static inline
27 unsigned short lookup_swap_cgroup_id(swp_entry_t ent)
29 return 0;
32 static inline int
33 swap_cgroup_swapon(int type, unsigned long max_pages)
35 return 0;
38 static inline void swap_cgroup_swapoff(int type)
40 return;
43 #endif /* CONFIG_MEMCG_SWAP */
45 #endif /* __LINUX_SWAP_CGROUP_H */