folio_invalidate(9)
π NAME π
okay so bestie, welcome to the folio_invalidate(9) page from the Kernel API Manual β and the name is literally folio_invalidate β Invalidate part or all of a folio. That's the whole vibe: part of a folio, or all of it, gets invalidated. slay. β¨
β¨ SYNOPSIS β¨
Here's the signature, no cap β copy it exactly:
void folio_invalidate (struct folio *folio , size_t offset , size_t
length );
π ARGUMENTS π
Three arguments, bestie β let's do the vibe check:
folioβ The folio which is affected.offsetβ start of the range to invalidatelengthβ length of the range to invalidate
π¦ DESCRIPTION π¦
okay so here's when this icon gets called: folio_invalidate is called when all or part of the folio has become invalidated by a truncate operation. π«Ά
Now the important part β folio_invalidate does not have to release all buffers, but it must ensure that no dirty buffer is left outside offset and that no I/O is underway against any of the blocks which are outside the truncation point. That's literally non-negotiable, because the caller is about to free (and possibly reuse) those blocks on-disk. ππ
π SEE ALSO π
Go read these next, iykyk β same order, bestie:
- Kernel file
./mm/truncate.c mapping_evict_folio(9)truncate_inode_pages_range(9)truncate_inode_pages(9)truncate_inode_pages_final(9)mapping_try_invalidate(9)invalidate_mapping_pages(9)invalidate_inode_pages2_range(9)invalidate_inode_pages2(9)truncate_pagecache(9)truncate_setsize(9)pagecache_isize_extended(9)truncate_pagecache_range(9)
xoxo π this page came from ./mm and is dated October 2026 β you just got the whole folio_invalidate(9) moment, mwah! πβ¨
π¦ 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