]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-daemon: Rename ctdb_node private_data to transport_data
authorMartin Schwenke <martin@meltin.net>
Tue, 12 Nov 2019 01:04:22 +0000 (12:04 +1100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 24 Mar 2020 07:26:17 +0000 (07:26 +0000)
This gives a casual reader a useful clue.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 53f8492caafa8556d0c2d3f272d08ce5ce098c25)

ctdb/ib/ibw_ctdb.c
ctdb/ib/ibw_ctdb_init.c
ctdb/include/ctdb_private.h
ctdb/tcp/tcp_connect.c
ctdb/tcp/tcp_init.c
ctdb/tcp/tcp_io.c

index 458646faae0904265101900472c8fcfb9dc89864..53911240ff7ff42f212d46c904bc2d085211a469 100644 (file)
@@ -55,7 +55,8 @@ int ctdb_ibw_get_address(struct ctdb_context *ctdb,
 
 int ctdb_ibw_node_connect(struct ctdb_node *node)
 {
-       struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
+       struct ctdb_ibw_node *cn = talloc_get_type(node->transport_data,
+                                                  struct ctdb_ibw_node);
        int     rc;
 
        assert(cn!=NULL);
@@ -118,7 +119,9 @@ int ctdb_ibw_connstate_handler(struct ibw_ctx *ctx, struct ibw_conn *conn)
                case IBWC_CONNECTED: { /* after ibw_accept or ibw_connect */
                        struct ctdb_node *node = talloc_get_type(conn->conn_userdata, struct ctdb_node);
                        if (node!=NULL) { /* after ibw_connect */
-                               struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
+                               struct ctdb_ibw_node *cn = talloc_get_type(
+                                       node->transport_data,
+                                       struct ctdb_ibw_node);
 
                                node->ctdb->upcalls->node_connected(node);
                                ctdb_flush_cn_queue(cn);
@@ -136,7 +139,9 @@ int ctdb_ibw_connstate_handler(struct ibw_ctx *ctx, struct ibw_conn *conn)
                case IBWC_ERROR: {
                        struct ctdb_node *node = talloc_get_type(conn->conn_userdata, struct ctdb_node);
                        if (node!=NULL) {
-                               struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
+                               struct ctdb_ibw_node *cn = talloc_get_type(
+                                       node->transport_data,
+                                       struct ctdb_ibw_node);
                                struct ibw_ctx *ictx = cn->conn->ctx;
 
                                DEBUG(DEBUG_DEBUG, ("IBWC_ERROR, reconnecting...\n"));
index 7e77ec08031a4c6cbfd94a48d1b404f811913d88..6fdb0d887cfd918353aea994b2844b3be10b97e7 100644 (file)
@@ -67,7 +67,7 @@ static int ctdb_ibw_add_node(struct ctdb_node *node)
 
        assert(cn!=NULL);
        cn->conn = ibw_conn_new(ictx, node);
-       node->private_data = (void *)cn;
+       node->transport_data = (void *)cn;
 
        return (cn->conn!=NULL ? 0 : -1);
 }
@@ -153,7 +153,8 @@ int ctdb_flush_cn_queue(struct ctdb_ibw_node *cn)
 
 static int ctdb_ibw_queue_pkt(struct ctdb_node *node, uint8_t *data, uint32_t length)
 {
-       struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
+       struct ctdb_ibw_node *cn = talloc_get_type(node->transport_data,
+                                                  struct ctdb_ibw_node);
        int     rc;
 
        assert(length>=sizeof(uint32_t));
index 0c66725d36c97554024f6625dc43ae4ff49739c8..61910d889e6bf3fb32586cb9b17e0bc3b3da4942 100644 (file)
@@ -74,7 +74,7 @@ struct ctdb_node {
        struct ctdb_context *ctdb;
        ctdb_sock_addr address;
        const char *name; /* for debug messages */
-       void *private_data; /* private to transport */
+       void *transport_data; /* private to transport */
        uint32_t pnn;
        uint32_t flags;
 
index e0167740602b656416d361eb0f2c414b59e938ed..981dc05e6edfbec29a2c67938ae56f1f5d26206f 100644 (file)
@@ -43,7 +43,7 @@
 void ctdb_tcp_stop_connection(struct ctdb_node *node)
 {
        struct ctdb_tcp_node *tnode = talloc_get_type(
-               node->private_data, struct ctdb_tcp_node);
+               node->transport_data, struct ctdb_tcp_node);
 
        TALLOC_FREE(tnode->out_queue);
        TALLOC_FREE(tnode->connect_te);
@@ -63,7 +63,7 @@ void ctdb_tcp_tnode_cb(uint8_t *data, size_t cnt, void *private_data)
 {
        struct ctdb_node *node = talloc_get_type(private_data, struct ctdb_node);
        struct ctdb_tcp_node *tnode = talloc_get_type(
-               node->private_data, struct ctdb_tcp_node);
+               node->transport_data, struct ctdb_tcp_node);
 
        if (data == NULL) {
                node->ctdb->upcalls->node_dead(node);
@@ -85,7 +85,7 @@ static void ctdb_node_connect_write(struct tevent_context *ev,
 {
        struct ctdb_node *node = talloc_get_type(private_data,
                                                 struct ctdb_node);
-       struct ctdb_tcp_node *tnode = talloc_get_type(node->private_data,
+       struct ctdb_tcp_node *tnode = talloc_get_type(node->transport_data,
                                                      struct ctdb_tcp_node);
        struct ctdb_context *ctdb = node->ctdb;
        int error = 0;
@@ -167,7 +167,7 @@ void ctdb_tcp_node_connect(struct tevent_context *ev, struct tevent_timer *te,
 {
        struct ctdb_node *node = talloc_get_type(private_data,
                                                 struct ctdb_node);
-       struct ctdb_tcp_node *tnode = talloc_get_type(node->private_data, 
+       struct ctdb_tcp_node *tnode = talloc_get_type(node->transport_data,
                                                      struct ctdb_tcp_node);
        struct ctdb_context *ctdb = node->ctdb;
         ctdb_sock_addr sock_in;
@@ -300,7 +300,7 @@ static void ctdb_listen_event(struct tevent_context *ev, struct tevent_fd *fde,
                return;
        }
 
-       tnode = talloc_get_type_abort(node->private_data,
+       tnode = talloc_get_type_abort(node->transport_data,
                                      struct ctdb_tcp_node);
        if (tnode == NULL) {
                /* This can't happen - see ctdb_tcp_initialise() */
index dc92abd4e6c802dcbcad56bcaa763af0156963ab..24cbc93d0c0a5f084026abf3f0d92f0629415b81 100644 (file)
@@ -58,7 +58,7 @@ static int ctdb_tcp_add_node(struct ctdb_node *node)
        tnode->out_fd = -1;
        tnode->ctdb = node->ctdb;
 
-       node->private_data = tnode;
+       node->transport_data = tnode;
        talloc_set_destructor(tnode, tnode_destructor);
 
        return 0;
@@ -97,7 +97,7 @@ static int ctdb_tcp_connect_node(struct ctdb_node *node)
 {
        struct ctdb_context *ctdb = node->ctdb;
        struct ctdb_tcp_node *tnode = talloc_get_type(
-               node->private_data, struct ctdb_tcp_node);
+               node->transport_data, struct ctdb_tcp_node);
 
        /* startup connection to the other server - will happen on
           next event loop */
@@ -118,7 +118,7 @@ static int ctdb_tcp_connect_node(struct ctdb_node *node)
 static void ctdb_tcp_restart(struct ctdb_node *node)
 {
        struct ctdb_tcp_node *tnode = talloc_get_type(
-               node->private_data, struct ctdb_tcp_node);
+               node->transport_data, struct ctdb_tcp_node);
 
        DEBUG(DEBUG_NOTICE,("Tearing down connection to dead node :%d\n", node->pnn));
 
@@ -143,7 +143,7 @@ static void ctdb_tcp_shutdown(struct ctdb_context *ctdb)
        ctdb->private_data = NULL;
 
        for (i=0; i<ctdb->num_nodes; i++) {
-               TALLOC_FREE(ctdb->nodes[i]->private_data);
+               TALLOC_FREE(ctdb->nodes[i]->transport_data);
        }
 }
 
index 2d8ec0f706219ab6370bafacfd0ef56d20b9f0d6..df9ca02b413fe9da4f94d43640b3cec83ce8190e 100644 (file)
@@ -39,7 +39,7 @@ void ctdb_tcp_read_cb(uint8_t *data, size_t cnt, void *args)
 {
        struct ctdb_node *node = talloc_get_type_abort(args, struct ctdb_node);
        struct ctdb_tcp_node *tnode = talloc_get_type_abort(
-               node->private_data, struct ctdb_tcp_node);
+               node->transport_data, struct ctdb_tcp_node);
        struct ctdb_req_header *hdr = (struct ctdb_req_header *)data;
 
        if (data == NULL) {
@@ -86,7 +86,7 @@ failed:
 */
 int ctdb_tcp_queue_pkt(struct ctdb_node *node, uint8_t *data, uint32_t length)
 {
-       struct ctdb_tcp_node *tnode = talloc_get_type(node->private_data,
+       struct ctdb_tcp_node *tnode = talloc_get_type(node->transport_data,
                                                      struct ctdb_tcp_node);
        if (tnode->out_queue == NULL) {
                DBG_DEBUG("No outgoing connection, dropping packet\n");