1IDR_ALLOC_CYCLIC(9) Basic Kernel Library Functions IDR_ALLOC_CYCLIC(9)
2
3
4
6 idr_alloc_cyclic - allocate new idr entry in a cyclical fashion
7
9 int idr_alloc_cyclic(struct idr * idr, void * ptr, int start, int end,
10 gfp_t gfp_mask);
11
13 idr
14 the (initialized) idr
15
16 ptr
17 pointer to be associated with the new id
18
19 start
20 the minimum id (inclusive)
21
22 end
23 the maximum id (exclusive, <= 0 for max)
24
25 gfp_mask
26 memory allocation flags
27
29 Essentially the same as idr_alloc, but prefers to allocate
30 progressively higher ids if it can. If the “cur” counter wraps, then it
31 will start again at the “start” end of the range and allocate one that
32 has already been used.
33
35Kernel Hackers Manual 3.10 June 2019 IDR_ALLOC_CYCLIC(9)