|
@@ -102,25 +102,25 @@ qnetd_algo_ffsplit_client_init(struct qnetd_client *client)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
static int
|
|
|
-qnetd_algo_ffsplit_is_prefered_partition(const struct qnetd_client *client,
|
|
|
|
|
|
|
+qnetd_algo_ffsplit_is_preferred_partition(const struct qnetd_client *client,
|
|
|
const struct node_list *config_node_list, const struct node_list *membership_node_list)
|
|
const struct node_list *config_node_list, const struct node_list *membership_node_list)
|
|
|
{
|
|
{
|
|
|
- uint32_t prefered_node_id;
|
|
|
|
|
|
|
+ uint32_t preferred_node_id;
|
|
|
struct node_list_entry *node_entry;
|
|
struct node_list_entry *node_entry;
|
|
|
int case_processed;
|
|
int case_processed;
|
|
|
|
|
|
|
|
- prefered_node_id = 0;
|
|
|
|
|
|
|
+ preferred_node_id = 0;
|
|
|
case_processed = 0;
|
|
case_processed = 0;
|
|
|
|
|
|
|
|
switch (client->tie_breaker.mode) {
|
|
switch (client->tie_breaker.mode) {
|
|
|
case TLV_TIE_BREAKER_MODE_LOWEST:
|
|
case TLV_TIE_BREAKER_MODE_LOWEST:
|
|
|
node_entry = TAILQ_FIRST(config_node_list);
|
|
node_entry = TAILQ_FIRST(config_node_list);
|
|
|
|
|
|
|
|
- prefered_node_id = node_entry->node_id;
|
|
|
|
|
|
|
+ preferred_node_id = node_entry->node_id;
|
|
|
|
|
|
|
|
TAILQ_FOREACH(node_entry, config_node_list, entries) {
|
|
TAILQ_FOREACH(node_entry, config_node_list, entries) {
|
|
|
- if (node_entry->node_id < prefered_node_id) {
|
|
|
|
|
- prefered_node_id = node_entry->node_id;
|
|
|
|
|
|
|
+ if (node_entry->node_id < preferred_node_id) {
|
|
|
|
|
+ preferred_node_id = node_entry->node_id;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
case_processed = 1;
|
|
case_processed = 1;
|
|
@@ -128,28 +128,28 @@ qnetd_algo_ffsplit_is_prefered_partition(const struct qnetd_client *client,
|
|
|
case TLV_TIE_BREAKER_MODE_HIGHEST:
|
|
case TLV_TIE_BREAKER_MODE_HIGHEST:
|
|
|
node_entry = TAILQ_FIRST(config_node_list);
|
|
node_entry = TAILQ_FIRST(config_node_list);
|
|
|
|
|
|
|
|
- prefered_node_id = node_entry->node_id;
|
|
|
|
|
|
|
+ preferred_node_id = node_entry->node_id;
|
|
|
|
|
|
|
|
TAILQ_FOREACH(node_entry, config_node_list, entries) {
|
|
TAILQ_FOREACH(node_entry, config_node_list, entries) {
|
|
|
- if (node_entry->node_id > prefered_node_id) {
|
|
|
|
|
- prefered_node_id = node_entry->node_id;
|
|
|
|
|
|
|
+ if (node_entry->node_id > preferred_node_id) {
|
|
|
|
|
+ preferred_node_id = node_entry->node_id;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
case_processed = 1;
|
|
case_processed = 1;
|
|
|
break;
|
|
break;
|
|
|
case TLV_TIE_BREAKER_MODE_NODE_ID:
|
|
case TLV_TIE_BREAKER_MODE_NODE_ID:
|
|
|
- prefered_node_id = client->tie_breaker.node_id;
|
|
|
|
|
|
|
+ preferred_node_id = client->tie_breaker.node_id;
|
|
|
case_processed = 1;
|
|
case_processed = 1;
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!case_processed) {
|
|
if (!case_processed) {
|
|
|
- qnetd_log(LOG_CRIT, "qnetd_algo_ffsplit_is_prefered_partition unprocessed "
|
|
|
|
|
|
|
+ qnetd_log(LOG_CRIT, "qnetd_algo_ffsplit_is_preferred_partition unprocessed "
|
|
|
"tie_breaker.mode");
|
|
"tie_breaker.mode");
|
|
|
exit(1);
|
|
exit(1);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return (node_list_find_node_id(membership_node_list, prefered_node_id) != NULL);
|
|
|
|
|
|
|
+ return (node_list_find_node_id(membership_node_list, preferred_node_id) != NULL);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
static int
|
|
@@ -410,7 +410,7 @@ qnetd_algo_ffsplit_partition_cmp(const struct qnetd_client *client1,
|
|
|
* Number of active clients in both partitions equals. Use tie-breaker.
|
|
* Number of active clients in both partitions equals. Use tie-breaker.
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
- if (qnetd_algo_ffsplit_is_prefered_partition(client1, config_node_list1,
|
|
|
|
|
|
|
+ if (qnetd_algo_ffsplit_is_preferred_partition(client1, config_node_list1,
|
|
|
membership_node_list1)) {
|
|
membership_node_list1)) {
|
|
|
res = 1; goto exit_res;
|
|
res = 1; goto exit_res;
|
|
|
} else {
|
|
} else {
|