filemap_invalidate_inode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– filemap_invalidate_inode(9) πŸ’–

okay bestie, today's main character is filemap_invalidate_inode(9) and she is literally the girl who clears out an inode's pagecache range β€” either by gently yeeting the folios or by making them write back first. no cap. ✨


🌸 NAME 🌸

filemap_invalidate_inode β€” invalidate / forcibly write back a range of an inode's pagecache

like, she shows up, she decides what stays and what goes, and she can make it flush on the way out. it's giving eviction notice with a bow on it πŸŽ€


⭐ SYNOPSIS ⭐

int filemap_invalidate_inode (struct inode *inode , bool flush , loff_t start , loff_t end );

one function, four args, zero drama (she handles the drama internally, tyvm) πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • inode β€” the inode you're flushing. that's your girl, that's the target πŸ’œ
  • flush β€” set this to write back rather than simply invalidate. so like, do you want them saved before they leave, or just gone? your call, bestie 🫢
  • start β€” first byte in range. the beginning of the story ✨
  • end β€” last byte in range (inclusive), or LLONG_MAX for everything from start onwards. LLONG_MAX is the "idk just take everything" option and honestly? relatable 😭

πŸ”₯ DESCRIPTION πŸ”₯

so what she does is: invalidate all the folios on an inode that contribute to the specified range β€” possibly writing them back first, if you set flush. like, she'll pack their bags for them if you ask nicely 🧳

and the important bit, ngl: whilst the operation is undertaken, the invalidate lock is held to prevent new folios from being installed. so nobody's sneaking new folios into the range while she's mid-cleanup. no gatecrashing. periodt πŸ‘‘

πŸ’€ real talk: that lock is held for the whole operation, so don't go thinking new folios can slip in. they can't. the door is shut, the vibes are locked down, we're safe.

🌈 SEE ALSO 🌈

Kernel file ./mm/filemap.c β€” and honestly the whole folio friend group, they all showed up:


and that's the whole page, bestie!! this one came to you straight out of the ./mm source, dated October 2026 β€” so mark your calendar, she's a Scorpio or whatever πŸ¦‚βœ¨ mwah, go invalidate something responsibly πŸ’œπŸŽ€

πŸ“¦ where this page comes from