projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f1877fb
)
ocfs2: delete redundant memcmp()
author
Akinobu Mita
<
[email protected]
>
Thu, 12 Oct 2006 05:29:33 +0000
(14:29 +0900)
committer
Mark Fasheh
<
[email protected]
>
Fri, 20 Oct 2006 22:26:06 +0000
(15:26 -0700)
This patch deletes redundant memcmp() while looking up in rb tree.
Signed-off-by: Akinbou Mita <
[email protected]
>
Signed-off-by: Mark Fasheh <
[email protected]
>
fs/ocfs2/cluster/nodemanager.c
patch
|
blob
|
history
diff --git
a/fs/ocfs2/cluster/nodemanager.c
b/fs/ocfs2/cluster/nodemanager.c
index e1fceb8aa32d612973de79f9967f1b74f9bd0964..d11753c50bc1452822befe923c149f8e79202c0c 100644
(file)
--- a/
fs/ocfs2/cluster/nodemanager.c
+++ b/
fs/ocfs2/cluster/nodemanager.c
@@
-152,14
+152,16
@@
static struct o2nm_node *o2nm_node_ip_tree_lookup(struct o2nm_cluster *cluster,
struct o2nm_node *node, *ret = NULL;
while (*p) {
+ int cmp;
+
parent = *p;
node = rb_entry(parent, struct o2nm_node, nd_ip_node);
- if (memcmp(&ip_needle, &node->nd_ipv4_address,
- sizeof(ip_needle)) < 0)
+ cmp = memcmp(&ip_needle, &node->nd_ipv4_address,
+ sizeof(ip_needle));
+ if (cmp < 0)
p = &(*p)->rb_left;
- else if (memcmp(&ip_needle, &node->nd_ipv4_address,
- sizeof(ip_needle)) > 0)
+ else if (cmp > 0)
p = &(*p)->rb_right;
else {
ret = node;