* [Ocfs2-devel] [PATCH] ocfs2: use find_last_bit
@ 2011-02-07 14:50 Akinobu Mita
0 siblings, 0 replies; 2+ messages in thread
From: Akinobu Mita @ 2011-02-07 14:50 UTC (permalink / raw)
To: ocfs2-devel
We have find_last_bit() these days.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: ocfs2-devel at oss.oracle.com
---
fs/ocfs2/cluster/heartbeat.c | 18 ++----------------
1 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index b108e86..e54f665 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -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)
--
1.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Ocfs2-devel] [PATCH] ocfs2: use find_last_bit
[not found] <1327072528-8479-1-git-send-email-akinobu.mita@gmail.com>
@ 2012-01-20 15:15 ` Akinobu Mita
0 siblings, 0 replies; 2+ messages in thread
From: Akinobu Mita @ 2012-01-20 15:15 UTC (permalink / raw)
To: linux-kernel, akpm; +Cc: Akinobu Mita, Mark Fasheh, Joel Becker, ocfs2-devel
We already have find_last_bit. So just use it as described in the comment.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: ocfs2-devel at oss.oracle.com
---
fs/ocfs2/cluster/heartbeat.c | 18 ++----------------
1 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index cd36cb5..120fad9 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -956,23 +956,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)
--
1.7.4.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-01-20 15:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-07 14:50 [Ocfs2-devel] [PATCH] ocfs2: use find_last_bit Akinobu Mita
[not found] <1327072528-8479-1-git-send-email-akinobu.mita@gmail.com>
2012-01-20 15:15 ` Akinobu Mita
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).