__filemap_get_folio_mpol(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __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 β€” the address_space to search. πŸ”
  • index β€” the page index. πŸ“‘
  • fgp_flags β€” FGP flags modify how the folio is returned. πŸŽ€
  • gfp β€” memory allocation flags to use if FGP_CREAT is 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:


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