summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2019-11-12 12:04:22 +1100
committerAmitay Isaacs <amitay@samba.org>2019-11-14 02:20:46 +0000
commit53f8492caafa8556d0c2d3f272d08ce5ce098c25 (patch)
tree213eb69b159fdf664ac85abe119bd06f9e0af548
parenta6d99d9e5c5bc58e6d56be7a6c1dbc7c8d1a882f (diff)
downloadsamba-53f8492caafa8556d0c2d3f272d08ce5ce098c25.tar.gz
ctdb-daemon: Rename ctdb_node private_data to transport_data
This gives a casual reader a useful clue. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
-rw-r--r--ctdb/ib/ibw_ctdb.c11
-rw-r--r--ctdb/ib/ibw_ctdb_init.c5
-rw-r--r--ctdb/include/ctdb_private.h2
-rw-r--r--ctdb/tcp/tcp_connect.c10
-rw-r--r--ctdb/tcp/tcp_init.c8
-rw-r--r--ctdb/tcp/tcp_io.c4
6 files changed, 23 insertions, 17 deletions
diff --git a/ctdb/ib/ibw_ctdb.c b/ctdb/ib/ibw_ctdb.c
index b5537c8a7e5..38314c32ebc 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 47c339a36d6..9f6ebab32de 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 b0572881880..033bd933d32 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;
@@ -165,7 +165,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 0eb9799ac4a..9ad13aabc74 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; i<ctdb->num_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");