filemap_get_folios_tag(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– filemap_get_folios_tag(9) πŸ’–

Okay bestie, welcome to the Kernel API Manual ✨ β€” today's main character is filemap_get_folios_tag, and honestly? She's giving "batch fetch but make it tagged." Let's get into it 🫢


🌸 NAME 🌸

filemap_get_folios_tag β€” get a batch of folios matching @tag πŸŽ€

✨ SYNOPSIS ✨

unsigned filemap_get_folios_tag (struct address_space *mapping , pgoff_t
*start , pgoff_t end , xa_mark_t tag , struct folio_batch *fbatch );

πŸ’… ARGUMENTS πŸ’…

  • mapping β€” the address_space you're searching, aka the vibe-check zone πŸ’«
  • start β€” the starting page index, where the hunt begins πŸ‘‘
  • end β€” the final page index, and yes bestie it's inclusive 🫢
  • tag β€” the tag index, the filter of it all πŸŽ€
  • fbatch β€” the batch to fill, the little bucket she fills up 🧺

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea β˜•: the first folio may start before start β€” and if it does, it'll contain start. The final folio may extend beyond end, and if it does, it'll contain end. Lowkey flexible like that πŸ’β€β™€οΈ

The folios have ascending indices β€” all lined up in order, slay ✨

There may be gaps between the folios if there are indices which have no folio in the page cache β€” so don't be shocked by a missing spot, it's just how it is πŸ™ˆ

Ngl this part matters: if folios are added to or removed from the page cache while this is running, they may or may not be found by this call. No cap, concurrent changes are not guaranteed to show up. 😭

Only returns folios that are tagged with tag β€” she's selective, periodt πŸ’…

πŸ”₯ RETURN πŸ”₯

The number of folios found πŸ‘‘ Also, it updates start to index the next folio for traversal β€” so you can keep it moving, iykyk 🌈

🌟 SEE ALSO 🌟

Kernel file ./mm/filemap.c and honestly the whole friend group:


That's the whole page bestie πŸ’– β€” brought to you by ./mm, the October 2026 edition of filemap_get_folios_tag(9). Go forth and batch those tagged folios, you icon πŸ‘‘πŸ¦‹

πŸ“¦ where this page comes from