* in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see [sun.com URL with a
- * copy of GPLv2].
+ * version 2 along with this program; If not, see
+ * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* GPL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
/*
struct interval_node **p, *parent = NULL;
ENTRY;
+ LASSERT(!interval_is_intree(node));
p = root;
while (*p) {
parent = *p;
*p = node;
interval_insert_color(node, root);
+ node->in_intree = 1;
RETURN(NULL);
}
int color;
ENTRY;
+ LASSERT(interval_is_intree(node));
+ node->in_intree = 0;
if (!node->in_left) {
child = node->in_right;
} else if (!node->in_right) {
if (child)
child->in_parent = parent;
- if (parent == old) {
+ if (parent == old)
parent->in_right = child;
- parent = node;
- } else {
+ else
parent->in_left = child;
- }
node->in_color = old->in_color;
node->in_right = old->in_right;
old->in_left->in_parent = node;
if (old->in_right)
old->in_right->in_parent = node;
- update_maxhigh(child, node->in_max_high);
+ update_maxhigh(child ? : parent, node->in_max_high);
update_maxhigh(node, old->in_max_high);
+ if (parent == old)
+ parent = node;
goto color;
}
parent = node->in_parent;
*root = child;
}
- update_maxhigh(child, node->in_max_high);
+ update_maxhigh(child ? : parent, node->in_max_high);
color:
if (color == INTERVAL_BLACK)