for_each_cle...itrange_from(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… for_each_clear_bitrange_from(9) β€” like, the whole kernel API manual page, bestie

okay so this is from the Kernel API Manual, section 9 (for_each_cle...itrange_from(9) β€” yes the title is truncated, no I didn't do that, that's just how it's printed πŸ’€). Buckle up, we're going bit-by-bit and it's gonna slay.


✨ NAME ✨

for_each_clear_bitrange_from β€” iterate over all unset bit ranges [b; e)

that's it. that's the whole vibe. we're walking through every stretch of zeros in a bitmap, starting from a spot you pick. iconic behavior honestly 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

for_each_clear_bitrange_from (b , e , addr , size );

look at that spacing. don't touch it. it's canon. πŸ’…


🌸 ARGUMENTS 🌸

  • b β€” bit offset of the start of the current bitrange (the first unset bit), and listen: it must be initialized. like, you have to set it before you go. no cap, it's not optional, don't come crying to me if you skip it 😭
  • e β€” bit offset of the end of the current bitrange (the first set bit). that's where the run of zeros stops, bestie.
  • addr β€” bitmap address to base the search on. this is the actual bitmap you're digging through πŸŽ€
  • size β€” bitmap size in number of bits. yes, bits, not bytes, read it again πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

fr fr go read these too, they're all in the kernel file ./include/linux/find.h and honestly the whole friend group is here:

that's twenty-two entries, every single one of them, I counted twice so you don't have to 🧚


lowkey a reminder: b being uninitialized is the classic oopsie here. the docs literally say "must be initialized" β€” that's not me being dramatic, that's the spec πŸ’€

okay that's the page!! mwah πŸ’– it lives under ./include/linux, and this particular printing is dated October 2026 β€” so like, future vibes. anyway, for_each_cle...itrange_from(9), that's a wrap, go iterate responsibly βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from