ANDROID: mm: export unpack_shadow

The commit 56526cf94076("ANDROID: mm: swap: export and whitelist
get_shadow_from_swap_cache") exports the api to get the shadow entry
from the swap cache which is then used to check if this entry can be
further pushed down to slower devices.

At present, we are manually extracting the information from this shadow
entry using the same macros being used by unpack_shadow(). Instead
export this function.

Bug: 369964379
Change-Id: Id044add31434d234e4a6136f192c11ab20ad0985
Signed-off-by: Charan Teja Kalla <quic_charante@quicinc.com>
This commit is contained in:
Charan Teja Kalla
2024-09-27 13:14:44 +05:30
committed by Treehugger Robot
parent a6266110c1
commit 1a3bbc1910

View File

@@ -195,7 +195,7 @@ static void *pack_shadow(int memcgid, pg_data_t *pgdat, unsigned long eviction,
return xa_mk_value(eviction);
}
static void unpack_shadow(void *shadow, int *memcgidp, pg_data_t **pgdat,
void unpack_shadow(void *shadow, int *memcgidp, pg_data_t **pgdat,
unsigned long *evictionp, bool *workingsetp)
{
unsigned long entry = xa_to_value(shadow);
@@ -214,6 +214,7 @@ static void unpack_shadow(void *shadow, int *memcgidp, pg_data_t **pgdat,
*evictionp = entry;
*workingsetp = workingset;
}
EXPORT_SYMBOL_GPL(unpack_shadow);
#ifdef CONFIG_LRU_GEN