bitmap_write(9)
π 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 tonbits. ok so important: she gets clamped tonbits, 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 toBITS_PER_LONG. so likeβ¦ nonzero. and not bigger thanBITS_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: fornbits == 0andnbits > 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 π
- Kernel file
./include/linux/bitmap.hbitmap overview(9) bitmap bitops(9)declare bitmap(9)bitmap_find_next_zero_area(9)bitmap_or_equal(9)bitmap_weight_from(9)bitmap_scatter(9)bitmap_gather(9)bitmap_release_region(9)bitmap_allocate_region(9)bitmap_find_free_region(9)BITMAP_FROM_U64(9)bitmap_from_u64(9)bitmap_read(9)
π 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms