at master 1.0 kB view raw
1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef __LINUX_SWAP_CGROUP_H 3#define __LINUX_SWAP_CGROUP_H 4 5#include <linux/swap.h> 6 7#if defined(CONFIG_MEMCG) && defined(CONFIG_SWAP) 8 9extern void swap_cgroup_record(struct folio *folio, unsigned short id, swp_entry_t ent); 10extern unsigned short swap_cgroup_clear(swp_entry_t ent, unsigned int nr_ents); 11extern unsigned short lookup_swap_cgroup_id(swp_entry_t ent); 12extern int swap_cgroup_swapon(int type, unsigned long max_pages); 13extern void swap_cgroup_swapoff(int type); 14 15#else 16 17static inline 18void swap_cgroup_record(struct folio *folio, unsigned short id, swp_entry_t ent) 19{ 20} 21 22static inline 23unsigned short swap_cgroup_clear(swp_entry_t ent, unsigned int nr_ents) 24{ 25 return 0; 26} 27 28static inline 29unsigned short lookup_swap_cgroup_id(swp_entry_t ent) 30{ 31 return 0; 32} 33 34static inline int 35swap_cgroup_swapon(int type, unsigned long max_pages) 36{ 37 return 0; 38} 39 40static inline void swap_cgroup_swapoff(int type) 41{ 42 return; 43} 44 45#endif 46 47#endif /* __LINUX_SWAP_CGROUP_H */