filemap_get_folios_dirty(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– filemap_get_folios_dirty β€” Kernel API Manual πŸ’–

okay so bestie, welcome to the filemap_get_folios_dirty(9) page 🌸 this one lives in the Kernel API Manual and honestly it's giving "little helper, big job" energy. let's get into it ✨


✨ NAME ✨

filemap_get_folios_dirty β€” grab yourself a whole batch of dirty folios πŸ§šβ€β™€οΈ no cap, that's literally the whole vibe.


πŸ¦‹ SYNOPSIS πŸ¦‹

unsigned filemap_get_folios_dirty (struct address_space *mapping ,
pgoff_t *start , pgoff_t end , struct folio_batch *fbatch );

look at that signature. four whole arguments, returning an unsigned. she's tidy, she's specific, she's iconic πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • mapping β€” the address_space you're searching through πŸ—ΊοΈ this is the zone you're digging in.
  • start β€” the starting folio index. where you begin, bestie 🏁
  • end β€” the final folio index, and yes it's inclusive so don't forget the last one πŸ™ˆ
  • fbatch β€” the batch you're filling up. this is the lil basket you're collecting them in 🧺

πŸ’œ DESCRIPTION πŸ’œ

so filemap_get_folios_dirty works exactly like filemap_get_folios β€” same moves, same energy β€” except the folios it hands back are presumed to be dirty or already undergoing writeback 🫢

and why do we say presumed? because (and this is the important part, don't skip it) we don't block on folio lock, and we also don't wanna miss folios. so the dirty state is a vibe check, not a guarantee ✨ callers who genuinely need to know can recheck the state once they've locked the folio β€” that's the move πŸ”₯

⚠️ also! this may not return all the dirty folios if the batch gets filled up. so don't come for her if your batch ran out of room πŸ’€

⭐ RETURN ⭐

she returns the number of folios found πŸŽ‰ and she also updates start so it's positioned for traversal of the next folio β€” so you can just keep cruising along πŸ‘‘


🌈 SEE ALSO 🌈

Kernel file ./mm/filemap.c β€” and the whole extended fam, fr fr:


and that's the whole page, bestie 🫢 this one's from ./mm, dated October 2026 β€” like, mark your calendar, she's stamped and everything. mwah πŸ’‹ go read some folios πŸ’–

πŸ“¦ where this page comes from