swap_cache_get_shadow(9)
β¨ swap_cache_get_shadow(9) β¨
okay so bestie, welcome to the Kernel API Manual π this one is a little function with a big job, and it lives right here in section 9, so pull up a chair π
πΈ NAME πΈ
swap_cache_get_shadow β it looks up a shadow in the swap cache. that's it, that's the whole vibe π¦
π SYNOPSIS π
void * swap_cache_get_shadow (swp_entry_t entry );
like, one argument, one return, no cap β¨
π ARGUMENTS π
entryβ the swap entry used for the lookup. this is the little key you hand over so it knows what to go find π
π«Ά CONTEXT π«Ά
okay this part is important, listen up π the caller has to make sure entry is actually valid, and has to protect the swap device with a reference count or locks. like, do not just roll up unprepared, bestie β that's the whole assignment π
fr fr, valid entry + protection (refcount or locks) = required. not optional. periodt.
π RETURN π
it returns either NULL or an XA_VALUE (that's the shadow). soβ¦ shadow or nothing, iconic either way π
π SEE ALSO π
the whole friend group lives in the kernel file ./mm/swap_state.c, and honestly? obsessed with this lineup π§
swap_cache_get_folio(9)swap_cache_has_folio(9)__swap_cache_add_check(9)__swap_cache_add_folio(9)__swap_cache_del_folio(9)swap_cache_del_folio(9)__swap_cache_replace_folio(9)swap_cache_alloc_folio(9)swap_update_readahead(9)swapin_sync(9)swap_cluster_readahead(9)swap_vma_readahead(9)swapin_readahead(9)
β and that's the page!! this lil cutie comes to you from the source ./mm and it's dated October 2026, so yeah, fresh π thanks for reading bestie, go forth and look up those shadows π¦π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms