__filemap_get_folio_mpol(9)
π
__filemap_get_folio_mpol(9) π
okay bestie, welcome to the Kernel API Manual side of the group chat β¨ this is the page for __filemap_get_folio_mpol(9), and it is literally about finding a folio and getting a reference to it. very kernel-internals main character energy, no cap π
β¨ NAME β¨
__filemap_get_folio_mpol β Find and get a reference to a folio. Thatβs the whole vibe: find the folio, get the reference. π
π¦ SYNOPSIS π¦
struct folio * __filemap_get_folio_mpol (struct address_space *mapping ,
pgoff_t index , fgf_t fgp_flags , gfp_t gfp , struct mempolicy *policy
);
πΈ ARGUMENTS πΈ
mappingβ theaddress_spaceto search. πindexβ the page index. πfgp_flagsβFGPflags modify how the folio is returned. πgfpβ memory allocation flags to use ifFGP_CREATis specified. π§policyβ NUMA memory allocation policy to follow. π
π DESCRIPTION π
okay so this function looks up the page cache entry at mapping & index. Thatβs the lookup. π
If FGP_LOCK or FGP_CREAT are specified, then the function may sleep β even if the GFP flags specified for FGP_CREAT are atomic. Yes, even then. Like, it can literally nap on you. π΄
If this function returns a folio, it is returned with an increased refcount. So if it hands you a folio, the refcount has been bumped β you got a ref, bestie. π«Ά
β RETURN β
The found folio, or an ERR_PTR otherwise. Thatβs the tea. β
π₯ SEE ALSO π₯
go read these too, bestie β the whole filemap cinematic universe is right here:
- 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)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)
cute little sign-off moment: this one is from source/version ./mm, dated October 2026, and itβs the __filemap_get_folio_mpol(9) page. bye bestie, go handle those references responsibly πβ¨
π¦ 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