return nodes;
}
-/* Get list of nodes not including those with flags specified by mask.
- * If exclude_pnn is not -1 then exclude that pnn from the list.
- */
+/* Get list of nodes not including those with flags specified by mask */
static uint32_t *list_of_nodes(struct ctdb_context *ctdb,
struct ctdb_node_map_old *node_map,
TALLOC_CTX *mem_ctx,
uint32_t mask,
- int exclude_pnn)
+ bool include_self)
{
int i, j, num_nodes;
+ uint32_t exclude_pnn;
uint32_t *nodes;
+ exclude_pnn = include_self ? CTDB_UNKNOWN_PNN : ctdb->pnn;
+
for (i=num_nodes=0;i<node_map->num;i++) {
if (node_map->nodes[i].flags & mask) {
continue;
TALLOC_CTX *mem_ctx,
bool include_self)
{
- return list_of_nodes(ctdb, node_map, mem_ctx, NODE_FLAGS_INACTIVE,
- include_self ? -1 : ctdb->pnn);
+ return list_of_nodes(ctdb,
+ node_map,
+ mem_ctx,
+ NODE_FLAGS_INACTIVE,
+ include_self);
}
uint32_t *list_of_connected_nodes(struct ctdb_context *ctdb,
TALLOC_CTX *mem_ctx,
bool include_self)
{
- return list_of_nodes(ctdb, node_map, mem_ctx, NODE_FLAGS_DISCONNECTED,
- include_self ? -1 : ctdb->pnn);
+ return list_of_nodes(ctdb,
+ node_map,
+ mem_ctx,
+ NODE_FLAGS_DISCONNECTED,
+ include_self);
}
/*