*/
/* Sentinel (bottom nodes). Don't care about p, left, right and key values */
-static struct rcu_rbtree_node nil = {
+struct rcu_rbtree_node rcu_rbtree_nil = {
.color = COLOR_BLACK,
};
smp_wmb();
/* Make parents point to the copies */
- if (x->p == &nil)
+ if (x->p == &rcu_rbtree_nil)
_STORE_SHARED(*root, yc);
else if (x == x->p->left)
_STORE_SHARED(x->p->left, yc);
y = x->right;
x->right = y->left;
- if (y->left != &nil)
+ if (y->left != &rcu_rbtree_nil)
y->left->p = x;
y->p = x->p;
- if (x->p == &nil)
+ if (x->p == &rcu_rbtree_nil)
*root = y;
else if (x == x->p->left)
x->p->left = y;
smp_wmb();
/* Make parents point to the copies */
- if (x->p == &nil)
+ if (x->p == &rcu_rbtree_nil)
_STORE_SHARED(*root, yc);
else if (x == x->p->right)
_STORE_SHARED(x->p->right, yc);
y = x->left;
x->left = y->right;
- if (y->right != &nil)
+ if (y->right != &rcu_rbtree_nil)
y->right->p = x;
y->p = x->p;
- if (x->p == &nil)
+ if (x->p == &rcu_rbtree_nil)
*root = y;
else if (x == x->p->right)
x->p->right = y;
{
struct rcu_rbtree_node *x, *y;
- y = &nil;
+ y = &rcu_rbtree_nil;
x = *root;
- while (x != &nil) {
+ while (x != &rcu_rbtree_nil) {
y = x;
if (comp(z->key, x->key) < 0)
x = x->left;
}
z->p = y;
- z->left = &nil;
- z->right = &nil;
+ z->left = &rcu_rbtree_nil;
+ z->right = &rcu_rbtree_nil;
z->color = COLOR_RED;
/*
*/
smp_wmb();
- if (y == &nil)
+ if (y == &rcu_rbtree_nil)
_STORE_SHARED(*root, z);
else if (comp(z->key, y->key) < 0)
_STORE_SHARED(y->left, z);
smp_wmb();
/* Assign upper-level pointer to vc, replacing u. */
- if (u->p == &nil)
+ if (u->p == &rcu_rbtree_nil)
_STORE_SHARED(*root, vc);
else if (u == u->p->left)
_STORE_SHARED(u->p->left, vc);
/* Transplant y->right into y, external parent links */
/* Assign upper-level pointer to xc, replacing y. */
- if (y->p == &nil)
+ if (y->p == &rcu_rbtree_nil)
_STORE_SHARED(*root, xc);
else if (y == y->p->left)
_STORE_SHARED(y->p->left, xc);
}
/* Transplant y into z, update external parent links */
- if (z->p == &nil)
+ if (z->p == &rcu_rbtree_nil)
_STORE_SHARED(*root, yc);
else if (z == z->p->left)
_STORE_SHARED(z->p->left, yc);
y = z;
y_original_color = y->color;
- if (z->left == &nil) {
+ if (z->left == &rcu_rbtree_nil) {
x = rcu_rbtree_transplant(root, z, z->right, rballoc, rbfree);
- } else if (z->right == &nil) {
+ } else if (z->right == &rcu_rbtree_nil) {
x = rcu_rbtree_transplant(root, z, z->left, rballoc, rbfree);
} else {
y = rcu_rbtree_min(z->right, comp);