From: Martin Schwenke Date: Tue, 12 Nov 2019 01:04:22 +0000 (+1100) Subject: ctdb-daemon: Rename ctdb_node private_data to transport_data X-Git-Tag: samba-4.10.14~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6d45183709d84064d1aaf41deaa8f028b45f707;p=thirdparty%2Fsamba.git ctdb-daemon: Rename ctdb_node private_data to transport_data This gives a casual reader a useful clue. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs (cherry picked from commit 53f8492caafa8556d0c2d3f272d08ce5ce098c25) --- diff --git a/ctdb/ib/ibw_ctdb.c b/ctdb/ib/ibw_ctdb.c index 458646faae0..53911240ff7 100644 --- a/ctdb/ib/ibw_ctdb.c +++ b/ctdb/ib/ibw_ctdb.c @@ -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")); diff --git a/ctdb/ib/ibw_ctdb_init.c b/ctdb/ib/ibw_ctdb_init.c index 7e77ec08031..6fdb0d887cf 100644 --- a/ctdb/ib/ibw_ctdb_init.c +++ b/ctdb/ib/ibw_ctdb_init.c @@ -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)); diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index 0c66725d36c..61910d889e6 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -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; diff --git a/ctdb/tcp/tcp_connect.c b/ctdb/tcp/tcp_connect.c index e0167740602..981dc05e6ed 100644 --- a/ctdb/tcp/tcp_connect.c +++ b/ctdb/tcp/tcp_connect.c @@ -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() */ diff --git a/ctdb/tcp/tcp_init.c b/ctdb/tcp/tcp_init.c index dc92abd4e6c..24cbc93d0c0 100644 --- a/ctdb/tcp/tcp_init.c +++ b/ctdb/tcp/tcp_init.c @@ -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; inum_nodes; i++) { - TALLOC_FREE(ctdb->nodes[i]->private_data); + TALLOC_FREE(ctdb->nodes[i]->transport_data); } } diff --git a/ctdb/tcp/tcp_io.c b/ctdb/tcp/tcp_io.c index 2d8ec0f7062..df9ca02b413 100644 --- a/ctdb/tcp/tcp_io.c +++ b/ctdb/tcp/tcp_io.c @@ -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");