bitmap_write(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– bitmap_write(9) β€” the bitmap_write girlies' guide πŸ’–

okay so bestie, this page is from the Kernel API Manual, section 9, and it's all about bitmap_write β€” the little function that tucks an n-bit value into a bitmap and honestly? she's iconic for it. 🌸


✨ SYNOPSIS ✨

void bitmap_write (unsigned long *map , unsigned long value , unsigned
long start , unsigned long nbits );

like, that's the whole thing. no cap, that's it. πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • map β€” address to the bitmap memory region. this is the vibe, the venue, the place where the bits actually live πŸ—ΊοΈ
  • value β€” value to write, clamped to nbits. ok so important: she gets clamped to nbits, so don't come crying if your extra bits didn't make the cut πŸ’€
  • start β€” bit offset of the n-bit value. i.e. where in the bitmap your little value starts living ✨
  • nbits β€” size of value in bits, nonzero, up to BITS_PER_LONG. so like… nonzero. and not bigger than BITS_PER_LONG. noted, bestie πŸ”₯

πŸ¦‹ DESCRIPTION πŸ¦‹

bitmap_write behaves as-if implemented as nbits calls of __assign_bit β€” the way that she just calls it over and over, one bit at a time, obsessed fr fr. and bits beyond nbits are ignored:

for (bit = 0; bit < nbits; bit++) __assign_bit(start + bit, bitmap, val
& BIT(bit));

like literally the whole personality is that loop 😭

heads up bestie: for nbits == 0 and nbits > BITS_PER_LONG, no writes are performed. not a single write. zero. she simply does not show up πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

go read these too, iykyk, they're all part of the same friend group πŸ’œ


🌈 ok that's the page!! source is the kernel file ./include/linux, dated October 2026, from the Kernel API Manual β€” mwah, slay, go write some bits bestie πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from