filemap_get_folios_dirty(9)
π 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β theaddress_spaceyou'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:
filemap_remove_folio(9)filemap_fdatawrite_range(9)filemap_flush_range(9)filemap_flush(9)filemap_range_has_page(9)filemap_fdatawait_range(9)filemap_fdatawait_range_keep_errors(9)file_fdatawait_range(9)filemap_fdatawait_keep_errors(9)filemap_write_and_wait_range(9)file_check_and_advance_wb_err(9)file_write_and_wait_range(9)replace_page_cache_folio(9)softleaf_entry_wait_on_locked(9)folio_put_wait_locked(9)folio_unlock(9)folio_end_read(9)folio_end_private_2(9)folio_wait_private_2(9)folio_wait_private_2_killable(9)folio_end_writeback_no_dropbehind(9)folio_end_writeback(9)__folio_lock(9)page_cache_next_miss(9)page_cache_prev_miss(9)__filemap_get_folio_mpol(9)find_get_entries(9)find_lock_entries(9)filemap_get_folios(9)filemap_get_folios_contig(9)filemap_get_folios_tag(9)filemap_read(9)generic_file_read_iter(9)filemap_splice_read(9)mapping_seek_hole_data(9)filemap_fault(9)read_cache_folio(9)mapping_read_folio_gfp(9)read_cache_page_gfp(9)__generic_file_write_iter(9)generic_file_write_iter(9)filemap_release_folio(9)filemap_invalidate_inode(9)filemap_cachestat(9)
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
- 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