From e064059673798b931f95f724c7e377fa8cd15df7 Mon Sep 17 00:00:00 2001 From: Bing Han Date: Mon, 30 May 2022 16:39:40 +0800 Subject: [PATCH] ANDROID: create and export is_swap_slot_cache_enabled Create and export a function is_swap_slot_cache_enabled to check whether the swap slot cache can be used. Bug: 234214858 Signed-off-by: Bing Han Change-Id: Iaca9519b838e0c3c8c06acbec83003f8309aa363 --- mm/swap_slots.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/swap_slots.c b/mm/swap_slots.c index a200aafc0a36..1392649a4d9a 100644 --- a/mm/swap_slots.c +++ b/mm/swap_slots.c @@ -92,6 +92,12 @@ void reenable_swap_slots_cache_unlock(void) mutex_unlock(&swap_slots_cache_enable_mutex); } +bool is_swap_slot_cache_enabled(void) +{ + return swap_slot_cache_enabled; +} +EXPORT_SYMBOL_GPL(is_swap_slot_cache_enabled); + bool check_cache_active(void) { long pages;