mm :zswap: use kmap_local_folio() in zswap_load()

Eliminate the last explicit 'struct page' reference in mm/zswap.c.

Link: https://lkml.kernel.org/r/20240524033819.1953587-3-yosryahmed@google.com
Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
Reviewed-by: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Nhat Pham <nphamcs@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Yosry Ahmed 2024-05-24 03:38:17 +00:00 committed by Andrew Morton
parent 5d19f5de67
commit 30a28baafc

View File

@ -1551,7 +1551,6 @@ bool zswap_load(struct folio *folio)
{
swp_entry_t swp = folio->swap;
pgoff_t offset = swp_offset(swp);
struct page *page = &folio->page;
bool swapcache = folio_test_swapcache(folio);
struct xarray *tree = swap_zswap_tree(swp);
struct zswap_entry *entry;
@ -1582,7 +1581,7 @@ bool zswap_load(struct folio *folio)
if (entry->length)
zswap_decompress(entry, folio);
else {
dst = kmap_local_page(page);
dst = kmap_local_folio(folio, 0);
zswap_fill_page(dst, entry->value);
kunmap_local(dst);
}