Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −16
Original line number Original line Diff line number Diff line
@@ -946,23 +946,9 @@ out:
	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)