Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-3321 osc: add weight function for DLM lock
[fs/lustre-release.git]
/
lustre
/
ldlm
/
interval_tree.c
diff --git
a/lustre/ldlm/interval_tree.c
b/lustre/ldlm/interval_tree.c
index
68480bb
..
1318562
100644
(file)
--- a/
lustre/ldlm/interval_tree.c
+++ b/
lustre/ldlm/interval_tree.c
@@
-1,6
+1,4
@@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@
-26,7
+24,7
@@
* GPL HEADER END
*/
/*
* 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.
*/
/*
* Use is subject to license terms.
*/
/*
@@
-389,6
+387,7
@@
struct interval_node *interval_insert(struct interval_node *node,
struct interval_node **p, *parent = NULL;
ENTRY;
struct interval_node **p, *parent = NULL;
ENTRY;
+ LASSERT(!interval_is_intree(node));
p = root;
while (*p) {
parent = *p;
p = root;
while (*p) {
parent = *p;
@@
-412,6
+411,7
@@
struct interval_node *interval_insert(struct interval_node *node,
*p = node;
interval_insert_color(node, root);
*p = node;
interval_insert_color(node, root);
+ node->in_intree = 1;
RETURN(NULL);
}
RETURN(NULL);
}
@@
-527,6
+527,8
@@
void interval_erase(struct interval_node *node,
int color;
ENTRY;
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 (!node->in_left) {
child = node->in_right;
} else if (!node->in_right) {
@@
-541,12
+543,10
@@
void interval_erase(struct interval_node *node,
if (child)
child->in_parent = parent;
if (child)
child->in_parent = parent;
- if (parent == old)
{
+ if (parent == old)
parent->in_right = child;
parent->in_right = child;
- parent = node;
- } else {
+ else
parent->in_left = child;
parent->in_left = child;
- }
node->in_color = old->in_color;
node->in_right = old->in_right;
node->in_color = old->in_color;
node->in_right = old->in_right;
@@
-565,8
+565,10
@@
void interval_erase(struct interval_node *node,
old->in_left->in_parent = node;
if (old->in_right)
old->in_right->in_parent = node;
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);
update_maxhigh(node, old->in_max_high);
+ if (parent == old)
+ parent = node;
goto color;
}
parent = node->in_parent;
goto color;
}
parent = node->in_parent;
@@
-583,7
+585,7
@@
void interval_erase(struct interval_node *node,
*root = child;
}
*root = child;
}
- update_maxhigh(child, node->in_max_high);
+ update_maxhigh(child
? : parent
, node->in_max_high);
color:
if (color == INTERVAL_BLACK)
color:
if (color == INTERVAL_BLACK)