[Debian-ha-commits] [ocfs2-tools] 45/58: o2cb: avoid useless loop when scan global hb disks
Valentin Vidic
vvidic-guest at moszumanska.debian.org
Tue Jun 20 13:40:43 UTC 2017
This is an automated email from the git hooks/post-receive script.
vvidic-guest pushed a commit to branch upstream
in repository ocfs2-tools.
commit 11622c029b02a70e08f73e572f172c38dc05328c
Author: Junxiao Bi <junxiao.bi at oracle.com>
Date: Fri May 6 17:39:32 2016 +0800
o2cb: avoid useless loop when scan global hb disks
Done the scanning when all global hb disks are ready. This will avoid the
long latency of "o2cb start-heartbeat $cluster_name" when there are lots
of disks in the system.
Signed-off-by: Junxiao Bi <junxiao.bi at oracle.com>
Acked-by: Srinivas Eeda <srinivas.eeda at oracle.com>
---
o2cb_ctl/o2cb_scandisk.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/o2cb_ctl/o2cb_scandisk.c b/o2cb_ctl/o2cb_scandisk.c
index 4083e9f..ad6270d 100644
--- a/o2cb_ctl/o2cb_scandisk.c
+++ b/o2cb_ctl/o2cb_scandisk.c
@@ -57,7 +57,7 @@ static int fill_desc(char *device, struct o2cb_region_desc *reg,
return ret;
}
-static void get_device_uuids(struct scan_context *ctxt, struct list_head *hbdevs)
+static int get_device_uuids(struct scan_context *ctxt, struct list_head *hbdevs)
{
struct o2cb_device *od;
struct list_head *pos, *pos1;
@@ -71,7 +71,7 @@ static void get_device_uuids(struct scan_context *ctxt, struct list_head *hbdevs
}
if (!numhbdevs)
- return;
+ return 0;
list_for_each(pos, &ctxt->sc_devlist) {
hb = list_entry(pos, struct hb_devices, hb_list);
@@ -97,6 +97,8 @@ static void get_device_uuids(struct scan_context *ctxt, struct list_head *hbdevs
if (!numhbdevs)
break;
}
+
+ return numhbdevs;
}
static void free_scan_context(struct scan_context *ctxt)
@@ -198,9 +200,10 @@ void o2cb_scandisk(struct list_head *hbdevs)
dev = scan_for_dev(NULL, 5, filter_devices, ctxt);
if (!dev)
goto bail;
- } while (ctxt->sc_rescan);
- get_device_uuids(ctxt, hbdevs);
+ if (!get_device_uuids(ctxt, hbdevs))
+ break;
+ } while (ctxt->sc_rescan);
bail:
free_scan_context(ctxt);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/ocfs2-tools.git
More information about the Debian-HA-Commits
mailing list