linux-surface/kernel/include/linux/swap_cgroup.h

46 lines
971 B
C
Raw Normal View History

2017-11-06 02:38:20 +00:00
/* SPDX-License-Identifier: GPL-2.0 */
2017-08-10 13:25:24 +00:00
#ifndef __LINUX_SWAP_CGROUP_H
#define __LINUX_SWAP_CGROUP_H
#include <linux/swap.h>
#ifdef CONFIG_MEMCG_SWAP
extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent,
unsigned short old, unsigned short new);
2017-09-05 02:31:27 +00:00
extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id,
unsigned int nr_ents);
2017-08-10 13:25:24 +00:00
extern unsigned short lookup_swap_cgroup_id(swp_entry_t ent);
extern int swap_cgroup_swapon(int type, unsigned long max_pages);
extern void swap_cgroup_swapoff(int type);
#else
static inline
2017-09-05 02:31:27 +00:00
unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id,
unsigned int nr_ents)
2017-08-10 13:25:24 +00:00
{
return 0;
}
static inline
unsigned short lookup_swap_cgroup_id(swp_entry_t ent)
{
return 0;
}
static inline int
swap_cgroup_swapon(int type, unsigned long max_pages)
{
return 0;
}
static inline void swap_cgroup_swapoff(int type)
{
return;
}
#endif /* CONFIG_MEMCG_SWAP */
#endif /* __LINUX_SWAP_CGROUP_H */