radix_tree_gang_lookup_tag(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:

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