[PATCH 41/59] mm: Remove lookup_swap_cache()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
---
 mm/memcontrol.c |  2 +-
 mm/swap.h       | 10 ----------
 mm/swap_state.c | 12 +-----------
 3 files changed, 2 insertions(+), 22 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index f65833efe90d..3b0698faf1ee 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5561,7 +5561,7 @@ static struct page *mc_handle_swap_pte(struct vm_area_struct *vma,
 		return NULL;
 
 	/*
-	 * Because lookup_swap_cache() updates some statistics counter,
+	 * Because swap_cache_get_folio() updates some statistics counter,
 	 * we call find_get_page() with swapper_space directly.
 	 */
 	page = find_get_page(swap_address_space(ent), swp_offset(ent));
diff --git a/mm/swap.h b/mm/swap.h
index f70ff34dab82..9551d7815c37 100644
--- a/mm/swap.h
+++ b/mm/swap.h
@@ -43,9 +43,6 @@ void clear_shadow_from_swap_cache(int type, unsigned long begin,
 				  unsigned long end);
 struct folio *swap_cache_get_folio(swp_entry_t entry,
 		struct vm_area_struct *vma, unsigned long addr);
-struct page *lookup_swap_cache(swp_entry_t entry,
-			       struct vm_area_struct *vma,
-			       unsigned long addr);
 struct page *find_get_incore_page(struct address_space *mapping, pgoff_t index);
 
 struct page *read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask,
@@ -103,13 +100,6 @@ static inline int swap_writepage(struct page *p, struct writeback_control *wbc)
 	return 0;
 }
 
-static inline struct page *lookup_swap_cache(swp_entry_t swp,
-					     struct vm_area_struct *vma,
-					     unsigned long addr)
-{
-	return NULL;
-}
-
 static inline
 struct page *find_get_incore_page(struct address_space *mapping, pgoff_t index)
 {
diff --git a/mm/swap_state.c b/mm/swap_state.c
index b96bf4ec8b5b..4af135a7b53c 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -369,16 +369,6 @@ struct folio *swap_cache_get_folio(swp_entry_t entry,
 	return folio;
 }
 
-struct page *lookup_swap_cache(swp_entry_t entry, struct vm_area_struct *vma,
-			       unsigned long addr)
-{
-	struct folio *folio = swap_cache_get_folio(entry, vma, addr);
-
-	if (!folio)
-		return NULL;
-	return folio_file_page(folio, swp_offset(entry));
-}
-
 /**
  * find_get_incore_page - Find and get a page from the page or swap caches.
  * @mapping: The address_space to search.
@@ -430,7 +420,7 @@ struct page *__read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask,
 		int err;
 		/*
 		 * First check the swap cache.  Since this is normally
-		 * called after lookup_swap_cache() failed, re-calling
+		 * called after swap_cache_get_folio() failed, re-calling
 		 * that would confuse statistics.
 		 */
 		si = get_swap_device(entry);
-- 
2.35.1





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux