mapping_align_index(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– mapping_align_index(9) β€” the Kernel API Manual glow-up πŸ’–

okay so you're reading the Kernel API Manual, page mapping_align_index(9), and honestly? you picked a short one. iconic of you. let's go 🫢


✨ NAME ✨

mapping_align_index β€” align the index for this mapping. that's it. that's the whole vibe check. πŸ’…


🌸 SYNOPSIS 🌸

pgoff_t mapping_align_index (const struct address_space *mapping ,
pgoff_t index );

look at her. two args, one return type, zero drama. copy it exactly bestie, i'm not kidding around with signatures. ⭐


πŸŽ€ ARGUMENTS πŸŽ€

  • mapping β€” the address_space. yes, the whole address space. she's the main character here. πŸ‘‘
  • index β€” the page index. that's the number you're asking about. πŸ”₯

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea: the index of a folio must be naturally aligned. like, non-negotiable, it's giving house rules. 🏠✨

so if you're adding a shiny new folio to the page cache and you're sitting there like "wait… what index do i even give it 😭" β€” you call this function. that's literally what it's for. it hands you the aligned index so you don't have to think about it. no cap, that's the entire job. πŸ’œ


🌈 SEE ALSO 🌈

the kernel file ./include/linux/pagemap.h says hi, and it brought friends. so many friends. all of them, right here, no skips: πŸ™ˆ

like… that's a whole friend group. go say hi. πŸ“

lowkey if you only remember one thing: the folio index has to be naturally aligned, and this function is the one that makes it so. everything else is lore. πŸ’€

and that's the page bestie!! sourced from ./include/linux, dated October 2026, straight out of the Kernel API Manual (version vibes: the one you're holding rn). stay aligned, stay iconic, mwah πŸ’‹πŸ§šβ€β™€οΈπŸ’œ

πŸ“¦ where this page comes from