summaryrefslogtreecommitdiff
path: root/mm/memory.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-09-02 20:46:33 +0100
committerAndrew Morton <akpm@linux-foundation.org>2022-10-03 14:02:51 -0700
commit5a423081b2465d38baf2fcbbc19f77d211507061 (patch)
treeca85f9fa4be74b5e03346386cce8bcdfc62393bd /mm/memory.c
parentf102cd8b173e066179b472fb6e3b18e31a1cc394 (diff)
mm: convert do_swap_page() to use swap_cache_get_folio()
Saves a folio->page->folio conversion. Link: https://lkml.kernel.org/r/20220902194653.1739778-38-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/memory.c b/mm/memory.c
index b36b177e0ea9..0018df3f0cc2 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3767,9 +3767,9 @@ vm_fault_t do_swap_page(struct vm_fault *vmf)
if (unlikely(!si))
goto out;
- page = lookup_swap_cache(entry, vma, vmf->address);
- if (page)
- folio = page_folio(page);
+ folio = swap_cache_get_folio(entry, vma, vmf->address);
+ if (folio)
+ page = folio_file_page(folio, swp_offset(entry));
swapcache = folio;
if (!folio) {