Commit 518df6bd authored by Akinobu Mita's avatar Akinobu Mita Committed by Linus Torvalds

ocfs2: use find_last_bit()

We already have find_last_bit().  So just use it as described in the
comment.
Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: default avatarJoel Becker <jlbec@evilplan.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent fae477b6
...@@ -946,23 +946,9 @@ static int o2hb_check_slot(struct o2hb_region *reg, ...@@ -946,23 +946,9 @@ static int o2hb_check_slot(struct o2hb_region *reg,
return changed; return changed;
} }
/* This could be faster if we just implmented a find_last_bit, but I static int o2hb_highest_node(unsigned long *nodes, int numbits)
* don't think the circumstances warrant it. */
static int o2hb_highest_node(unsigned long *nodes,
int numbits)
{ {
int highest, node; return find_last_bit(nodes, numbits);
highest = numbits;
node = -1;
while ((node = find_next_bit(nodes, numbits, node + 1)) != -1) {
if (node >= numbits)
break;
highest = node;
}
return highest;
} }
static int o2hb_do_disk_heartbeat(struct o2hb_region *reg) static int o2hb_do_disk_heartbeat(struct o2hb_region *reg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment