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 b31a7ab137d7..d52cacc45738 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_ro_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 4669f29cf555..d210f07aff76 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -574,6 +574,8 @@ struct folio *read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask, return folio; } +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 ce84a3361046..5e2fc66bef34 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -2180,6 +2180,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)