Skip to content

Commit 5494b7d

Browse files
committed
Refactor: controller: Rename register_fsa_input_before to...
...controld_fsa_prepend. For clarity. Signed-off-by: Reid Wahl <[email protected]>
1 parent d643b08 commit 5494b7d

File tree

8 files changed

+19
-11
lines changed

8 files changed

+19
-11
lines changed

daemons/controld/controld_callbacks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ peer_update_callback(enum pcmk__node_update type, pcmk__node_status_t *node,
276276
alive, appeared, (down? down->id : -1));
277277

278278
if (appeared && (alive > 0) && !is_remote) {
279-
register_fsa_input_before(C_FSA_INTERNAL, I_NODE_JOIN, NULL);
279+
controld_fsa_prepend(C_FSA_INTERNAL, I_NODE_JOIN, NULL);
280280
}
281281

282282
if (down) {

daemons/controld/controld_control.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ crm_shutdown(int nsig)
696696

697697
if (pcmk__is_set(controld_globals.fsa_input_register, R_SHUTDOWN)) {
698698
crm_err("Escalating shutdown");
699-
register_fsa_input_before(C_SHUTDOWN, I_ERROR, NULL);
699+
controld_fsa_prepend(C_SHUTDOWN, I_ERROR, NULL);
700700
return;
701701
}
702702

daemons/controld/controld_fsa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ check_join_counts(fsa_data_t *msg_data)
529529
} else if (controld_globals.membership_id != controld_globals.peer_seq) {
530530
crm_info("New join needed because membership changed (%llu -> %llu)",
531531
controld_globals.membership_id, controld_globals.peer_seq);
532-
register_fsa_input_before(C_FSA_INTERNAL, I_NODE_JOIN, NULL);
532+
controld_fsa_prepend(C_FSA_INTERNAL, I_NODE_JOIN, NULL);
533533

534534
} else {
535535
crm_warn("Only %d of %u active cluster nodes fully joined "

daemons/controld/controld_join_dc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ check_join_state(enum crmd_fsa_state cur_state, const char *source)
10071007
if (highest_seq < controld_globals.peer_seq) {
10081008
/* Don't spam the FSA with duplicates */
10091009
highest_seq = controld_globals.peer_seq;
1010-
register_fsa_input_before(C_FSA_INTERNAL, I_NODE_JOIN, NULL);
1010+
controld_fsa_prepend(C_FSA_INTERNAL, I_NODE_JOIN, NULL);
10111011
}
10121012

10131013
} else if (cur_state == S_INTEGRATION) {
@@ -1018,7 +1018,7 @@ check_join_state(enum crmd_fsa_state cur_state, const char *source)
10181018
QB_XS " state=%s for=%s",
10191019
current_join_id, count, pcmk__plural_s(count),
10201020
fsa_state2string(cur_state), source);
1021-
register_fsa_input_before(C_FSA_INTERNAL, I_INTEGRATED, NULL);
1021+
controld_fsa_prepend(C_FSA_INTERNAL, I_INTEGRATED, NULL);
10221022
return TRUE;
10231023
}
10241024

daemons/controld/controld_messages.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ route_message(enum crmd_fsa_cause cause, xmlNode * input)
225225
*
226226
* @FIXME controld_fsa_append() adds the input to the tail of the
227227
* queue. To add to the front (the head), we would call
228-
* register_fsa_input_before(). Which one is correct?
228+
* controld_fsa_prepend(). Which one is correct?
229229
* - The "Add to the front" comment and the below
230230
* controld_fsa_append() call (formerly register_fsa_input()) go
231231
* back to a1606db9 in 2006.

daemons/controld/controld_messages.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,16 @@ extern void route_message(enum crmd_fsa_cause cause, xmlNode * input);
5656
#define controld_fsa_append(cause, input, data) \
5757
register_fsa_input_adv(cause, input, data, A_NOTHING, false, __func__)
5858

59-
#define register_fsa_input_before(cause, input, data) \
60-
register_fsa_input_adv(cause, input, data, A_NOTHING, TRUE, __func__)
59+
/*!
60+
* \internal
61+
* \brief Prepend an input to the FSA message queue without actions
62+
*
63+
* \param[in] cause Cause of input creation (<tt>enum crmd_fsa_cause</tt>)
64+
* \param[in] input Input type (<tt>enum crmd_fsa_input</tt>)
65+
* \param[in] data Message data (\c ha_msg_input_t)
66+
*/
67+
#define controld_fsa_prepend(cause, input, data) \
68+
register_fsa_input_adv(cause, input, data, A_NOTHING, true, __func__)
6169

6270
void delete_fsa_input(fsa_data_t * fsa_data);
6371

daemons/controld/controld_schedulerd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ do_pe_invoke(long long action,
341341
if (!pcmk__is_set(controld_globals.fsa_input_register, R_PE_CONNECTED)) {
342342
if (pcmk__is_set(controld_globals.fsa_input_register, R_SHUTDOWN)) {
343343
crm_err("Cannot shut down gracefully without the scheduler");
344-
register_fsa_input_before(C_FSA_INTERNAL, I_TERMINATE, NULL);
344+
controld_fsa_prepend(C_FSA_INTERNAL, I_TERMINATE, NULL);
345345

346346
} else {
347347
crm_info("Waiting for the scheduler to connect");
@@ -361,7 +361,7 @@ do_pe_invoke(long long action,
361361
crm_err("Attempted to invoke scheduler without consistent Cluster Information Base!");
362362

363363
/* start the join from scratch */
364-
register_fsa_input_before(C_FSA_INTERNAL, I_ELECTION, NULL);
364+
controld_fsa_prepend(C_FSA_INTERNAL, I_ELECTION, NULL);
365365
return;
366366
}
367367
if (controld_cib_retry_timer != NULL) {

daemons/controld/controld_timers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ crm_timer_popped(gpointer data)
202202
register_fsa_error_adv(I_ELECTION, NULL, NULL, __func__);
203203

204204
} else {
205-
register_fsa_input_before(C_TIMER_POPPED, timer->fsa_input, NULL);
205+
controld_fsa_prepend(C_TIMER_POPPED, timer->fsa_input, NULL);
206206
}
207207

208208
} else if ((timer == recheck_timer)

0 commit comments

Comments
 (0)