Skip to content

Commit

Permalink
mm: remove try_to_free_swap()
Browse files Browse the repository at this point in the history
All callers have now been converted to folio_free_swap() and we can remove
this wrapper.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Matthew Wilcox (Oracle) authored and akpm00 committed Oct 3, 2022
1 parent 9202d52 commit 3b34415
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 14 deletions.
6 changes: 0 additions & 6 deletions include/linux/swap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 0 additions & 7 deletions mm/folio-compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3b34415

Please sign in to comment.