mm: remove try_to_free_swap()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 2 Sep 2022 19:46:44 +0000 (20:46 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 3 Oct 2022 21:02:53 +0000 (14:02 -0700)
All callers have now been converted to folio_free_swap() and we can remove
this wrapper.

Link: https://lkml.kernel.org/r/20220902194653.1739778-49-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/swap.h
mm/folio-compat.c
mm/memory.c

index d8bd6401c3e7dad86bc7b46e06d6fe2353314ae3..fc8d98660326f50e26884253321f04a416e26dd0 100644 (file)
@@ -510,7 +510,6 @@ extern int __swp_swapcount(swp_entry_t entry);
 extern int swp_swapcount(swp_entry_t entry);
 extern struct swap_info_struct *page_swap_info(struct page *);
 extern struct swap_info_struct *swp_swap_info(swp_entry_t entry);
-extern int try_to_free_swap(struct page *);
 struct backing_dev_info;
 extern int init_swap_address_space(unsigned int type, unsigned long nr_pages);
 extern void exit_swap_address_space(unsigned int type);
@@ -595,11 +594,6 @@ static inline int swp_swapcount(swp_entry_t entry)
        return 0;
 }
 
-static inline int try_to_free_swap(struct page *page)
-{
-       return 0;
-}
-
 static inline swp_entry_t folio_alloc_swap(struct folio *folio)
 {
        swp_entry_t entry;
index 06d47f00609b54052c0fec17345e2ab0394e9db7..e1e23b4947d73bd769bd319c821956911ff41fa6 100644 (file)
@@ -146,10 +146,3 @@ void putback_lru_page(struct page *page)
 {
        folio_putback_lru(page_folio(page));
 }
-
-#ifdef CONFIG_SWAP
-int try_to_free_swap(struct page *page)
-{
-       return folio_free_swap(page_folio(page));
-}
-#endif
index 2f1a6da7f1e6582c9968945293be16d2620205b7..6e568f190e7a894aae6fe15b5d851ffa1754e164 100644 (file)
@@ -3844,7 +3844,7 @@ vm_fault_t do_swap_page(struct vm_fault *vmf)
 
        if (swapcache) {
                /*
-                * Make sure try_to_free_swap or swapoff did not release the
+                * Make sure folio_free_swap() or swapoff did not release the
                 * swapcache from under us.  The page pin, and pte_same test
                 * below, are not enough to exclude that.  Even if it is still
                 * swapcache, we need to check that the page's swap has not