308170
From 6df10102c02f93890c1994136b3ce6a60b33a05e Mon Sep 17 00:00:00 2001
308170
From: Ken Gaillot <kgaillot@redhat.com>
308170
Date: Mon, 6 Jan 2020 11:01:38 -0600
308170
Subject: [PATCH] Refactor: controller: remove unused function arguments
308170
308170
... and rename affected functions
308170
---
308170
 daemons/controld/controld_execd.c       |  2 +-
308170
 daemons/controld/controld_fsa.c         |  1 -
308170
 daemons/controld/controld_fsa.h         |  4 ++--
308170
 daemons/controld/controld_join_client.c |  4 ++--
308170
 daemons/controld/controld_join_dc.c     | 32 ++++++++++++++------------------
308170
 5 files changed, 19 insertions(+), 24 deletions(-)
308170
308170
diff --git a/daemons/controld/controld_execd.c b/daemons/controld/controld_execd.c
308170
index f068413..16751b9 100644
308170
--- a/daemons/controld/controld_execd.c
308170
+++ b/daemons/controld/controld_execd.c
308170
@@ -839,7 +839,7 @@ do_lrm_query_internal(lrm_state_t *lrm_state, int update_flags)
308170
 }
308170
 
308170
 xmlNode *
308170
-do_lrm_query(gboolean is_replace, const char *node_name)
308170
+controld_query_executor_state(const char *node_name)
308170
 {
308170
     lrm_state_t *lrm_state = lrm_state_find(node_name);
308170
 
308170
diff --git a/daemons/controld/controld_fsa.c b/daemons/controld/controld_fsa.c
308170
index bd732bc..db2b3f3 100644
308170
--- a/daemons/controld/controld_fsa.c
308170
+++ b/daemons/controld/controld_fsa.c
308170
@@ -41,7 +41,6 @@ enum crmd_fsa_state fsa_state = S_STARTING;
308170
 
308170
 extern uint highest_born_on;
308170
 extern uint num_join_invites;
308170
-extern void initialize_join(gboolean before);
308170
 
308170
 #define DOT_PREFIX "actions:trace: "
308170
 #define do_dot_log(fmt, args...)     crm_trace( fmt, ##args)
308170
diff --git a/daemons/controld/controld_fsa.h b/daemons/controld/controld_fsa.h
308170
index 06794cb..8aaaadf 100644
308170
--- a/daemons/controld/controld_fsa.h
308170
+++ b/daemons/controld/controld_fsa.h
308170
@@ -1,5 +1,5 @@
308170
 /*
308170
- * Copyright 2004-2019 the Pacemaker project contributors
308170
+ * Copyright 2004-2020 the Pacemaker project contributors
308170
  *
308170
  * The version control history for this file may have further details.
308170
  *
308170
@@ -484,7 +484,7 @@ extern gboolean ever_had_quorum;
308170
 // These should be moved elsewhere
308170
 void do_update_cib_nodes(gboolean overwrite, const char *caller);
308170
 int crmd_cib_smart_opt(void);
308170
-xmlNode *do_lrm_query(gboolean, const char *node_name);
308170
+xmlNode *controld_query_executor_state(const char *node_name);
308170
 
308170
 const char *fsa_input2string(enum crmd_fsa_input input);
308170
 const char *fsa_state2string(enum crmd_fsa_state state);
308170
diff --git a/daemons/controld/controld_join_client.c b/daemons/controld/controld_join_client.c
308170
index 4ac0d2a..383ee29 100644
308170
--- a/daemons/controld/controld_join_client.c
308170
+++ b/daemons/controld/controld_join_client.c
308170
@@ -1,5 +1,5 @@
308170
 /*
308170
- * Copyright 2004-2019 the Pacemaker project contributors
308170
+ * Copyright 2004-2020 the Pacemaker project contributors
308170
  *
308170
  * The version control history for this file may have further details.
308170
  *
308170
@@ -264,7 +264,7 @@ do_cl_join_finalize_respond(long long action,
308170
     update_dc_expected(input->msg);
308170
 
308170
     /* send our status section to the DC */
308170
-    tmp1 = do_lrm_query(TRUE, fsa_our_uname);
308170
+    tmp1 = controld_query_executor_state(fsa_our_uname);
308170
     if (tmp1 != NULL) {
308170
         xmlNode *reply = create_request(CRM_OP_JOIN_CONFIRM, tmp1, fsa_our_dc,
308170
                                         CRM_SYSTEM_DC, CRM_SYSTEM_CRMD, NULL);
308170
diff --git a/daemons/controld/controld_join_dc.c b/daemons/controld/controld_join_dc.c
308170
index ac6b430..885b2a9 100644
308170
--- a/daemons/controld/controld_join_dc.c
308170
+++ b/daemons/controld/controld_join_dc.c
308170
@@ -1,5 +1,5 @@
308170
 /*
308170
- * Copyright 2004-2019 the Pacemaker project contributors
308170
+ * Copyright 2004-2020 the Pacemaker project contributors
308170
  *
308170
  * The version control history for this file may have further details.
308170
  *
308170
@@ -21,7 +21,6 @@ char *max_epoch = NULL;
308170
 char *max_generation_from = NULL;
308170
 xmlNode *max_generation_xml = NULL;
308170
 
308170
-void initialize_join(gboolean before);
308170
 void finalize_join_for(gpointer key, gpointer value, gpointer user_data);
308170
 void finalize_sync_callback(xmlNode * msg, int call_id, int rc, xmlNode * output, void *user_data);
308170
 gboolean check_join_state(enum crmd_fsa_state cur_state, const char *source);
308170
@@ -68,8 +67,8 @@ crm_update_peer_join(const char *source, crm_node_t * node, enum crm_join_phase
308170
     }
308170
 }
308170
 
308170
-void
308170
-initialize_join(gboolean before)
308170
+static void
308170
+start_join_round()
308170
 {
308170
     GHashTableIter iter;
308170
     crm_node_t *peer = NULL;
308170
@@ -80,19 +79,16 @@ initialize_join(gboolean before)
308170
     while (g_hash_table_iter_next(&iter, NULL, (gpointer *) &peer)) {
308170
         crm_update_peer_join(__FUNCTION__, peer, crm_join_none);
308170
     }
308170
-
308170
-    if (before) {
308170
-        if (max_generation_from != NULL) {
308170
-            free(max_generation_from);
308170
-            max_generation_from = NULL;
308170
-        }
308170
-        if (max_generation_xml != NULL) {
308170
-            free_xml(max_generation_xml);
308170
-            max_generation_xml = NULL;
308170
-        }
308170
-        clear_bit(fsa_input_register, R_HAVE_CIB);
308170
-        clear_bit(fsa_input_register, R_CIB_ASKED);
308170
+    if (max_generation_from != NULL) {
308170
+        free(max_generation_from);
308170
+        max_generation_from = NULL;
308170
+    }
308170
+    if (max_generation_xml != NULL) {
308170
+        free_xml(max_generation_xml);
308170
+        max_generation_xml = NULL;
308170
     }
308170
+    clear_bit(fsa_input_register, R_HAVE_CIB);
308170
+    clear_bit(fsa_input_register, R_CIB_ASKED);
308170
 }
308170
 
308170
 /*!
308170
@@ -192,7 +188,7 @@ do_dc_join_offer_all(long long action,
308170
      * will be seen as offline by the scheduler anyway.
308170
      */
308170
     current_join_id++;
308170
-    initialize_join(TRUE);
308170
+    start_join_round();
308170
 /* 	do_update_cib_nodes(TRUE, __FUNCTION__); */
308170
 
308170
     update_dc(NULL);
308170
@@ -590,7 +586,7 @@ do_dc_join_ack(long long action,
308170
     controld_delete_node_state(join_from, controld_section_lrm,
308170
                                cib_scope_local);
308170
     if (safe_str_eq(join_from, fsa_our_uname)) {
308170
-        xmlNode *now_dc_lrmd_state = do_lrm_query(TRUE, fsa_our_uname);
308170
+        xmlNode *now_dc_lrmd_state = controld_query_executor_state(fsa_our_uname);
308170
 
308170
         if (now_dc_lrmd_state != NULL) {
308170
             fsa_cib_update(XML_CIB_TAG_STATUS, now_dc_lrmd_state,
308170
-- 
308170
1.8.3.1
308170