mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 13:37:36 +02:00
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
This commit is contained in:
parent
ed2b11d639
commit
4506bcbba5
|
|
@ -99,7 +99,7 @@ static atomic_t proc_poll_event = ATOMIC_INIT(0);
|
||||||
|
|
||||||
atomic_t nr_rotate_swap = 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))
|
if (type >= READ_ONCE(nr_swapfiles))
|
||||||
return NULL;
|
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. */
|
smp_rmb(); /* Pairs with smp_wmb in alloc_swap_info. */
|
||||||
return READ_ONCE(swap_info[type]);
|
return READ_ONCE(swap_info[type]);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(swap_type_to_swap_info);
|
||||||
|
|
||||||
static inline unsigned char swap_count(unsigned char ent)
|
static inline unsigned char swap_count(unsigned char ent)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user