fscache_invalidate(9)
π 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 beNULL, so don't stress if you've got nothing to put there πsizeβ the revised size of the object. type isloff_t, so bestie, it's a real size number.flagsβ invalidation flags, and they come from theFSCACHE_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 π
fscache_acquire_volume(9)fscache_relinquish_volume(9)fscache_acquire_cookie(9)fscache_use_cookie(9)fscache_unuse_cookie(9)fscache_relinquish_cookie(9)fscache_update_cookie(9)fscache_resize_cookie(9)fscache_operation_valid(9)fscache_begin_read_operation(9)fscache_end_operation(9)fscache_read(9)fscache_begin_write_operation(9)fscache_write(9)fscache_clear_page_bits(9)fscache_write_to_cache(9)fscache_note_page_release(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms