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

Function compare_capacity

pengine/utils.c:166–179  ·  view source on GitHub ↗

rc < 0 if 'node1' has more capacity remaining * rc > 0 if 'node1' has less capacity remaining */

Source from the content-addressed store, hash-verified

164 * rc > 0 if 'node1' has less capacity remaining
165 */
166static int
167compare_capacity(const node_t * node1, const node_t * node2)
168{
169 struct compare_data data;
170
171 data.node1 = node1;
172 data.node2 = node2;
173 data.result = 0;
174
175 g_hash_table_foreach(node1->details->utilization, do_compare_capacity1, &data);
176 g_hash_table_foreach(node2->details->utilization, do_compare_capacity2, &data);
177
178 return data.result;
179}
180
181/* return -1 if 'a' is more preferred
182 * return 1 if 'b' is more preferred

Callers 1

sort_node_weightFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected