__sbitmap_queue_get_batch(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 __sbitmap_queue_get_batch(9) β€” Kernel API Manual, bestie edition 🌸

okay so picture this: you're deep in the kernel, you've got a bitmap queue, and you don't want one free bit, you want a whole lil squad of them. That's this function. It lives in the Kernel API Manual and it's genuinely so useful, iykyk πŸ’…


✨ NAME ✨

__sbitmap_queue_get_batch β€” try to allocate a batch of free bits πŸŽ€

like, try. It's giving "best effort", not "guaranteed", and honestly? respect.


πŸ¦‹ SYNOPSIS πŸ¦‹

unsigned long __sbitmap_queue_get_batch (struct sbitmap_queue *sbq , int
nr_tags , unsigned int *offset );

look at her. one function call, three params, returns an unsigned long. main character energy fr fr πŸ‘‘


πŸ’– ARGUMENTS πŸ’–

  • sbq β€” the bitmap queue you're allocating from. this is your source, your supply, your whole vibe. 🫢
  • nr_tags β€” how many tags you're asking for. the number of tags requested, bestie, that's literally it.
  • offset β€” an offset to add to the returned bits. it's a pointer, so she's writing back to you. pay attention. ✨

⭐ RETURN ⭐

A mask of allocated tags, or 0 if none are found. πŸ’€ (yes, 0 means you got nothing, sorry.)

Here's the part you cannot skip, no cap:

Each tag allocated is a bit in the mask returned, and the caller must add offset to the value to get the absolute tag value.

so like, the mask is relative. offset is the translation layer. don't forget to add it or you'll be out here reading the wrong tags and that is not the slay you want. πŸ™ˆ


🧚 SEE ALSO 🧚

Kernel file ./include/linux/sbitmap.h, plus the whole entire friend group:

that's the whole roster. go read them, they're iconic. πŸ‘‘


okay that's the page!! mwah πŸ’‹ β€” sourced from ./include/linux, dated October 2026, and that's the __sbitmap_queue_get_batch(9) manual page, signed, sealed, slayed. πŸŒˆπŸ’œ

πŸ“¦ where this page comes from