idr_set_cursor(9)
π NAME π
idr_set_cursor β set the current position of the cyclic allocator, periodt. β¨
okay bestie, welcome to idr_set_cursor(9) from the Kernel API Manual. this is the little function that sets where the cyclic allocatorβs cursor is currently pointing, and itβs giving βtiny but importantβ energy. π
π SYNOPSIS π
void idr_set_cursor (struct idr *idr , unsigned int val );
πΈ ARGUMENTS πΈ
idrβ theidrhandle, aka the main character youβre moving the cursor inside. πvalβ the new position. the exact spot you want the cursor to be at, no cap. β¨
π¦ DESCRIPTION π¦
okay so hereβs the vibe: the next call to idr_alloc_cyclic will return val if itβs free. if itβs not free, the search will start from this position instead. thatβs literally the whole tea. π
so yeah β val is your βplease start hereβ request, and the allocator either returns it if itβs free or starts searching from that spot. π«Ά
π₯ SEE ALSO π₯
Kernel file: ./include/linux/idr.h β hereβs the whole squad of related pages, bestie:
IDR_INIT(9)DEFINE_IDR(9)idr_get_cursor(9)idr sync(9)idr_init_base(9)idr_init(9)idr_is_empty(9)idr_preload_end(9)idr_for_each_entry(9)idr_for_each_entry_ul(9)idr_for_each_entry_continue(9)idr_for_each_entry_continue_ul(9)ida_alloc(9)ida_alloc_min(9)ida_alloc_max(9)
xoxo, your local kernel bestie π β source/version: ./include/linux Β· date: October 2026 Β· page: idr_set_cursor(9) π
π¦ 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