filemap_writ...d_wait_range(9)
π
filemap_write_and_wait_range β Kernel API Manual
okay bestie, so this one is a kernel API page (section 9, iykyk) and it's genuinely one of the more useful little gremlins in the mm family. It's filemap_write_and_wait_range, and yes the header truncates it to filemap_writ...d_wait_range(9) β that's just the man page being dramatic about column width, the real name is fine πΈ
β¨ NAME β¨
filemap_write_and_wait_range β write out & wait on a file range
like, it writes the thing AND waits for it. both. at once. main character energy π
β¨ SYNOPSIS β¨
int filemap_write_and_wait_range (struct address_space *mapping , loff_t
lstart , loff_t lend );
that's the whole vibe: it hands back an int, and it wants a mapping, an lstart, and an lend. no cap.
β¨ ARGUMENTS β¨
mappingβ theaddress_spacefor the pages π¦ (this is the whole little world the pages live in)lstartβ offset in bytes where the range startslendβ offset in bytes where the range ends (inclusive!! π«Ά)
β¨ DESCRIPTION β¨
Write out and wait upon file offsets lstart->lend, inclusive. literally the whole job. write them out, then wait on them. slay π
β οΈ note thatlendis inclusive (describes the last byte to be written) so that this function can be used to write to the very end-of-file (end=-1). that's the trick, bestie β the inclusive end is what makes this work for the actual end of the file, so don't go "fixing" it to be exclusive, that's not it π
β¨ RETURN β¨
error status of the address space. that's it, that's the return value π₯
β¨ SEE ALSO β¨
Kernel file ./mm/filemap.c β and okay this list is LONG so buckle up, here's every single one of them in order, no skipping, I would never π
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)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_get_folios_dirty(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 π cute little sign-off time: this one lives in the ./mm source location and the page is dated October 2026 ποΈβ¨ go write and wait on your ranges, icon behavior only π
π¦ 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