diff options
author | Amitay Isaacs <amitay@gmail.com> | 2014-10-21 11:53:29 +1100 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2014-10-28 05:42:05 +0100 |
commit | a54db687acc14351613738d93a4e99ceaa2c6759 (patch) | |
tree | 3e81dc50bfb6065bde1628158c6ec5e2fb40c1b6 | |
parent | 69c0c43d55c93b82b2e398d5c61009fd347170bf (diff) | |
download | samba-a54db687acc14351613738d93a4e99ceaa2c6759.tar.gz |
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>
-rw-r--r-- | ctdb/client/ctdb_client.c | 4 | ||||
-rw-r--r-- | ctdb/include/ctdb_protocol.h | 2 | ||||
-rw-r--r-- | ctdb/server/ctdb_daemon.c | 6 | ||||
-rw-r--r-- | ctdb/tcp/tcp_io.c | 2 | ||||
-rw-r--r-- | ctdb/tools/ctdb.c | 4 | ||||
-rw-r--r-- | source3/lib/cluster_support.c | 6 | ||||
-rw-r--r-- | source3/lib/ctdb_conn.c | 4 | ||||
-rw-r--r-- | source3/lib/ctdbd_conn.c | 12 |
8 files changed, 19 insertions, 21 deletions
diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c index 424937ad8ca..07b17d016a4 100644 --- a/ctdb/client/ctdb_client.c +++ b/ctdb/client/ctdb_client.c @@ -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; } diff --git a/ctdb/include/ctdb_protocol.h b/ctdb/include/ctdb_protocol.h index 72161affa6e..725e4262300 100644 --- a/ctdb/include/ctdb_protocol.h +++ b/ctdb/include/ctdb_protocol.h @@ -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, diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c index 254b1ca8195..aac507cab5c 100644 --- a/ctdb/server/ctdb_daemon.c +++ b/ctdb/server/ctdb_daemon.c @@ -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; diff --git a/ctdb/tcp/tcp_io.c b/ctdb/tcp/tcp_io.c index 5111195b178..a951320a07d 100644 --- a/ctdb/tcp/tcp_io.c +++ b/ctdb/tcp/tcp_io.c @@ -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; diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 458ea9e4abe..5d5ce3cc9ea 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -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)); diff --git a/source3/lib/cluster_support.c b/source3/lib/cluster_support.c index 6a5f91d1d37..b8925aa7725 100644 --- a/source3/lib/cluster_support.c +++ b/source3/lib/cluster_support.c @@ -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 ""; diff --git a/source3/lib/ctdb_conn.c b/source3/lib/ctdb_conn.c index 1bba8e7e82d..c705c211c3c 100644 --- a/source3/lib/ctdb_conn.c +++ b/source3/lib/ctdb_conn.c @@ -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; diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index 5044ddfb328..a26f4102368 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -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; |