summaryrefslogtreecommitdiffstats
path: root/include/linux/zswap.h
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2023-07-17 12:02:27 -0400
committerAndrew Morton <akpm@linux-foundation.org>2023-08-21 13:37:26 -0700
commit42c06a0e8ebe95b81e5fb41c6556ff22d9255b0c (patch)
tree2841a6f977f5eb75f5acda763fa4b0b7166508d6 /include/linux/zswap.h
parentb8cf32dc6e8c75b712cbf638e0fd210101c22f17 (diff)
downloadlinux-42c06a0e8ebe95b81e5fb41c6556ff22d9255b0c.tar.gz
linux-42c06a0e8ebe95b81e5fb41c6556ff22d9255b0c.tar.bz2
linux-42c06a0e8ebe95b81e5fb41c6556ff22d9255b0c.zip
mm: kill frontswap
The only user of frontswap is zswap, and has been for a long time. Have swap call into zswap directly and remove the indirection. [hannes@cmpxchg.org: remove obsolete comment, per Yosry] Link: https://lkml.kernel.org/r/20230719142832.GA932528@cmpxchg.org [fengwei.yin@intel.com: don't warn if none swapcache folio is passed to zswap_load] Link: https://lkml.kernel.org/r/20230810095652.3905184-1-fengwei.yin@intel.com Link: https://lkml.kernel.org/r/20230717160227.GA867137@cmpxchg.org Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Signed-off-by: Yin Fengwei <fengwei.yin@intel.com> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: Nhat Pham <nphamcs@gmail.com> Acked-by: Yosry Ahmed <yosryahmed@google.com> Acked-by: Christoph Hellwig <hch@lst.de> Cc: Domenico Cerasuolo <cerasuolodomenico@gmail.com> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Vitaly Wool <vitaly.wool@konsulko.com> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux/zswap.h')
-rw-r--r--include/linux/zswap.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/linux/zswap.h b/include/linux/zswap.h
new file mode 100644
index 000000000000..850c377d9b6d
--- /dev/null
+++ b/include/linux/zswap.h
@@ -0,0 +1,37 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_ZSWAP_H
+#define _LINUX_ZSWAP_H
+
+#include <linux/types.h>
+#include <linux/mm_types.h>
+
+extern u64 zswap_pool_total_size;
+extern atomic_t zswap_stored_pages;
+
+#ifdef CONFIG_ZSWAP
+
+bool zswap_store(struct page *page);
+bool zswap_load(struct page *page);
+void zswap_invalidate(int type, pgoff_t offset);
+void zswap_swapon(int type);
+void zswap_swapoff(int type);
+
+#else
+
+static inline bool zswap_store(struct page *page)
+{
+ return false;
+}
+
+static inline bool zswap_load(struct page *page)
+{
+ return false;
+}
+
+static inline void zswap_invalidate(int type, pgoff_t offset) {}
+static inline void zswap_swapon(int type) {}
+static inline void zswap_swapoff(int type) {}
+
+#endif
+
+#endif /* _LINUX_ZSWAP_H */