aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/idr.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/idr.h')
-rw-r--r--include/linux/idr.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/linux/idr.h b/include/linux/idr.h
index 6af3400b9b2f..013fd9bc4cb6 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -29,21 +29,24 @@
29 29
30struct idr_layer { 30struct idr_layer {
31 int prefix; /* the ID prefix of this idr_layer */ 31 int prefix; /* the ID prefix of this idr_layer */
32 DECLARE_BITMAP(bitmap, IDR_SIZE); /* A zero bit means "space here" */ 32 int layer; /* distance from leaf */
33 struct idr_layer __rcu *ary[1<<IDR_BITS]; 33 struct idr_layer __rcu *ary[1<<IDR_BITS];
34 int count; /* When zero, we can release it */ 34 int count; /* When zero, we can release it */
35 int layer; /* distance from leaf */ 35 union {
36 struct rcu_head rcu_head; 36 /* A zero bit means "space here" */
37 DECLARE_BITMAP(bitmap, IDR_SIZE);
38 struct rcu_head rcu_head;
39 };
37}; 40};
38 41
39struct idr { 42struct idr {
40 struct idr_layer __rcu *hint; /* the last layer allocated from */ 43 struct idr_layer __rcu *hint; /* the last layer allocated from */
41 struct idr_layer __rcu *top; 44 struct idr_layer __rcu *top;
42 struct idr_layer *id_free;
43 int layers; /* only valid w/o concurrent changes */ 45 int layers; /* only valid w/o concurrent changes */
44 int id_free_cnt;
45 int cur; /* current pos for cyclic allocation */ 46 int cur; /* current pos for cyclic allocation */
46 spinlock_t lock; 47 spinlock_t lock;
48 int id_free_cnt;
49 struct idr_layer *id_free;
47}; 50};
48 51
49#define IDR_INIT(name) \ 52#define IDR_INIT(name) \