folio_mapping(9)
πΈ NAME πΈ
ok so folio_mapping β literally finds the mapping where this folio is stored π
that's the whole vibe
β¨ SYNOPSIS β¨
struct address_space * folio_mapping (const struct folio *folio );
like, it hands you back a struct address_space * pointer, no cap π«Ά
π ARGUMENTS π
folioβ the folio. that's it. that's the whole argument bestie, it's just the folio π¦
π DESCRIPTION π
okay so picture this: for folios that are chilling in the page cache, this returns the mapping that this page belongs to. slay. π
but here's the plot twist π₯ β folios in the swap cache return the swap mapping this page is stored in, which is lowkey a whole different thing from the mapping for the swap file or swap device where the data actually lives. iykyk, don't mix them up π
and the iconic part? you can call this on folios that aren't in the swap cache or the page cache and it will just return NULL. no drama, no crash, just NULL β
π¦ SEE ALSO π¦
Kernel file ./mm/util.c β and bestie, the guest list is long, so buckle up π:
kfree_const(9)__kmemdup_nul(9)kstrdup(9)kstrdup_const(9)kstrndup(9)kmemdup(9)kmemdup_array(9)kvmemdup(9)kmemdup_nul(9)memdup_user(9)vmemdup_user(9)strndup_user(9)memdup_user_nul(9)randomize_page(9)__account_locked_vm(9)account_locked_vm(9)__vmalloc_array(9)vmalloc_array(9)__vcalloc(9)vcalloc(9)folio_copy(9)get_cmdline(9)mem_dump_obj(9)compat_set_desc_from_vma(9)__compat_vma_mmap(9)compat_vma_mmap(9)snapshot_page(9)mmap_action_prepare(9)mmap_action_complete(9)folio_pte_batch(9)page_range_contiguous(9)
ok that's the whole page, you ate that π
anyway this icon lives in ./mm and it's dated October 2026 β periodt, go read some folios bestie π§π
π¦ 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