filemap_get_folios_contig(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– filemap_get_folios_contig β€” Kernel API Manual ✨

okay so bestie, welcome to the filemap_get_folios_contig(9) page 🫢 this is the kernel API manual, and we're gonna get through it together, no cap.


🌸 NAME 🌸

filemap_get_folios_contig β€” grab a whole batch of folios that are actually contiguous, bestie. not just "kinda near each other", like actually back-to-back πŸ’…


✨ SYNOPSIS ✨

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

literally the whole signature, character for character, don't come for me πŸ™ˆ


πŸŽ€ ARGUMENTS πŸŽ€

  • mapping β€” the address_space we're searching through πŸ” that's the thing being searched, periodt.
  • start β€” the starting page index. where we begin the hunt ⭐
  • end β€” the final page index, and yes it's inclusive β€” end gets to come to the party too πŸ’œ
  • fbatch β€” the batch we're filling up πŸ“ this is the bucket, we put the folios in it.

πŸ¦‹ DESCRIPTION πŸ¦‹

so filemap_get_folios_contig works exactly like filemap_get_folios, bestie β€” same energy, same behaviour β€” except the folios it hands back are guaranteed to be contiguous πŸ”₯ that's the whole flex.

quick heads up tho: it may not return all the contiguous folios, because if the batch gets filled up, that's it, we're done, the bucket is full 😭 so don't assume you got everything, iykyk.


πŸ‘‘ RETURN πŸ‘‘

it returns the number of folios found πŸ”’ and it also updates start so it's positioned for traversal of the next folio β€” so like, start gets moved along for you, she's doing her own thing now πŸ’«


πŸ’€ SEE ALSO πŸ’€

okay this list is giving "the entire group chat got added to the call" β€” but every single one of these matters, so here we go 🌈

Kernel file ./mm/filemap.c, 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_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 page, bestie!! 🧚 mwah πŸ’‹ this lil cutie came from ./mm, dated October 2026, and she is officially filemap_get_folios_contig(9) β€” slay, ate, no crumbs, periodt πŸ‘‘

πŸ“¦ where this page comes from