idr/ida Functions

idr_pre_get — reserve resources for idr allocation
idr_get_new_above — allocate new idr entry above or equal to a start id
idr_get_new — allocate new idr entry
idr_remove — remove the given id and free its slot
idr_remove_all — remove all ids from the given idr tree
idr_destroy — release all cached layers within an idr tree
idr_find — return pointer for given id
idr_for_each — iterate through all stored pointers
idr_get_next — lookup next object of id to given id.
idr_replace — replace pointer for given id
idr_init — initialize idr handle
ida_pre_get — reserve resources for ida allocation
ida_get_new_above — allocate new ID above or equal to a start id
ida_get_new — allocate new ID
ida_remove — remove the given ID
ida_destroy — release all cached layers within an ida tree
ida_init — initialize ida handle

idr synchronization (stolen from radix-tree.h)

idr_find is able to be called locklessly, using RCU. The caller must ensure calls to this function are made within rcu_read_lock regions. Other readers (lock-free or otherwise) and modifications may be running concurrently.

It is still required that the caller manage the synchronization and lifetimes of the items. So if RCU lock-free lookups are used, typically this would mean that the items have their own locks, or are amenable to lock-free access; and that the items are freed by RCU (or only freed after having been deleted from the idr tree *and* a synchronize_rcu grace period).

IDA - IDR based ID allocator

This is id allocator without id -> pointer translation. Memory usage is much lower than full blown idr because each id only occupies a bit. ida uses a custom leaf node which contains IDA_BITMAP_BITS slots.

2007-04-25 written by Tejun Heo <htejungmail.com>