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
);
20 unsigned short swap_cgroup_record(swp_entry_t ent
, unsigned short id
,
27 unsigned short lookup_swap_cgroup_id(swp_entry_t ent
)
33 swap_cgroup_swapon(int type
, unsigned long max_pages
)
38 static inline void swap_cgroup_swapoff(int type
)
43 #endif /* CONFIG_MEMCG_SWAP */
45 #endif /* __LINUX_SWAP_CGROUP_H */