MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / resource_node_score

Function resource_node_score

lib/pengine/utils.c:1102–1125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1100}
1101
1102static void
1103resource_node_score(resource_t * rsc, node_t * node, int score, const char *tag)
1104{
1105 node_t *match = NULL;
1106
1107 if (rsc->children) {
1108 GListPtr gIter = rsc->children;
1109
1110 for (; gIter != NULL; gIter = gIter->next) {
1111 resource_t *child_rsc = (resource_t *) gIter->data;
1112
1113 resource_node_score(child_rsc, node, score, tag);
1114 }
1115 }
1116
1117 pe_rsc_trace(rsc, "Setting %s for %s on %s: %d", tag, rsc->id, node->details->uname, score);
1118 match = pe_hash_table_lookup(rsc->allowed_nodes, node->details->id);
1119 if (match == NULL) {
1120 match = node_copy(node);
1121 match->weight = merge_weights(score, node->weight);
1122 g_hash_table_insert(rsc->allowed_nodes, (gpointer) match->details->id, match);
1123 }
1124 match->weight = merge_weights(match->weight, score);
1125}
1126
1127void
1128resource_location(resource_t * rsc, node_t * node, int score, const char *tag,

Callers 1

resource_locationFunction · 0.85

Calls 3

pe_hash_table_lookupFunction · 0.85
node_copyFunction · 0.85
merge_weightsFunction · 0.85

Tested by

no test coverage detected