From 06c2766cbc9923d67d45fc191c467b5e2685175d Mon Sep 17 00:00:00 2001 From: Bing Han Date: Fri, 10 Jun 2022 19:40:35 +0800 Subject: [PATCH] ANDROID: mm: export symbols used in vendor hook android_vh_get_swap_page() 3 symbols are exported to be used in vendor hook android_vh_get_swap_page: 1)check_cache_active, used to get swap page from the specified swap location, it's usage is similar to the usage in get_swap_page 2)scan_swap_map_slots, used to get swap page from the specified swap, it's usage is similar to get_swap_pages 3)swap_alloc_cluster, used to get swap page from the specified swap, it's usage is similar to get_swap_pages Bug: 234214858 Signed-off-by: Bing Han Change-Id: Ie24c5d32a16c7cb87905d034095ec8fb070dbe0f --- mm/swap_slots.c | 3 ++- mm/swapfile.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mm/swap_slots.c b/mm/swap_slots.c index eee97a5f445b..365493578163 100644 --- a/mm/swap_slots.c +++ b/mm/swap_slots.c @@ -90,7 +90,7 @@ void reenable_swap_slots_cache_unlock(void) mutex_unlock(&swap_slots_cache_enable_mutex); } -static bool check_cache_active(void) +bool check_cache_active(void) { long pages; @@ -111,6 +111,7 @@ static bool check_cache_active(void) out: return swap_slot_cache_active; } +EXPORT_SYMBOL_GPL(check_cache_active); static int alloc_swap_slot_cache(unsigned int cpu) { diff --git a/mm/swapfile.c b/mm/swapfile.c index 3deff9d469e5..c06259a5b3bd 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -772,7 +772,7 @@ static void set_cluster_next(struct swap_info_struct *si, unsigned long next) this_cpu_write(*si->cluster_next_cpu, next); } -static int scan_swap_map_slots(struct swap_info_struct *si, +int scan_swap_map_slots(struct swap_info_struct *si, unsigned char usage, int nr, swp_entry_t slots[]) { @@ -988,8 +988,9 @@ no_page: si->flags -= SWP_SCANNING; return n_ret; } +EXPORT_SYMBOL_GPL(scan_swap_map_slots); -static int swap_alloc_cluster(struct swap_info_struct *si, swp_entry_t *slot) +int swap_alloc_cluster(struct swap_info_struct *si, swp_entry_t *slot) { unsigned long idx; struct swap_cluster_info *ci; @@ -1023,6 +1024,7 @@ static int swap_alloc_cluster(struct swap_info_struct *si, swp_entry_t *slot) return 1; } +EXPORT_SYMBOL_GPL(swap_alloc_cluster); static void swap_free_cluster(struct swap_info_struct *si, unsigned long idx) {