1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

ctdb: Rename CTDB_VERSION to CTDB_PROTOCOL

CTDB_VERSION really is the ctdb protocol version.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Amitay Isaacs 2014-10-21 11:53:29 +11:00 committed by Amitay Isaacs
parent 69c0c43d55
commit a54db687ac
8 changed files with 19 additions and 21 deletions

View File

@ -54,7 +54,7 @@ struct ctdb_req_header *_ctdbd_allocate_pkt(struct ctdb_context *ctdb,
hdr->length = length;
hdr->operation = operation;
hdr->ctdb_magic = CTDB_MAGIC;
hdr->ctdb_version = CTDB_VERSION;
hdr->ctdb_version = CTDB_PROTOCOL;
hdr->srcnode = ctdb->pnn;
if (ctdb->vnn_map) {
hdr->generation = ctdb->vnn_map->generation;
@ -216,7 +216,7 @@ void ctdb_client_read_cb(uint8_t *data, size_t cnt, void *args)
goto done;
}
if (hdr->ctdb_version != CTDB_VERSION) {
if (hdr->ctdb_version != CTDB_PROTOCOL) {
ctdb_set_error(ctdb, "Bad CTDB version 0x%x rejected in client\n", hdr->ctdb_version);
goto done;
}

View File

@ -272,7 +272,7 @@ enum ctdb_operation {
};
#define CTDB_MAGIC 0x43544442 /* CTDB */
#define CTDB_VERSION 1
#define CTDB_PROTOCOL 1
enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS = 0,
CTDB_CONTROL_STATISTICS = 1,

View File

@ -814,7 +814,7 @@ static void daemon_incoming_packet(void *p, struct ctdb_req_header *hdr)
goto done;
}
if (hdr->ctdb_version != CTDB_VERSION) {
if (hdr->ctdb_version != CTDB_PROTOCOL) {
ctdb_set_error(client->ctdb, "Bad CTDB version 0x%x rejected in daemon\n", hdr->ctdb_version);
goto done;
}
@ -876,7 +876,7 @@ static void ctdb_daemon_read_cb(uint8_t *data, size_t cnt, void *args)
return;
}
if (hdr->ctdb_version != CTDB_VERSION) {
if (hdr->ctdb_version != CTDB_PROTOCOL) {
ctdb_set_error(client->ctdb, "Bad CTDB version 0x%x rejected in daemon\n", hdr->ctdb_version);
return;
}
@ -1354,7 +1354,7 @@ struct ctdb_req_header *_ctdb_transport_allocate(struct ctdb_context *ctdb,
hdr->length = length;
hdr->operation = operation;
hdr->ctdb_magic = CTDB_MAGIC;
hdr->ctdb_version = CTDB_VERSION;
hdr->ctdb_version = CTDB_PROTOCOL;
hdr->generation = ctdb->vnn_map->generation;
hdr->srcnode = ctdb->pnn;

View File

@ -63,7 +63,7 @@ void ctdb_tcp_read_cb(uint8_t *data, size_t cnt, void *args)
goto failed;
}
if (hdr->ctdb_version != CTDB_VERSION) {
if (hdr->ctdb_version != CTDB_PROTOCOL) {
DEBUG(DEBUG_ALERT, (__location__ " Bad CTDB version 0x%x rejected\n",
hdr->ctdb_version));
goto failed;

View File

@ -484,7 +484,7 @@ static void show_statistics(struct ctdb_statistics *s, int show_header)
printf("max_childwrite_latency:");
printf("\n");
}
printf("%d:", CTDB_VERSION);
printf("%d:", CTDB_PROTOCOL);
printf("%d:", (int)s->statistics_current_time.tv_sec);
printf("%d:", (int)s->statistics_start_time.tv_sec);
for (i=0;i<ARRAY_SIZE(fields);i++) {
@ -511,7 +511,7 @@ static void show_statistics(struct ctdb_statistics *s, int show_header)
printf("%.6f:", s->childwrite_latency.max);
printf("\n");
} else {
printf("CTDB version %u\n", CTDB_VERSION);
printf("CTDB version %u\n", CTDB_PROTOCOL);
printf("Current time of statistics : %s", ctime(&s->statistics_current_time.tv_sec));
printf("Statistics collected since : (%03d %02d:%02d:%02d) %s", days, hours, minutes, seconds, ctime(&s->statistics_start_time.tv_sec));

View File

@ -21,9 +21,7 @@
#include "cluster_support.h"
#ifdef CLUSTER_SUPPORT
#include <ctdb.h>
#include <ctdb_protocol.h>
#include <ctdb_private.h>
#endif
bool cluster_support_available(void)
@ -49,8 +47,8 @@ const char *cluster_support_features(void)
#ifdef CTDB_SOCKET
_LINE_STR(CTDB_SOCKET)
#endif
#ifdef CTDB_VERSION
_LINE_INT(CTDB_VERSION)
#ifdef CTDB_PROTOCOL
_LINE_INT(CTDB_PROTOCOL)
#endif
"";

View File

@ -179,7 +179,7 @@ struct tevent_req *ctdb_conn_control_send(TALLOC_CTX *mem_ctx,
hdr = &state->req.hdr;
hdr->length = offsetof(struct ctdb_req_control, data) + datalen;
hdr->ctdb_magic = CTDB_MAGIC;
hdr->ctdb_version = CTDB_VERSION;
hdr->ctdb_version = CTDB_PROTOCOL;
hdr->operation = CTDB_REQ_CONTROL;
hdr->reqid = 1; /* FIXME */
hdr->destnode = vnn;
@ -306,7 +306,7 @@ struct tevent_req *ctdb_conn_msg_write_send(TALLOC_CTX *mem_ctx,
h->length = offsetof(struct ctdb_req_message, data) + msg_len;
h->ctdb_magic = CTDB_MAGIC;
h->ctdb_version = CTDB_VERSION;
h->ctdb_version = CTDB_PROTOCOL;
h->generation = 1;
h->operation = CTDB_REQ_MESSAGE;
h->destnode = vnn;

View File

@ -767,7 +767,7 @@ NTSTATUS ctdbd_messaging_send_blob(struct ctdbd_connection *conn,
r.hdr.length = offsetof(struct ctdb_req_message, data) + buflen;
r.hdr.ctdb_magic = CTDB_MAGIC;
r.hdr.ctdb_version = CTDB_VERSION;
r.hdr.ctdb_version = CTDB_PROTOCOL;
r.hdr.generation = 1;
r.hdr.operation = CTDB_REQ_MESSAGE;
r.hdr.destnode = dst_vnn;
@ -826,7 +826,7 @@ static NTSTATUS ctdbd_control(struct ctdbd_connection *conn,
ZERO_STRUCT(req);
req.hdr.length = offsetof(struct ctdb_req_control, data) + data.dsize;
req.hdr.ctdb_magic = CTDB_MAGIC;
req.hdr.ctdb_version = CTDB_VERSION;
req.hdr.ctdb_version = CTDB_PROTOCOL;
req.hdr.operation = CTDB_REQ_CONTROL;
req.hdr.reqid = ctdbd_next_reqid(conn);
req.hdr.destnode = vnn;
@ -947,7 +947,7 @@ bool ctdb_processes_exist(struct ctdbd_connection *conn,
req.hdr.length = offsetof(struct ctdb_req_control, data);
req.hdr.length += sizeof(pid);
req.hdr.ctdb_magic = CTDB_MAGIC;
req.hdr.ctdb_version = CTDB_VERSION;
req.hdr.ctdb_version = CTDB_PROTOCOL;
req.hdr.operation = CTDB_REQ_CONTROL;
req.hdr.reqid = reqids[i];
req.hdr.destnode = pids[i].vnn;
@ -1143,7 +1143,7 @@ bool ctdb_serverids_exist(struct ctdbd_connection *conn,
req.hdr.length = offsetof(struct ctdb_req_control, data);
req.hdr.ctdb_magic = CTDB_MAGIC;
req.hdr.ctdb_version = CTDB_VERSION;
req.hdr.ctdb_version = CTDB_PROTOCOL;
req.hdr.operation = CTDB_REQ_CONTROL;
req.hdr.reqid = vnn->reqid;
req.hdr.destnode = vnn->vnn;
@ -1354,7 +1354,7 @@ NTSTATUS ctdbd_migrate(struct ctdbd_connection *conn, uint32_t db_id,
req.hdr.length = offsetof(struct ctdb_req_call, data) + key.dsize;
req.hdr.ctdb_magic = CTDB_MAGIC;
req.hdr.ctdb_version = CTDB_VERSION;
req.hdr.ctdb_version = CTDB_PROTOCOL;
req.hdr.operation = CTDB_REQ_CALL;
req.hdr.reqid = ctdbd_next_reqid(conn);
req.flags = CTDB_IMMEDIATE_MIGRATION;
@ -1419,7 +1419,7 @@ NTSTATUS ctdbd_parse(struct ctdbd_connection *conn, uint32_t db_id,
req.hdr.length = offsetof(struct ctdb_req_call, data) + key.dsize;
req.hdr.ctdb_magic = CTDB_MAGIC;
req.hdr.ctdb_version = CTDB_VERSION;
req.hdr.ctdb_version = CTDB_PROTOCOL;
req.hdr.operation = CTDB_REQ_CALL;
req.hdr.reqid = ctdbd_next_reqid(conn);
req.flags = flags;