Fix a dumb typo - use of & instead of &&
[safe/jmp/linux-2.6] / lib / radix-tree.c
index 23abbd9..6b9670d 100644 (file)
@@ -200,6 +200,9 @@ radix_tree_node_free(struct radix_tree_node *node)
  * ensure that the addition of a single element in the tree cannot fail.  On
  * success, return zero, with preemption disabled.  On error, return -ENOMEM
  * with preemption not disabled.
+ *
+ * To make use of this facility, the radix tree must be initialised without
+ * __GFP_WAIT being passed to INIT_RADIX_TREE().
  */
 int radix_tree_preload(gfp_t gfp_mask)
 {
@@ -361,7 +364,7 @@ static void *radix_tree_lookup_element(struct radix_tree_root *root,
        unsigned int height, shift;
        struct radix_tree_node *node, **slot;
 
-       node = rcu_dereference(root->rnode);
+       node = rcu_dereference_raw(root->rnode);
        if (node == NULL)
                return NULL;
 
@@ -381,7 +384,7 @@ static void *radix_tree_lookup_element(struct radix_tree_root *root,
        do {
                slot = (struct radix_tree_node **)
                        (node->slots + ((index>>shift) & RADIX_TREE_MAP_MASK));
-               node = rcu_dereference(*slot);
+               node = rcu_dereference_raw(*slot);
                if (node == NULL)
                        return NULL;
 
@@ -543,7 +546,6 @@ out:
 }
 EXPORT_SYMBOL(radix_tree_tag_clear);
 
-#ifndef __KERNEL__     /* Only the test harness uses this at present */
 /**
  * radix_tree_tag_get - get a tag on a radix tree node
  * @root:              radix tree root
@@ -566,7 +568,7 @@ int radix_tree_tag_get(struct radix_tree_root *root,
        if (!root_tag_get(root, tag))
                return 0;
 
-       node = rcu_dereference(root->rnode);
+       node = rcu_dereference_raw(root->rnode);
        if (node == NULL)
                return 0;
 
@@ -600,13 +602,12 @@ int radix_tree_tag_get(struct radix_tree_root *root,
                        BUG_ON(ret && saw_unset_tag);
                        return !!ret;
                }
-               node = rcu_dereference(node->slots[offset]);
+               node = rcu_dereference_raw(node->slots[offset]);
                shift -= RADIX_TREE_MAP_SHIFT;
                height--;
        }
 }
 EXPORT_SYMBOL(radix_tree_tag_get);
-#endif
 
 /**
  *     radix_tree_next_hole    -    find the next hole (not-present entry)
@@ -710,7 +711,7 @@ __lookup(struct radix_tree_node *slot, void ***results, unsigned long index,
                }
 
                shift -= RADIX_TREE_MAP_SHIFT;
-               slot = rcu_dereference(slot->slots[i]);
+               slot = rcu_dereference_raw(slot->slots[i]);
                if (slot == NULL)
                        goto out;
        }
@@ -757,7 +758,7 @@ radix_tree_gang_lookup(struct radix_tree_root *root, void **results,
        unsigned long cur_index = first_index;
        unsigned int ret;
 
-       node = rcu_dereference(root->rnode);
+       node = rcu_dereference_raw(root->rnode);
        if (!node)
                return 0;
 
@@ -786,7 +787,7 @@ radix_tree_gang_lookup(struct radix_tree_root *root, void **results,
                        slot = *(((void ***)results)[ret + i]);
                        if (!slot)
                                continue;
-                       results[ret + nr_found] = rcu_dereference(slot);
+                       results[ret + nr_found] = rcu_dereference_raw(slot);
                        nr_found++;
                }
                ret += nr_found;
@@ -825,7 +826,7 @@ radix_tree_gang_lookup_slot(struct radix_tree_root *root, void ***results,
        unsigned long cur_index = first_index;
        unsigned int ret;
 
-       node = rcu_dereference(root->rnode);
+       node = rcu_dereference_raw(root->rnode);
        if (!node)
                return 0;
 
@@ -914,7 +915,7 @@ __lookup_tag(struct radix_tree_node *slot, void ***results, unsigned long index,
                        }
                }
                shift -= RADIX_TREE_MAP_SHIFT;
-               slot = rcu_dereference(slot->slots[i]);
+               slot = rcu_dereference_raw(slot->slots[i]);
                if (slot == NULL)
                        break;
        }
@@ -950,7 +951,7 @@ radix_tree_gang_lookup_tag(struct radix_tree_root *root, void **results,
        if (!root_tag_get(root, tag))
                return 0;
 
-       node = rcu_dereference(root->rnode);
+       node = rcu_dereference_raw(root->rnode);
        if (!node)
                return 0;
 
@@ -979,7 +980,7 @@ radix_tree_gang_lookup_tag(struct radix_tree_root *root, void **results,
                        slot = *(((void ***)results)[ret + i]);
                        if (!slot)
                                continue;
-                       results[ret + nr_found] = rcu_dereference(slot);
+                       results[ret + nr_found] = rcu_dereference_raw(slot);
                        nr_found++;
                }
                ret += nr_found;
@@ -1019,7 +1020,7 @@ radix_tree_gang_lookup_tag_slot(struct radix_tree_root *root, void ***results,
        if (!root_tag_get(root, tag))
                return 0;
 
-       node = rcu_dereference(root->rnode);
+       node = rcu_dereference_raw(root->rnode);
        if (!node)
                return 0;