#ifdef CONFIG_ZSWAP
bool zswap_store(struct folio *folio);
-bool zswap_load(struct page *page);
+bool zswap_load(struct folio *folio);
void zswap_invalidate(int type, pgoff_t offset);
void zswap_swapon(int type);
void zswap_swapoff(int type);
return false;
}
-static inline bool zswap_load(struct page *page)
+static inline bool zswap_load(struct folio *folio)
{
return false;
}
}
delayacct_swapin_start();
- if (zswap_load(page)) {
+ if (zswap_load(folio)) {
folio_mark_uptodate(folio);
folio_unlock(folio);
} else if (data_race(sis->flags & SWP_FS_OPS)) {
goto reject;
}
-bool zswap_load(struct page *page)
+bool zswap_load(struct folio *folio)
{
- swp_entry_t swp = { .val = page_private(page), };
+ swp_entry_t swp = folio_swap_entry(folio);
int type = swp_type(swp);
pgoff_t offset = swp_offset(swp);
+ struct page *page = &folio->page;
struct zswap_tree *tree = zswap_trees[type];
struct zswap_entry *entry;
struct scatterlist input, output;
unsigned int dlen;
bool ret;
- VM_WARN_ON_ONCE(!PageLocked(page));
+ VM_WARN_ON_ONCE(!folio_test_locked(folio));
/* find */
spin_lock(&tree->lock);
spin_lock(&tree->lock);
if (ret && zswap_exclusive_loads_enabled) {
zswap_invalidate_entry(tree, entry);
- SetPageDirty(page);
+ folio_mark_dirty(folio);
} else if (entry->length) {
spin_lock(&entry->pool->lru_lock);
list_move(&entry->lru, &entry->pool->lru);