folio_mapping(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 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 πŸ’€:


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