invalidate_inode_pages2(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… invalidate_inode_pages2(9)

okay so bestie, welcome to the Kernel API Manual β€” this one's a <purple>section 9</purple> situation and it's literally all about yeeting every single page out of an address_space. no cap. 🧹✨


🌸 NAME 🌸

invalidate_inode_pages2 β€” remove all pages from an address_space

like, all of them. the whole vibe. gone. 🫢


⭐ SYNOPSIS ⭐

int invalidate_inode_pages2 (struct address_space *mapping );

(yes the spacing in there is exactly what the kernel gods wrote, don't @ me πŸ’€)


πŸŽ€ ARGUMENTS πŸŽ€

  • mapping β€” the address_space. that's the thing we're about to clean out, main character of the whole operation πŸ‘‘

✨ DESCRIPTION ✨

so here's the tea πŸ“: any pages which are found to be mapped into pagetables are unmapped prior to invalidation.

read that again. unmapped first, invalidated after. it's giving "get out of the pagetable before I get you out of the page cache" πŸ’…


πŸ”₯ RETURN πŸ”₯

  • -EBUSY β€” if any pages could not be invalidated. like ok some pages said "no ❀️" and the call had to report it. 😭

🌈 SEE ALSO 🌈

the whole friend group, fr fr β€” kernel file ./mm/truncate.c and:


okay that's the whole page, you ate that πŸ½οΈπŸ’–

live from ./mm, dated October 2026 β€” invalidate_inode_pages2(9), signing off. mwah πŸ’‹πŸŽ€πŸ¦‹
πŸ“¦ where this page comes from