diff options
Diffstat (limited to 'fs/ocfs2/cluster/nodemanager.c')
-rw-r--r-- | fs/ocfs2/cluster/nodemanager.c | 10 |
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; |