Index: uspace/lib/cpp/include/internal/rbtree_node.hpp
===================================================================
--- uspace/lib/cpp/include/internal/rbtree_node.hpp	(revision be9eb152c94a7442901d1280328ff0294332548f)
+++ uspace/lib/cpp/include/internal/rbtree_node.hpp	(revision 49fbfb594483ab34c974b754eb90f7df9e0ef10c)
@@ -30,4 +30,6 @@
 #define LIBCPP_INTERNAL_RBTREE_NODE
 
+#include <utility>
+
 namespace std::aux
 {
@@ -95,4 +97,12 @@
         }
 
+        bool is_right_child() const
+        {
+            if (parent)
+                return parent->right == this;
+            else
+                return false;
+        }
+
         void rotate_left()
         {
@@ -123,4 +133,18 @@
         }
 
+        rbtree_node* successor()
+        {
+            if (right)
+                return right->find_smallest();
+            else
+            {
+                auto current = this;
+                while (!current->is_left_child())
+                    current = current->parent;
+
+                return current->parent;
+            }
+        }
+
         void add_left_child(rbtree_node* node)
         {
@@ -141,4 +165,41 @@
         }
 
+        void swap(rbtree_node* other)
+        {
+            /**
+             * Parent can be null so we check both ways.
+             */
+            if (is_left_child())
+                parent->left = other;
+            else if (is_right_child())
+                parent->right = other;
+
+            if (other->is_left_child())
+                other->parent->left = this;
+            else if (other->is_right_child())
+                other->parent->right = this;
+
+            if (left)
+                left->parent = other;
+            if (right)
+                right->parent = other;
+            if (other->left)
+                other->left->parent = this;
+            if (other->right)
+                other->right->parent = this;
+
+            std::swap(parent, other->parent);
+            std::swap(left, other->left);
+            std::swap(right, other->right);
+        }
+
+        void unlink()
+        {
+            if (is_left_child())
+                parent->left = nullptr;
+            else if (is_right_child())
+                parent->right = nullptr;
+        }
+
         ~rbtree_node()
         {
