ctdb-daemon: Rename struct ctdb_req_message to ctdb_req_message_old
authorAmitay Isaacs <amitay@gmail.com>
Thu, 29 Oct 2015 05:36:30 +0000 (16:36 +1100)
committerMartin Schwenke <martins@samba.org>
Tue, 3 Nov 2015 23:47:14 +0000 (00:47 +0100)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/client/ctdb_client.c
ctdb/common/ctdb_io.c
ctdb/include/ctdb_protocol.h
ctdb/server/ctdb_daemon.c
source3/include/ctdbd_conn.h
source3/lib/ctdbd_conn.c

index 842d4ef75f82f10aa2c078972038db74df566dff..e1e62c7c9f10604c6ecd91f4b746bebb38c4b0c9 100644 (file)
@@ -195,7 +195,7 @@ static void ctdb_client_reply_call(struct ctdb_context *ctdb, struct ctdb_req_he
 void ctdb_request_message(struct ctdb_context *ctdb,
                          struct ctdb_req_header *hdr)
 {
-       struct ctdb_req_message *c = (struct ctdb_req_message *)hdr;
+       struct ctdb_req_message_old *c = (struct ctdb_req_message_old *)hdr;
        TDB_DATA data;
 
        data.dsize = c->datalen;
@@ -589,12 +589,12 @@ int ctdb_client_check_message_handlers(struct ctdb_context *ctdb, uint64_t *ids,
 int ctdb_client_send_message(struct ctdb_context *ctdb, uint32_t pnn,
                      uint64_t srvid, TDB_DATA data)
 {
-       struct ctdb_req_message *r;
+       struct ctdb_req_message_old *r;
        int len, res;
 
-       len = offsetof(struct ctdb_req_message, data) + data.dsize;
+       len = offsetof(struct ctdb_req_message_old, data) + data.dsize;
        r = ctdbd_allocate_pkt(ctdb, ctdb, CTDB_REQ_MESSAGE, 
-                              len, struct ctdb_req_message);
+                              len, struct ctdb_req_message_old);
        CTDB_NO_MEMORY(ctdb, r);
 
        r->hdr.destnode  = pnn;
index fca9be050215efc834748463f9afb2c53ea9c2fc..8b649a2d43a2ede0090c41d1ec76113f8b5bd921 100644 (file)
@@ -365,7 +365,7 @@ int ctdb_queue_send(struct ctdb_queue *queue, uint8_t *data, uint32_t length)
                        break;
                }
                case CTDB_REQ_MESSAGE: {
-                       struct ctdb_req_message *m = (struct ctdb_req_message *)hdr;
+                       struct ctdb_req_message_old *m = (struct ctdb_req_message_old *)hdr;
                        talloc_set_name(pkt, "ctdb_queue_pkt: %s message srvid=%llu datalen=%u",
                                        queue->name, (unsigned long long)m->srvid, (unsigned)m->datalen);
                        break;
index f4d07d004e639a8b6dc93d369842fc94fa885a6e..11d9f53d67ab2e9665558578897309656c3aa303 100644 (file)
@@ -473,7 +473,7 @@ struct ctdb_reply_dmaster_old {
        uint8_t  data[1];
 };
 
-struct ctdb_req_message {
+struct ctdb_req_message_old {
        struct ctdb_req_header hdr;
        uint64_t srvid;
        uint32_t datalen;
index 81bb98d4d67c0986219ac18828b20f738484ed08..f885a81f758d00a12cd141d63cc98140bfa5329f 100644 (file)
@@ -145,13 +145,13 @@ static void daemon_message_handler(uint64_t srvid, TDB_DATA data,
                                   void *private_data)
 {
        struct ctdb_client *client = talloc_get_type(private_data, struct ctdb_client);
-       struct ctdb_req_message *r;
+       struct ctdb_req_message_old *r;
        int len;
 
        /* construct a message to send to the client containing the data */
-       len = offsetof(struct ctdb_req_message, data) + data.dsize;
+       len = offsetof(struct ctdb_req_message_old, data) + data.dsize;
        r = ctdbd_allocate_pkt(client->ctdb, client->ctdb, CTDB_REQ_MESSAGE,
-                              len, struct ctdb_req_message);
+                              len, struct ctdb_req_message_old);
        CTDB_NO_MEMORY_VOID(client->ctdb, r);
 
        talloc_set_name_const(r, "req_message packet");
@@ -273,7 +273,7 @@ static int ctdb_client_destructor(struct ctdb_client *client)
   from a local client over the unix domain socket
  */
 static void daemon_request_message_from_client(struct ctdb_client *client, 
-                                              struct ctdb_req_message *c)
+                                              struct ctdb_req_message_old *c)
 {
        TDB_DATA data;
        int res;
@@ -845,7 +845,7 @@ static void daemon_incoming_packet(void *p, struct ctdb_req_header *hdr)
 
        case CTDB_REQ_MESSAGE:
                CTDB_INCREMENT_STAT(ctdb, client.req_message);
-               daemon_request_message_from_client(client, (struct ctdb_req_message *)hdr);
+               daemon_request_message_from_client(client, (struct ctdb_req_message_old *)hdr);
                break;
 
        case CTDB_REQ_CONTROL:
@@ -1616,7 +1616,7 @@ static int ctdb_local_message(struct ctdb_context *ctdb, uint64_t srvid, TDB_DAT
 int ctdb_daemon_send_message(struct ctdb_context *ctdb, uint32_t pnn,
                             uint64_t srvid, TDB_DATA data)
 {
-       struct ctdb_req_message *r;
+       struct ctdb_req_message_old *r;
        int len;
 
        if (ctdb->methods == NULL) {
@@ -1629,9 +1629,9 @@ int ctdb_daemon_send_message(struct ctdb_context *ctdb, uint32_t pnn,
                return ctdb_local_message(ctdb, srvid, data);
        }
 
-       len = offsetof(struct ctdb_req_message, data) + data.dsize;
+       len = offsetof(struct ctdb_req_message_old, data) + data.dsize;
        r = ctdb_transport_allocate(ctdb, ctdb, CTDB_REQ_MESSAGE, len,
-                                   struct ctdb_req_message);
+                                   struct ctdb_req_message_old);
        CTDB_NO_MEMORY(ctdb, r);
 
        r->hdr.destnode  = pnn;
index 9342ddcaa93a3f4fc2d12cd8daab44eca47fc732..27993c744f037fc0ebb434126dbc2d0e414addc4 100644 (file)
@@ -84,7 +84,7 @@ int ctdbd_control_local(struct ctdbd_connection *conn, uint32_t opcode,
 int ctdb_watch_us(struct ctdbd_connection *conn);
 int ctdb_unwatch(struct ctdbd_connection *conn);
 
-struct ctdb_req_message;
+struct ctdb_req_message_old;
 
 int register_with_ctdbd(struct ctdbd_connection *conn, uint64_t srvid,
                        int (*cb)(uint32_t src_vnn, uint32_t dst_vnn,
index 4ed1105d253f3d142ddc114dda4f9b4e21db9ea4..836d97170fc347d0a4bccd3d812e9b3801aa424d 100644 (file)
@@ -135,18 +135,18 @@ int register_with_ctdbd(struct ctdbd_connection *conn, uint64_t srvid,
 }
 
 static int ctdbd_msg_call_back(struct ctdbd_connection *conn,
-                              struct ctdb_req_message *msg)
+                              struct ctdb_req_message_old *msg)
 {
        size_t msg_len;
        size_t i, num_callbacks;
 
        msg_len = msg->hdr.length;
-       if (msg_len < offsetof(struct ctdb_req_message, data)) {
+       if (msg_len < offsetof(struct ctdb_req_message_old, data)) {
                DEBUG(10, ("%s: len %u too small\n", __func__,
                           (unsigned)msg_len));
                return 0;
        }
-       msg_len -= offsetof(struct ctdb_req_message, data);
+       msg_len -= offsetof(struct ctdb_req_message_old, data);
 
        if (msg_len < msg->datalen) {
                DEBUG(10, ("%s: msg_len=%u < msg->datalen=%u\n", __func__,
@@ -370,7 +370,7 @@ static int ctdb_read_req(struct ctdbd_connection *conn, uint32_t reqid,
        ctdb_packet_dump(hdr);
 
        if (hdr->operation == CTDB_REQ_MESSAGE) {
-               struct ctdb_req_message *msg = (struct ctdb_req_message *)hdr;
+               struct ctdb_req_message_old *msg = (struct ctdb_req_message_old *)hdr;
 
                if (conn->msg_ctx == NULL) {
                        DEBUG(1, ("Got a message without having a msg ctx, "
@@ -526,7 +526,7 @@ int ctdbd_conn_get_fd(struct ctdbd_connection *conn)
 static int ctdb_handle_message(struct ctdbd_connection *conn,
                               struct ctdb_req_header *hdr)
 {
-       struct ctdb_req_message *msg;
+       struct ctdb_req_message_old *msg;
 
        if (hdr->operation != CTDB_REQ_MESSAGE) {
                DEBUG(0, ("Received async msg of type %u, discarding\n",
@@ -534,7 +534,7 @@ static int ctdb_handle_message(struct ctdbd_connection *conn,
                return EINVAL;
        }
 
-       msg = (struct ctdb_req_message *)hdr;
+       msg = (struct ctdb_req_message_old *)hdr;
 
        ctdbd_msg_call_back(conn, msg);
 
@@ -598,12 +598,12 @@ int ctdbd_messaging_send_iov(struct ctdbd_connection *conn,
                             uint32_t dst_vnn, uint64_t dst_srvid,
                             const struct iovec *iov, int iovlen)
 {
-       struct ctdb_req_message r;
+       struct ctdb_req_message_old r;
        struct iovec iov2[iovlen+1];
        size_t buflen = iov_buflen(iov, iovlen);
        ssize_t nwritten;
 
-       r.hdr.length = offsetof(struct ctdb_req_message, data) + buflen;
+       r.hdr.length = offsetof(struct ctdb_req_message_old, data) + buflen;
        r.hdr.ctdb_magic = CTDB_MAGIC;
        r.hdr.ctdb_version = CTDB_PROTOCOL;
        r.hdr.generation = 1;
@@ -618,7 +618,7 @@ int ctdbd_messaging_send_iov(struct ctdbd_connection *conn,
        ctdb_packet_dump(&r.hdr);
 
        iov2[0].iov_base = &r;
-       iov2[0].iov_len = offsetof(struct ctdb_req_message, data);
+       iov2[0].iov_len = offsetof(struct ctdb_req_message_old, data);
        memcpy(&iov2[1], iov, iovlen * sizeof(struct iovec));
 
        nwritten = write_data_iov(conn->fd, iov2, iovlen+1);
@@ -1093,7 +1093,7 @@ int ctdbd_traverse(struct ctdbd_connection *master, uint32_t db_id,
 
        while (True) {
                struct ctdb_req_header *hdr = NULL;
-               struct ctdb_req_message *m;
+               struct ctdb_req_message_old *m;
                struct ctdb_rec_data *d;
 
                ret = ctdb_read_packet(conn->fd, conn->timeout, conn, &hdr);
@@ -1110,7 +1110,7 @@ int ctdbd_traverse(struct ctdbd_connection *master, uint32_t db_id,
                        return EIO;
                }
 
-               m = (struct ctdb_req_message *)hdr;
+               m = (struct ctdb_req_message_old *)hdr;
                d = (struct ctdb_rec_data *)&m->data[0];
                if (m->datalen < sizeof(uint32_t) || m->datalen != d->length) {
                        DEBUG(0, ("Got invalid traverse data of length %d\n",