]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/idr.h
lib/idr.c: fix rcu related race with idr_find
[linux-2.6-omap-h63xx.git] / include / linux / idr.h
index fa035f96f2a3b340c468e4b58d9010df3b21be69..dd846df8cd32182f6740ea59f6451079deb3060d 100644 (file)
@@ -52,13 +52,14 @@ struct idr_layer {
        unsigned long            bitmap; /* A zero bit means "space here" */
        struct idr_layer        *ary[1<<IDR_BITS];
        int                      count;  /* When zero, we can release it */
+       int                      layer;  /* distance from leaf */
        struct rcu_head          rcu_head;
 };
 
 struct idr {
        struct idr_layer *top;
        struct idr_layer *id_free;
-       int               layers;
+       int               layers; /* only valid without concurrent changes */
        int               id_free_cnt;
        spinlock_t        lock;
 };