Blob Blame History Raw
From 4a385f2e94c7168dbd92168c54a80ee97a3c2140 Mon Sep 17 00:00:00 2001
From: Christine Caulfield <ccaulfie@redhat.com>
Date: Tue, 13 Sep 2016 15:55:58 +0100
Subject: [PATCH] votequorum: simplify reconfigure message handling

As we now have update_node_expected_votes(), we can use that
when receiving a new EXPECTED_VOTES value from another node
rather than having our own loop.

Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
(cherry picked from commit c4683be9b0bafec7f288c0201b82c90d0c43d5ce)
---
 exec/votequorum.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/exec/votequorum.c b/exec/votequorum.c
index 405350f..f61aa81 100644
--- a/exec/votequorum.c
+++ b/exec/votequorum.c
@@ -2158,7 +2158,6 @@ static void message_handler_req_exec_votequorum_reconfigure (
 {
 	const struct req_exec_quorum_reconfigure *req_exec_quorum_reconfigure = message;
 	struct cluster_node *node;
-	struct list_head *nodelist;
 
 	ENTER();
 
@@ -2168,12 +2167,8 @@ static void message_handler_req_exec_votequorum_reconfigure (
 	switch(req_exec_quorum_reconfigure->param)
 	{
 	case VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES:
-		list_iterate(nodelist, &cluster_members_list) {
-			node = list_entry(nodelist, struct cluster_node, list);
-			if (node->state == NODESTATE_MEMBER) {
-				node->expected_votes = req_exec_quorum_reconfigure->value;
-			}
-		}
+		update_node_expected_votes(req_exec_quorum_reconfigure->value);
+
 		votequorum_exec_send_expectedvotes_notification();
 		update_ev_barrier(req_exec_quorum_reconfigure->value);
 		if (ev_tracking) {
-- 
1.7.1