1 #ifndef _LINUX_FRONTSWAP_H
2 #define _LINUX_FRONTSWAP_H
6 #include <linux/bitops.h>
22 #define FRONTSWAP_HAS_EXCLUSIVE_GETS
31 #ifdef CONFIG_FRONTSWAP
33 static inline bool frontswap_test(
struct swap_info_struct *sis,
pgoff_t offset)
38 ret =
test_bit(offset, sis->frontswap_map);
42 static inline void frontswap_set(
struct swap_info_struct *sis,
pgoff_t offset)
45 set_bit(offset, sis->frontswap_map);
48 static inline void frontswap_clear(
struct swap_info_struct *sis,
pgoff_t offset)
54 static inline void frontswap_map_set(
struct swap_info_struct *
p,
57 p->frontswap_map =
map;
60 static inline unsigned long *frontswap_map_get(
struct swap_info_struct *
p)
62 return p->frontswap_map;
67 #define frontswap_enabled (0)
69 static inline bool frontswap_test(
struct swap_info_struct *sis,
pgoff_t offset)
74 static inline void frontswap_set(
struct swap_info_struct *sis,
pgoff_t offset)
78 static inline void frontswap_clear(
struct swap_info_struct *sis,
pgoff_t offset)
82 static inline void frontswap_map_set(
struct swap_info_struct *
p,
87 static inline unsigned long *frontswap_map_get(
struct swap_info_struct *
p)
93 static inline int frontswap_store(
struct page *
page)
102 static inline int frontswap_load(
struct page *page)
111 static inline void frontswap_invalidate_page(
unsigned type,
pgoff_t offset)
117 static inline void frontswap_invalidate_area(
unsigned type)
123 static inline void frontswap_init(
unsigned type)