idr_alloc_cyclic — allocate new idr entry in a cyclical fashion


int idr_alloc_cyclic (struct idr * idr,
 void * ptr,
 int start,
 int end,
 gfp_t gfp);


struct idr * idr

idr handle

void * ptr

pointer to be associated with the new id

int start

the minimum id (inclusive)

int end

the maximum id (exclusive)

gfp_t gfp

memory allocation flags


Allocates an ID larger than the last ID allocated if one is available. If not, it will attempt to allocate the smallest ID that is larger or equal to start.