1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-24 02:04:21 +03:00

ctdb-daemon: Remove unused capabilities field from struct ctdb_node

Update the ctdb tool test stub code to cope.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2014-07-31 15:28:52 +10:00 committed by Amitay Isaacs
parent c3d6678dbc
commit eb206f5d30
2 changed files with 17 additions and 7 deletions

View File

@ -222,11 +222,6 @@ struct ctdb_node {
uint32_t rx_cnt;
uint32_t tx_cnt;
/* used to track node capabilities, is only valid/tracked inside the
recovery daemon.
*/
uint32_t capabilities;
/* a list of controls pending to this node, so we can time them out quickly
if the node becomes disconnected */
struct daemon_control_state *pending_controls;

View File

@ -20,6 +20,8 @@
/* Useful for functions that don't get struct ctdb_context passed */
static struct ctdb_context *ctdb_global;
static struct ctdb_node_capabilities *global_caps = NULL;
/* Read a nodemap from stdin. Each line looks like:
* <PNN> <FLAGS> [RECMASTER] [CURRENT] [CAPABILITIES]
* EOF or a blank line terminates input.
@ -130,7 +132,13 @@ static void ctdb_test_stubs_read_nodemap(struct ctdb_context *ctdb)
ctdb->nodes[ctdb->num_nodes]->pnn = pnn;
parse_ip(ip, NULL, 0, &ctdb->nodes[ctdb->num_nodes]->address);
ctdb->nodes[ctdb->num_nodes]->flags = flags;
ctdb->nodes[ctdb->num_nodes]->capabilities = capabilities;
global_caps = talloc_realloc(ctdb, global_caps,
struct ctdb_node_capabilities,
ctdb->num_nodes+1);
global_caps[ctdb->num_nodes].capabilities = capabilities;
global_caps[ctdb->num_nodes].retrieved = true;
ctdb->num_nodes++;
}
}
@ -725,6 +733,8 @@ int ctdb_ctrl_getcapabilities_stub(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode,
uint32_t *capabilities)
{
uint32_t *capp;
assert_nodes_set(ctdb);
if (ctdb->nodes[destnode]->flags & NODE_FLAGS_FAKE_TIMEOUT) {
@ -748,7 +758,12 @@ int ctdb_ctrl_getcapabilities_stub(struct ctdb_context *ctdb,
return -1;
}
*capabilities = ctdb->nodes[destnode]->capabilities;
capp = ctdb_get_node_capabilities(global_caps, destnode);
if (capp == NULL) {
DEBUG(DEBUG_ERR, ("__LOCATION__ invalid PNN\n"));
return -1;
}
*capabilities = *capp;
return 0;
}