mapping_try_invalidate(9)
π mapping_try_invalidate β Kernel API Manual β¨
okay so bestie, let me tell you about mapping_try_invalidate β it's a kernel function and honestly it's giving very "I tried my best and I'm telling you exactly what didn't work" energy π
π¦ NAME π¦
mapping_try_invalidate β invalidate all the evictable folios of one inode, no cap π
β¨ SYNOPSIS β¨
unsigned long mapping_try_invalidate (struct address_space *mapping ,
pgoff_t start , pgoff_t end , unsigned long *nr_failed );
literally the whole signature, copy it exactly, do not touch a single character π
πΈ ARGUMENTS πΈ
mappingβ theaddress_spacewhich holds the folios to invalidate. yes bestie, this is the container we're cleaning out π₯startβ the offset 'from' which to invalidate. where the chaos begins βendβ the offset 'to' which to invalidate (inclusive). inclusive is doing so much work in that sentence, don't forget it π«Άnr_failedβ how many folio invalidations failed. the receipts, basically π
π DESCRIPTION π
so this function is similar to invalidate_mapping_pages, except β and this is the main character moment β it returns the number of folios which could not be evicted in nr_failed. like, not just "did it work?" but "here's exactly how many didn't, bestie" π
ngl that's the whole difference, but it's an important one, so remember it π
π SEE ALSO π
Kernel file ./mm/truncate.c: folio_invalidate(9), mapping_evict_folio(9), truncate_inode_pages_range(9), truncate_inode_pages(9), truncate_inode_pages_final(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)
like a whole friend group of truncate and invalidate functions, iykyk π§
okay that's the page!! this lil doc lives in ./mm, October 2026 edition, and it's filed under mapping_try_invalidate(9) β slay, go read the other ones too πβ¨π
π¦ 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