fscache_invalidate(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… fscache_invalidate(9) β€” from the Kernel API Manual, bestie πŸŽ€

okay so listen, this one's from the kernel's own little manual set (you know the one), and it's genuinely so useful once you get it. it's literally called fscache_invalidate, and it's giving main character energy in the caching world. let's get into it ✨


🌸 NAME 🌸

fscache_invalidate β€” notify the cache that an object needs invalidation πŸ¦‹

no cap, that's the whole vibe: you're telling the cache "bestie, this thing is stale, handle it."


⭐ SYNOPSIS ⭐

void fscache_invalidate (struct fscache_cookie *cookie , const void
*aux_data , loff_t size , unsigned int flags );

returns void, so like... nothing comes back. it just does the thing. periodt. πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • cookie β€” the cookie representing the cache object. yes, an actual cookie πŸͺ (not the edible kind, sadly 😭). it's your handle to the thing in the cache.
  • aux_data β€” the updated auxiliary data for the cookie. it may be NULL, so don't stress if you've got nothing to put there πŸ™ˆ
  • size β€” the revised size of the object. type is loff_t, so bestie, it's a real size number.
  • flags β€” invalidation flags, and they come from the FSCACHE_INVAL_* family πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

so what does it actually do? it notifies the cache that an object needs to be invalidated, and that it should abort any retrievals or stores it's doing on the cache. like, wrap it up, we're done here πŸ’€

the way that this works: it increments inval_counter on the cookie, and that counter is there so the caller can reconsider I/O requests as they complete. it's giving ✨ bookkeeping that actually matters ✨

and here's the important bit, highkey β€” if flags has FSCACHE_INVAL_DIO_WRITE set, that indicates this is due to a direct I/O write, and it will cause caching to be disabled on this cookie until it is completely unused. so yeah, that flag means caching goes bye bye on that cookie until nothing's using it anymore 🫢

fr fr, if you want the full description, it lives in Documentation/filesystems/caching/netfs-api.rst β€” go read it, it ate πŸ”₯

🌈 SEE ALSO 🌈

kernel file ./include/linux/fscache.h, plus the whole friend group of (9) pages, and yes we're listing every single one because nobody gets left out πŸ’œ


and that's the whole page, bestie 🧚✨ it's from ./include/linux, the Kernel API Manual, dated October 2026 β€” so go forth, invalidate those objects, and slay πŸ’…πŸŒΈπŸ‘‘

πŸ“¦ where this page comes from