aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/cluster
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2006-10-12 01:29:33 -0400
committerMark Fasheh <mark.fasheh@oracle.com>2006-10-20 18:26:06 -0400
commit79cd22d3ac921b9209bf813c7e75e6b69e74896c (patch)
tree5db5b2f1cb8620f6ad4a23e56b3743a669696fa2 /fs/ocfs2/cluster
parentf1877fb2967ec8c0c6e946cc24c253bb52ce4d06 (diff)
ocfs2: delete redundant memcmp()
This patch deletes redundant memcmp() while looking up in rb tree. Signed-off-by: Akinbou Mita <akinobu.mita@gmail.com> Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/cluster')
-rw-r--r--fs/ocfs2/cluster/nodemanager.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/ocfs2/cluster/nodemanager.c b/fs/ocfs2/cluster/nodemanager.c
index e1fceb8aa32d..d11753c50bc1 100644
--- 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,
152 struct o2nm_node *node, *ret = NULL; 152 struct o2nm_node *node, *ret = NULL;
153 153
154 while (*p) { 154 while (*p) {
155 int cmp;
156
155 parent = *p; 157 parent = *p;
156 node = rb_entry(parent, struct o2nm_node, nd_ip_node); 158 node = rb_entry(parent, struct o2nm_node, nd_ip_node);
157 159
158 if (memcmp(&ip_needle, &node->nd_ipv4_address, 160 cmp = memcmp(&ip_needle, &node->nd_ipv4_address,
159 sizeof(ip_needle)) < 0) 161 sizeof(ip_needle));
162 if (cmp < 0)
160 p = &(*p)->rb_left; 163 p = &(*p)->rb_left;
161 else if (memcmp(&ip_needle, &node->nd_ipv4_address, 164 else if (cmp > 0)
162 sizeof(ip_needle)) > 0)
163 p = &(*p)->rb_right; 165 p = &(*p)->rb_right;
164 else { 166 else {
165 ret = node; 167 ret = node;