filemap_range_has_page(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… filemap_range_has_page β€” like, the whole vibe of this page

okay so real talk, this one lives in the Kernel API Manual, and it's genuinely one of the more chill functions you'll meet. no cap. let's get into it 🫢


✨ NAME ✨

filemap_range_has_page β€” bestie, it checks if a page exists in a range. that's it, that's the whole job πŸŽ€


🌸 SYNOPSIS 🌸

bool filemap_range_has_page (struct address_space *mapping , loff_t
start_byte , loff_t end_byte );

look at her. three args, returns a bool. she's an icon, she's a legend, and she is the moment πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • mapping β€” the address space you're poking around in. this is the "where am i even looking" arg, and it's a struct address_space * so yeah, pointer brain on πŸ’œ
  • start_byte β€” offset in bytes where the range starts. like, where the little search party begins πŸ“
  • end_byte β€” offset in bytes where the range ends, and listen: it's inclusive. meaning the end_byte position is in the range. do not come for her boundaries, she's very clear about them ✨

🧚 DESCRIPTION 🧚

so the whole point: she goes and finds at least one page in the range you supplied. that's the mission. that's the entire mission πŸ’…

and where does this actually get used? usually to check if direct writing in this range will trigger a writeback. so like, "hey bestie, if i write here, is that gonna kick off a writeback?" β€” that's the vibe check this function performs πŸ”₯

not me being obsessed with a range-checking function. but here we are. main character energy fr fr πŸ’€


🌈 RETURN 🌈

  • true β€” yay! at least one page exists in the specified range πŸŽ‰
  • false β€” no page in there. empty. ghost town. periodt πŸ’€

she literally returns a bool, so no sneaky extra values, no surprises, we love a consistent queen πŸ‘‘


⭐ SEE ALSO ⭐

okay this list is long long, so buckle up bestie, we're going through all of it. no skipping, no summarising, i would never πŸ™ˆ

first, the source of all this lore lives in the kernel file ./mm/filemap.c, which is basically the group chat where all these functions hang out:

like i said. long long. go read them all, i believe in you 🫢✨


reminder bestie: end_byte is inclusive. i know i said it already but i will say it again because someone always forgets πŸ’…

and that's the page!! this one's from ./mm, and the version/date on the tin is October 2026 β€” so mark your calendars, screenshot it, send it to the group chat πŸŽ€πŸ¦‹ bye bestie, go check those ranges πŸ’–

πŸ“¦ where this page comes from