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 folio *folio); 14 bool zswap_load(struct folio *folio); 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 zswap_store(struct folio * folio)21static inline bool zswap_store(struct folio *folio) 22 { 23 return false; 24 } 25 zswap_load(struct folio * folio)26static inline bool zswap_load(struct folio *folio) 27 { 28 return false; 29 } 30 zswap_invalidate(int type,pgoff_t offset)31static inline void zswap_invalidate(int type, pgoff_t offset) {} zswap_swapon(int type)32static inline void zswap_swapon(int type) {} zswap_swapoff(int type)33static inline void zswap_swapoff(int type) {} 34 35 #endif 36 37 #endif /* _LINUX_ZSWAP_H */ 38