mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 08:03:01 +09:00
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>
38 lines
753 B
C
38 lines
753 B
C
/* 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 */
|