Merge tag 'csky-for-linus-6.6-2' of https://github.com/c-sky/csky-linux
[linux-2.6-microblaze.git] / include / linux / zswap.h
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
21 static inline bool zswap_store(struct folio *folio)
22 {
23         return false;
24 }
25
26 static inline bool zswap_load(struct folio *folio)
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 */