radix_tree_gang_lookup_tag(9)
π radix_tree_gang_lookup_tag(9) β¨
okay bestie, so this one is from the Kernel API Manual and it's lowkey one of the most useful little gremlins in the radix tree family π
πΈ NAME πΈ
radix_tree_gang_lookup_tag β perform multiple lookup on a radix tree based on a tag
like, you're not just grabbing one thing, you're grabbing a whole gang of things, and only the ones wearing the right tag π·οΈβ¨
π¦ SYNOPSIS π¦
unsigned int radix_tree_gang_lookup_tag (const struct radix_tree_root
*root , void **results , unsigned long first_index , unsigned int
max_items , unsigned int tag );
ngl the formatting there is giving "wrapped by the manpage renderer" but the signature is the signature, periodt π
π ARGUMENTS π
rootβ the radix tree root. this is the main character, the whole tree hangs off it πresultsβ where the results of the lookup are placed. your output buffer, your lil collection basket π§Ίfirst_indexβ start the lookup from this key. no scrolling back, we go forward from here β©max_itemsβ place up to this many items at*results. it's a cap, not a promise π«Άtagβ the tag index (< RADIX_TREE_MAX_TAGS). yes, strictly less than, don't try it π₯
β DESCRIPTION β
so what this does: it performs an index-ascending scan of the tree for present items which have the tag indexed by tag set π
ascending means it walks upward through the indices β it does not jump around, it does not go backwards, it just goes up, up, up π
everything it finds gets placed at *results and then it returns the number of items which were placed at *results π’
so the return value is literally "how many did I actually put in your buffer" β if that number is less than max_items, congrats, you hit the end, no more matching items π
π SEE ALSO π
go read these next, i'm obsessed with the whole squad fr fr:
- Kernel file
./lib/radix-tree.c radix_tree_find_next_bit(9)radix_tree_shrink(9)__radix_tree_create(9)radix_tree_insert(9)__radix_tree_lookup(9)radix_tree_lookup_slot(9)radix_tree_lookup(9)__radix_tree_replace(9)radix_tree_replace_slot(9)radix_tree_iter_replace(9)radix_tree_tag_set(9)radix_tree_tag_clear(9)radix_tree_iter_tag_clear(9)radix_tree_tag_get(9)radix_tree_next_chunk(9)radix_tree_gang_lookup(9)radix_tree_gang_lookup_tag_slot(9)radix_tree_iter_delete(9)radix_tree_delete_item(9)radix_tree_delete(9)radix_tree_tagged(9)idr_preload(9)idr_destroy(9)
iykyk π§π
that's the whole page bestie, no notes, we ate π β¨
sign-off time: this one lives under ./lib and the date on the tin is October 2026, so yeah β that's the vibe, that's the version, mwah ππ«Ά
go tag something, bestie. not me being proud of you ππ
π¦ 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