mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-28 20:02:17 +00:00
![Matthew Wilcox (Oracle)](/assets/img/avatar_default.png)
Only convert a few easy parts of this function to use the folio passed in; convert back to struct page for the majority of it. Removes three hidden calls to compound_head(). Link: https://lkml.kernel.org/r/20230715042343.434588-6-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Christoph Hellwig <hch@infradead.org> Cc: Domenico Cerasuolo <cerasuolodomenico@gmail.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Nhat Pham <nphamcs@gmail.com> Cc: Vitaly Wool <vitaly.wool@konsulko.com> Cc: Yosry Ahmed <yosryahmed@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
37 lines
761 B
C
37 lines
761 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 folio *folio);
|
|
bool zswap_load(struct folio *folio);
|
|
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 folio *folio)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
static inline bool zswap_load(struct folio *folio)
|
|
{
|
|
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 */
|