linux/lib/rbtree.c
*/
-#include <linux/rbtree.h>
-#include <linux/module.h>
+#include <palacios/vmm_rbtree.h>
+
static void __rb_rotate_left(struct rb_node *node, struct rb_root *root)
{
rb_set_parent(node, left);
}
-void rb_insert_color(struct rb_node *node, struct rb_root *root)
+void v3_rb_insert_color(struct rb_node *node, struct rb_root *root)
{
struct rb_node *parent, *gparent;
rb_set_black(root->rb_node);
}
-EXPORT_SYMBOL(rb_insert_color);
+
static void __rb_erase_color(struct rb_node *node, struct rb_node *parent,
struct rb_root *root)
rb_set_black(node);
}
-void rb_erase(struct rb_node *node, struct rb_root *root)
+void v3_rb_erase(struct rb_node *node, struct rb_root *root)
{
struct rb_node *child, *parent;
int color;
if (color == RB_BLACK)
__rb_erase_color(child, parent, root);
}
-EXPORT_SYMBOL(rb_erase);
+
/*
* This function returns the first node (in sort order) of the tree.
*/
-struct rb_node *rb_first(struct rb_root *root)
+struct rb_node *v3_rb_first(struct rb_root *root)
{
struct rb_node *n;
n = n->rb_left;
return n;
}
-EXPORT_SYMBOL(rb_first);
-struct rb_node *rb_last(struct rb_root *root)
+
+struct rb_node *v3_rb_last(struct rb_root *root)
{
struct rb_node *n;
n = n->rb_right;
return n;
}
-EXPORT_SYMBOL(rb_last);
-struct rb_node *rb_next(struct rb_node *node)
+
+struct rb_node *v3_rb_next(struct rb_node *node)
{
struct rb_node *parent;
return parent;
}
-EXPORT_SYMBOL(rb_next);
-struct rb_node *rb_prev(struct rb_node *node)
+
+struct rb_node *v3_rb_prev(struct rb_node *node)
{
struct rb_node *parent;
return parent;
}
-EXPORT_SYMBOL(rb_prev);
-void rb_replace_node(struct rb_node *victim, struct rb_node *new,
+
+void v3_rb_replace_node(struct rb_node *victim, struct rb_node *new,
struct rb_root *root)
{
struct rb_node *parent = rb_parent(victim);
/* Copy the pointers/colour from the victim to the replacement */
*new = *victim;
}
-EXPORT_SYMBOL(rb_replace_node);
+