diff options
Diffstat (limited to 'source4/cluster')
-rw-r--r-- | source4/cluster/cluster.c | 4 | ||||
-rw-r--r-- | source4/cluster/cluster.h | 2 | ||||
-rw-r--r-- | source4/cluster/cluster_private.h | 3 | ||||
-rw-r--r-- | source4/cluster/ctdb/common/ctdb.c | 9 | ||||
-rw-r--r-- | source4/cluster/ctdb/common/ctdb_message.c | 2 | ||||
-rw-r--r-- | source4/cluster/ctdb/ctdb_cluster.c | 5 | ||||
-rw-r--r-- | source4/cluster/ctdb/include/ctdb.h | 7 | ||||
-rw-r--r-- | source4/cluster/local.c | 3 |
8 files changed, 23 insertions, 12 deletions
diff --git a/source4/cluster/cluster.c b/source4/cluster/cluster.c index 4be52b8233..dab39c1fea 100644 --- a/source4/cluster/cluster.c +++ b/source4/cluster/cluster.c @@ -89,8 +89,8 @@ NTSTATUS cluster_message_init(struct messaging_context *msg, struct server_id se /* send a message to another node in the cluster */ -NTSTATUS cluster_message_send(struct server_id server, uint32_t msg_type, DATA_BLOB *data) +NTSTATUS cluster_message_send(struct server_id server, DATA_BLOB *data) { cluster_init(); - return ops->message_send(ops, server, msg_type, data); + return ops->message_send(ops, server, data); } diff --git a/source4/cluster/cluster.h b/source4/cluster/cluster.h index d182bf5526..29a5d4d092 100644 --- a/source4/cluster/cluster.h +++ b/source4/cluster/cluster.h @@ -44,6 +44,6 @@ void *cluster_backend_handle(void); NTSTATUS cluster_message_init(struct messaging_context *msg, struct server_id server, cluster_message_fn_t handler); -NTSTATUS cluster_message_send(struct server_id server, uint32_t msg_type, DATA_BLOB *data); +NTSTATUS cluster_message_send(struct server_id server, DATA_BLOB *data); #endif diff --git a/source4/cluster/cluster_private.h b/source4/cluster/cluster_private.h index 2dc749d890..df8848fe73 100644 --- a/source4/cluster/cluster_private.h +++ b/source4/cluster/cluster_private.h @@ -34,8 +34,7 @@ struct cluster_ops { struct messaging_context *msg, struct server_id server, cluster_message_fn_t handler); NTSTATUS (*message_send)(struct cluster_ops *ops, - struct server_id server, uint32_t msg_type, - DATA_BLOB *data); + struct server_id server, DATA_BLOB *data); void *private; /* backend state */ }; diff --git a/source4/cluster/ctdb/common/ctdb.c b/source4/cluster/ctdb/common/ctdb.c index 9e92059b95..59a14d4dbd 100644 --- a/source4/cluster/ctdb/common/ctdb.c +++ b/source4/cluster/ctdb/common/ctdb.c @@ -162,6 +162,15 @@ uint32_t ctdb_get_vnn(struct ctdb_context *ctdb) } /* + return the number of nodes +*/ +uint32_t ctdb_get_num_nodes(struct ctdb_context *ctdb) +{ + return ctdb->num_nodes; +} + + +/* start the protocol going */ int ctdb_start(struct ctdb_context *ctdb) diff --git a/source4/cluster/ctdb/common/ctdb_message.c b/source4/cluster/ctdb/common/ctdb_message.c index abdf9e6216..ca909f8994 100644 --- a/source4/cluster/ctdb/common/ctdb_message.c +++ b/source4/cluster/ctdb/common/ctdb_message.c @@ -54,7 +54,7 @@ void ctdb_request_message(struct ctdb_context *ctdb, struct ctdb_req_header *hdr send a ctdb message */ int ctdb_send_message(struct ctdb_context *ctdb, uint32_t vnn, - uint32_t srvid, uint32_t msg_type, TDB_DATA data) + uint32_t srvid, TDB_DATA data) { struct ctdb_req_message *r; int len; diff --git a/source4/cluster/ctdb/ctdb_cluster.c b/source4/cluster/ctdb/ctdb_cluster.c index 95adbafadf..917a56d2b8 100644 --- a/source4/cluster/ctdb/ctdb_cluster.c +++ b/source4/cluster/ctdb/ctdb_cluster.c @@ -159,8 +159,7 @@ static NTSTATUS ctdb_message_init(struct cluster_ops *ops, send a ctdb message to another node */ static NTSTATUS ctdb_message_send(struct cluster_ops *ops, - struct server_id server, uint32_t msg_type, - DATA_BLOB *data) + struct server_id server, DATA_BLOB *data) { struct cluster_state *state = ops->private; struct ctdb_context *ctdb = state->ctdb; @@ -170,7 +169,7 @@ static NTSTATUS ctdb_message_send(struct cluster_ops *ops, tdata.dptr = data->data; tdata.dsize = data->length; - ret = ctdb_send_message(ctdb, server.node, server.id, msg_type, tdata); + ret = ctdb_send_message(ctdb, server.node, server.id, tdata); if (ret != 0) { return NT_STATUS_INTERNAL_DB_CORRUPTION; } diff --git a/source4/cluster/ctdb/include/ctdb.h b/source4/cluster/ctdb/include/ctdb.h index 335af83215..efb12c5daa 100644 --- a/source4/cluster/ctdb/include/ctdb.h +++ b/source4/cluster/ctdb/include/ctdb.h @@ -127,6 +127,11 @@ void ctdb_wait_loop(struct ctdb_context *ctdb); /* return vnn of this node */ uint32_t ctdb_get_vnn(struct ctdb_context *ctdb); +/* + return the number of nodes +*/ +uint32_t ctdb_get_num_nodes(struct ctdb_context *ctdb); + /* setup a handler for ctdb messages */ typedef void (*ctdb_message_fn_t)(struct ctdb_context *, uint32_t srvid, TDB_DATA data, void *); @@ -135,6 +140,6 @@ int ctdb_set_message_handler(struct ctdb_context *ctdb, ctdb_message_fn_t handle /* send a ctdb message */ int ctdb_send_message(struct ctdb_context *ctdb, uint32_t vnn, - uint32_t srvid, uint32_t msg_type, TDB_DATA data); + uint32_t srvid, TDB_DATA data); #endif diff --git a/source4/cluster/local.c b/source4/cluster/local.c index 338bac500a..5d0df475d7 100644 --- a/source4/cluster/local.c +++ b/source4/cluster/local.c @@ -88,8 +88,7 @@ static NTSTATUS local_message_init(struct cluster_ops *ops, dummy message send */ static NTSTATUS local_message_send(struct cluster_ops *ops, - struct server_id server, uint32_t msg_type, - DATA_BLOB *data) + struct server_id server, DATA_BLOB *data) { return NT_STATUS_INVALID_DEVICE_REQUEST; } |