xref: /openbmc/linux/include/linux/zswap.h (revision 42c06a0e)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_ZSWAP_H
3 #define _LINUX_ZSWAP_H
4 
5 #include <linux/types.h>
6 #include <linux/mm_types.h>
7 
8 extern u64 zswap_pool_total_size;
9 extern atomic_t zswap_stored_pages;
10 
11 #ifdef CONFIG_ZSWAP
12 
13 bool zswap_store(struct page *page);
14 bool zswap_load(struct page *page);
15 void zswap_invalidate(int type, pgoff_t offset);
16 void zswap_swapon(int type);
17 void zswap_swapoff(int type);
18 
19 #else
20 
21 static inline bool zswap_store(struct page *page)
22 {
23 	return false;
24 }
25 
26 static inline bool zswap_load(struct page *page)
27 {
28 	return false;
29 }
30 
31 static inline void zswap_invalidate(int type, pgoff_t offset) {}
32 static inline void zswap_swapon(int type) {}
33 static inline void zswap_swapoff(int type) {}
34 
35 #endif
36 
37 #endif /* _LINUX_ZSWAP_H */
38