invalidate_mapping_pages(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ invalidate_mapping_pages(9) πŸ¦‹

hiii bestie!! welcome to the Kernel API Manual page for invalidate_mapping_pages(9) πŸ’– this one is lowkey iconic if you’re messing with page cache and need to yeet only the chill stuff. Let’s get into it ✨

πŸ’– NAME πŸ’–

invalidate_mapping_pages - Invalidate all clean, unlocked cache of one inode 🧚

🌸 SYNOPSIS 🌸

unsigned long invalidate_mapping_pages (struct address_space *mapping , pgoff_t start , pgoff_t end );

πŸŽ€ ARGUMENTS πŸŽ€

  • mapping β€” the address_space which holds the cache to invalidate πŸ’…
  • start β€” the offset 'from' which to invalidate 🫢
  • end β€” the offset 'to' which to invalidate (inclusive) ⭐

πŸ”₯ DESCRIPTION πŸ”₯

okay so here’s the tea β˜•: this function removes pages that are clean, unmapped and unlocked, as well as shadow entries. It will not block on IO activity β€” no waiting around for IO, bestie 😭

if you want to remove all the pages of one inode, regardless of their use and writeback state, use truncate_inode_pages instead πŸ‘‘ that’s the one for the full send.

⭐ RETURN ⭐

the number of indices that had their contents invalidated ✨ (yes, a count, not a vibe check πŸ’€)

🌈 SEE ALSO 🌈

all from the kernel file ./mm/truncate.c β€” go say hi to these besties πŸ¦‹:


xoxo, signed off from the ./mm source/version, dated October 2026 β€” catch u later, bestie πŸ«ΆπŸ’‹

πŸ“¦ where this page comes from