diff --git a/include/linux/swapfile.h b/include/linux/swapfile.h index 99e3ed469e88..e03c069f9536 100644 --- a/include/linux/swapfile.h +++ b/include/linux/swapfile.h @@ -5,6 +5,9 @@ extern unsigned long generic_max_swapfile_size(void); unsigned long arch_max_swapfile_size(void); +extern int unuse_swap_pte(struct vm_area_struct *vma, pmd_t *pmd, + unsigned long addr, swp_entry_t entry, struct folio *folio); + /* Maximum swapfile size supported for the arch (not inclusive). */ extern unsigned long swapfile_maximum_size; /* Whether swap migration entry supports storing A/D bits for the arch */ diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c index 76a543c9a289..09512d8a6816 100644 --- a/mm/pgtable-generic.c +++ b/mm/pgtable-generic.c @@ -305,6 +305,7 @@ nomap: rcu_read_unlock(); return NULL; } +EXPORT_SYMBOL_GPL(__pte_offset_map); pte_t *pte_offset_map_nolock(struct mm_struct *mm, pmd_t *pmd, unsigned long addr, spinlock_t **ptlp) diff --git a/mm/swap_state.c b/mm/swap_state.c index d331f21749f8..d12dedc52a81 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -549,6 +549,8 @@ struct page *read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask, return retpage; } +EXPORT_SYMBOL_GPL(read_swap_cache_async); + static unsigned int __swapin_nr_pages(unsigned long prev_offset, unsigned long offset, int hits, diff --git a/mm/swapfile.c b/mm/swapfile.c index fd27b0ac41b6..57c9051a23b0 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -2204,6 +2204,13 @@ out: return ret; } +int unuse_swap_pte(struct vm_area_struct *vma, pmd_t *pmd, + unsigned long addr, swp_entry_t entry, struct folio *folio) +{ + return unuse_pte(vma, pmd, addr, entry, folio); +} +EXPORT_SYMBOL_GPL(unuse_swap_pte); + static int unuse_pte_range(struct vm_area_struct *vma, pmd_t *pmd, unsigned long addr, unsigned long end, unsigned int type)