ANDROID: mm: export swap_type_to_swap_info
The function swap_type_to_swap_info is exported to access the swap_info_struct of the specified swap, which is regarded as reserved extended memory. Bug: 234214858 Signed-off-by: Bing Han <bing.han@transsion.com> Change-Id: I0107e7d561150f1945a4c161e886e9e03383fff6
Tento commit je obsažen v:
@@ -99,7 +99,7 @@ static atomic_t proc_poll_event = ATOMIC_INIT(0);
|
||||
|
||||
atomic_t nr_rotate_swap = ATOMIC_INIT(0);
|
||||
|
||||
static struct swap_info_struct *swap_type_to_swap_info(int type)
|
||||
struct swap_info_struct *swap_type_to_swap_info(int type)
|
||||
{
|
||||
if (type >= READ_ONCE(nr_swapfiles))
|
||||
return NULL;
|
||||
@@ -107,6 +107,7 @@ static struct swap_info_struct *swap_type_to_swap_info(int type)
|
||||
smp_rmb(); /* Pairs with smp_wmb in alloc_swap_info. */
|
||||
return READ_ONCE(swap_info[type]);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(swap_type_to_swap_info);
|
||||
|
||||
static inline unsigned char swap_count(unsigned char ent)
|
||||
{
|
||||
|
Odkázat v novém úkolu
Zablokovat Uživatele