idr_alloc — allocate an id
|struct idr * idr,|
|void * ptr,|
struct idr * idr
void * ptr
pointer to be associated with the new id
the minimum id (inclusive)
the maximum id (exclusive)
memory allocation flags
Allocates an unused ID in the range [start, end). Returns -ENOSPC if there are no unused IDs in that range.
end is treated as max when <= 0. This is to always allow
start + N as
end as long as N is inside integer range.
Simultaneous modifications to the
idr are not allowed and should be
prevented by the user, usually with a lock.
idr_alloc may be called
concurrently with read-only accesses to the
idr, such as