idr_find(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ idr_find(9) ✨

okay so bestie, welcome to the Kernel API Manual β€” this is the idr_find(9) page and it's literally the "hey can u look up this pointer for me" function πŸ’…


πŸŽ€ NAME πŸŽ€

idr_find β€” Return pointer for given ID.


πŸ¦‹ SYNOPSIS πŸ¦‹

void * idr_find (const struct idr *idr , unsigned long id );

🌸 ARGUMENTS 🌸

  • idr β€” your IDR handle 🫢 like, this is the thing you're searching in, bestie.
  • id β€” the pointer ID. the actual id. the number. the whole reason we're here πŸ’«

πŸ’– DESCRIPTION πŸ’–

So what it does is looks up the pointer associated with this ID. That's the vibe. That's the whole thing ✨

But okay, heads up, because this is lowkey important: a NULL pointer may indicate that id is not allocated, or that the NULL pointer was associated with this ID. like, those are two completely different situations and NULL can't tell you which one you're in 😭 so don't just assume, okay?

Also the good news: this function can be called under rcu_read_lock, given that the leaf pointers lifetimes are correctly managed πŸ‘‘ that's the caveat though β€” given that the leaf pointers' lifetimes are correctly managed. keep that in mind fr fr.


⭐ RETURN ⭐

The pointer associated with this ID. that's it, that's the return πŸ’…


🌈 SEE ALSO 🌈

Kernel file ./lib/idr.c


anyway that's the whole page, go look up your pointers bestie, you got this πŸ§šπŸ’œ

./lib Β· October 2026 Β· idr_find(9) β€” mwah, that's a wrap, slay πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from