idr_find(9)
β¨ 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
idr_alloc_u32(9)idr_alloc(9)idr_alloc_cyclic(9)idr_remove(9)idr_for_each(9)idr_get_next_ul(9)idr_get_next(9)idr_replace(9)IDA description(9)ida_alloc_range(9)ida_find_first_range(9)ida_free(9)ida_destroy(9)
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
- 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