Skip to contentSkip to conversation

ocfs2: use find_last_bit

PATCH New Akinobu Mita 1 participant 1 message Feb 7, 2011 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocfs2: use find_last_bit

We have find_last_bit() these days.

Cc Mark Fasheh <[email protected]>
Cc Joel Becker <[email protected]>
Cc ocfs2-devel at oss.oracle.com
---
 fs/ocfs2/cluster/heartbeat.c |   18 ++----------------
 1 files changed, 2 insertions(+), 16 deletions(-)
fs/ocfs2/cluster/heartbeat.c +2 -16
index b108e86..e54f665 100644
@@ -924,23 +924,9 @@ out:
 	return changed;
 }
 
-/* This could be faster if we just implmented a find_last_bit, but I
- * don't think the circumstances warrant it. */
-static int o2hb_highest_node(unsigned long *nodes,
-			     int numbits)
+static int o2hb_highest_node(unsigned long *nodes, int numbits)
 {
-	int highest, node;
-
-	highest = numbits;
-	node = -1;
-	while ((node = find_next_bit(nodes, numbits, node + 1)) != -1) {
-		if (node >= numbits)
-			break;
-
-		highest = node;
-	}
-
-	return highest;
+	return find_last_bit(nodes, numbits);
 }
 
 static int o2hb_do_disk_heartbeat(struct o2hb_region *reg)
Signature · 1 line
1.7.4