Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm: remove lookup_swap_cache()

All callers have now been converted to swap_cache_get_folio(), so we can
remove this wrapper.

Link: https://lkml.kernel.org/r/20220902194653.1739778-39-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Matthew Wilcox (Oracle) and committed by
Andrew Morton
cb691e2f 5a423081

+2 -22
+1 -1
mm/memcontrol.c
··· 5569 5569 return NULL; 5570 5570 5571 5571 /* 5572 - * Because lookup_swap_cache() updates some statistics counter, 5572 + * Because swap_cache_get_folio() updates some statistics counter, 5573 5573 * we call find_get_page() with swapper_space directly. 5574 5574 */ 5575 5575 page = find_get_page(swap_address_space(ent), swp_offset(ent));
-10
mm/swap.h
··· 41 41 unsigned long end); 42 42 struct folio *swap_cache_get_folio(swp_entry_t entry, 43 43 struct vm_area_struct *vma, unsigned long addr); 44 - struct page *lookup_swap_cache(swp_entry_t entry, 45 - struct vm_area_struct *vma, 46 - unsigned long addr); 47 44 struct page *find_get_incore_page(struct address_space *mapping, pgoff_t index); 48 45 49 46 struct page *read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask, ··· 100 103 101 104 static inline struct folio *swap_cache_get_folio(swp_entry_t entry, 102 105 struct vm_area_struct *vma, unsigned long addr) 103 - { 104 - return NULL; 105 - } 106 - 107 - static inline struct page *lookup_swap_cache(swp_entry_t swp, 108 - struct vm_area_struct *vma, 109 - unsigned long addr) 110 106 { 111 107 return NULL; 112 108 }
+1 -11
mm/swap_state.c
··· 369 369 return folio; 370 370 } 371 371 372 - struct page *lookup_swap_cache(swp_entry_t entry, struct vm_area_struct *vma, 373 - unsigned long addr) 374 - { 375 - struct folio *folio = swap_cache_get_folio(entry, vma, addr); 376 - 377 - if (!folio) 378 - return NULL; 379 - return folio_file_page(folio, swp_offset(entry)); 380 - } 381 - 382 372 /** 383 373 * find_get_incore_page - Find and get a page from the page or swap caches. 384 374 * @mapping: The address_space to search. ··· 420 430 int err; 421 431 /* 422 432 * First check the swap cache. Since this is normally 423 - * called after lookup_swap_cache() failed, re-calling 433 + * called after swap_cache_get_folio() failed, re-calling 424 434 * that would confuse statistics. 425 435 */ 426 436 si = get_swap_device(entry);