Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/src/linux_idr.c
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
#define MAX_IDR_FREE (MAX_IDR_LEVEL * 2) | #define MAX_IDR_FREE (MAX_IDR_LEVEL * 2) | ||||
struct linux_idr_cache { | struct linux_idr_cache { | ||||
spinlock_t lock; | spinlock_t lock; | ||||
struct idr_layer *head; | struct idr_layer *head; | ||||
unsigned count; | unsigned count; | ||||
}; | }; | ||||
static DPCPU_DEFINE(struct linux_idr_cache, linux_idr_cache); | DPCPU_STATIC_DEFINE(struct linux_idr_cache, linux_idr_cache); | ||||
/* | /* | ||||
* IDR Implementation. | * IDR Implementation. | ||||
* | * | ||||
* This is quick and dirty and not as re-entrant as the linux version | * This is quick and dirty and not as re-entrant as the linux version | ||||
* however it should be fairly fast. It is basically a radix tree with | * however it should be fairly fast. It is basically a radix tree with | ||||
* a builtin bitmap for allocation. | * a builtin bitmap for allocation. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 744 Lines • Show Last 20 Lines |