filemap_ran...ds_writeback(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

ok so this whole page is about filemap_range_needs_writeback β€” and yes bestie, the header is literally truncated as filemap_ran...ds_writeback(9) because some things are just too iconic to fit πŸ’…. It lives in section 9 of the Kernel API Manual, and what it does is check if a range potentially needs writeback. that's the whole vibe check right there.


🫢 SYNOPSIS 🫢

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

look at her go 😭 returns a bool, takes three args, no notes.


πŸŽ€ ARGUMENTS πŸŽ€

  • mapping β€” the address space you're checking inside of. like, the neighborhood you're snooping around in 🏘️
  • start_byte β€” the offset in bytes where the range starts
  • end_byte β€” the offset in bytes where the range ends, and it's inclusive, so the end byte is part of the party too, no cap πŸŽ‰

πŸ”₯ DESCRIPTION πŸ”₯

So the whole point: this finds at least one page in the range you handed it. Usually it's used to check whether direct writing inside that range is gonna trigger a writeback β€” like a little "hey bestie, is this about to get messy?" heads-up 🌸.

It's used by O_DIRECT read/write with IOCB_NOWAIT, to see if the caller needs to do filemap_write_and_wait_range before proceeding. so it's literally the "do I have to do the boring wait thing first?" detector 🧚


⭐ RETURN ⭐

  • true β€” yes babes, the caller should do filemap_write_and_wait_range before doing O_DIRECT to a page in this range πŸ’–
  • false β€” nope, you're free, go do your O_DIRECT thing πŸ¦‹

🌈 SEE ALSO 🌈

the whole friend group showed up for this one, we love to see it πŸ‘‘

Kernel file ./include/linux/pagemap.h


ok that's the whole page, you ate that πŸ’…βœ¨ and for the sign-off credits moment: this lil masterpiece is sourced from ./include/linux, dated October 2026, and it's filed under filemap_ran...ds_writeback(9) in the Kernel API Manual. periodt πŸ“πŸ‘‘

πŸ“¦ where this page comes from