]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - lib/idr.c
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[karo-tx-linux.git] / lib / idr.c
index 1ba4956bfbff70cb8d295809577ea2c7cbfcebf8..2642fa8e424dc1a4db769b0eae5e5aa94997f53e 100644 (file)
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -196,7 +196,7 @@ static void idr_mark_full(struct idr_layer **pa, int id)
        }
 }
 
-int __idr_pre_get(struct idr *idp, gfp_t gfp_mask)
+static int __idr_pre_get(struct idr *idp, gfp_t gfp_mask)
 {
        while (idp->id_free_cnt < MAX_IDR_FREE) {
                struct idr_layer *new;
@@ -207,7 +207,6 @@ int __idr_pre_get(struct idr *idp, gfp_t gfp_mask)
        }
        return 1;
 }
-EXPORT_SYMBOL(__idr_pre_get);
 
 /**
  * sub_alloc - try to allocate an id without growing the tree depth
@@ -374,20 +373,6 @@ static void idr_fill_slot(struct idr *idr, void *ptr, int id,
        idr_mark_full(pa, id);
 }
 
-int __idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id)
-{
-       struct idr_layer *pa[MAX_IDR_LEVEL + 1];
-       int rv;
-
-       rv = idr_get_empty_slot(idp, starting_id, pa, 0, idp);
-       if (rv < 0)
-               return rv == -ENOMEM ? -EAGAIN : rv;
-
-       idr_fill_slot(idp, ptr, rv, pa);
-       *id = rv;
-       return 0;
-}
-EXPORT_SYMBOL(__idr_get_new_above);
 
 /**
  * idr_preload - preload for idr_alloc()
@@ -548,7 +533,7 @@ static void sub_remove(struct idr *idp, int shift, int id)
        n = id & IDR_MASK;
        if (likely(p != NULL && test_bit(n, p->bitmap))) {
                __clear_bit(n, p->bitmap);
-               rcu_assign_pointer(p->ary[n], NULL);
+               RCU_INIT_POINTER(p->ary[n], NULL);
                to_free = NULL;
                while(*paa && ! --((**paa)->count)){
                        if (to_free)
@@ -607,7 +592,7 @@ void idr_remove(struct idr *idp, int id)
 }
 EXPORT_SYMBOL(idr_remove);
 
-void __idr_remove_all(struct idr *idp)
+static void __idr_remove_all(struct idr *idp)
 {
        int n, id, max;
        int bt_mask;
@@ -617,7 +602,7 @@ void __idr_remove_all(struct idr *idp)
 
        n = idp->layers * IDR_BITS;
        p = idp->top;
-       rcu_assign_pointer(idp->top, NULL);
+       RCU_INIT_POINTER(idp->top, NULL);
        max = idr_max(idp->layers);
 
        id = 0;
@@ -640,7 +625,6 @@ void __idr_remove_all(struct idr *idp)
        }
        idp->layers = 0;
 }
-EXPORT_SYMBOL(__idr_remove_all);
 
 /**
  * idr_destroy - release all cached layers within an idr tree