From d8dd8fbe49831435f005ee06861d46b1fb61f103 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 11 Apr 2007 20:12:15 +0200 Subject: [PATCH] Rename "private" to "private_data" (This used to be ctdb commit 78cf4443ac0c66fb750ef6919bcdec189ac219c9) --- ctdb/include/ctdb.h | 4 ++-- ctdb/include/ctdb_private.h | 11 ++++++----- ctdb/tcp/tcp_connect.c | 23 +++++++++++++---------- ctdb/tcp/tcp_init.c | 4 ++-- ctdb/tcp/tcp_io.c | 2 +- 5 files changed, 24 insertions(+), 20 deletions(-) diff --git a/ctdb/include/ctdb.h b/ctdb/include/ctdb.h index becdea7cd77..a3bbb1c9978 100644 --- a/ctdb/include/ctdb.h +++ b/ctdb/include/ctdb.h @@ -154,7 +154,7 @@ typedef void (*ctdb_message_fn_t)(struct ctdb_context *, uint32_t srvid, TDB_DATA data, void *); int ctdb_set_message_handler(struct ctdb_context *ctdb, uint32_t srvid, ctdb_message_fn_t handler, - void *private); + void *private_data); int ctdb_call(struct ctdb_db_context *ctdb_db, struct ctdb_call *call); @@ -185,6 +185,6 @@ int ctdb_register_message_handler(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, uint32_t srvid, ctdb_message_fn_t handler, - void *private); + void *private_data); #endif diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index bd46f36be44..6a96009f7dc 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -53,7 +53,8 @@ struct ctdb_address { /* called from the queue code when a packet comes in. Called with data==NULL on error */ -typedef void (*ctdb_queue_cb_fn_t)(uint8_t *data, size_t length, void *private); +typedef void (*ctdb_queue_cb_fn_t)(uint8_t *data, size_t length, + void *private_data); /* @@ -63,7 +64,7 @@ struct ctdb_node { struct ctdb_context *ctdb; struct ctdb_address address; const char *name; /* for debug messages */ - void *private; /* private to transport */ + void *private_data; /* private to transport */ uint32_t vnn; }; @@ -128,7 +129,7 @@ struct ctdb_context { char *err_msg; const struct ctdb_methods *methods; /* transport methods */ const struct ctdb_upcalls *upcalls; /* transport upcalls */ - void *private; /* private to transport */ + void *private_data; /* private to transport */ unsigned max_lacount; struct ctdb_db_context *db_list; struct ctdb_message_list *message_list; @@ -344,7 +345,7 @@ struct ctdb_queue *ctdb_queue_setup(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, int fd, int alignment, ctdb_queue_cb_fn_t callback, - void *private); + void *private_data); /* allocate a packet for use in client<->daemon communication @@ -382,7 +383,7 @@ int ctdb_client_call_recv(struct ctdb_call_state *state, struct ctdb_call *call) int ctdb_daemon_set_message_handler(struct ctdb_context *ctdb, uint32_t srvid, ctdb_message_fn_t handler, - void *private); + void *private_data); int ctdb_client_send_message(struct ctdb_context *ctdb, uint32_t vnn, uint32_t srvid, TDB_DATA data); diff --git a/ctdb/tcp/tcp_connect.c b/ctdb/tcp/tcp_connect.c index 27928c071e5..a6f562e2377 100644 --- a/ctdb/tcp/tcp_connect.c +++ b/ctdb/tcp/tcp_connect.c @@ -40,8 +40,8 @@ static void set_nonblocking(int fd) void ctdb_tcp_tnode_cb(uint8_t *data, size_t cnt, void *private) { struct ctdb_node *node = talloc_get_type(private, struct ctdb_node); - struct ctdb_tcp_node *tnode = talloc_get_type(node->private, - struct ctdb_tcp_node); + struct ctdb_tcp_node *tnode = talloc_get_type( + node->private_data, struct ctdb_tcp_node); /* start a new connect cycle to try to re-establish the link */ @@ -56,10 +56,11 @@ void ctdb_tcp_tnode_cb(uint8_t *data, size_t cnt, void *private) called when socket becomes writeable on connect */ static void ctdb_node_connect_write(struct event_context *ev, struct fd_event *fde, - uint16_t flags, void *private) + uint16_t flags, void *private_data) { - struct ctdb_node *node = talloc_get_type(private, struct ctdb_node); - struct ctdb_tcp_node *tnode = talloc_get_type(node->private, + 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); struct ctdb_context *ctdb = node->ctdb; int error = 0; @@ -106,10 +107,11 @@ static int ctdb_tcp_get_address(struct ctdb_context *ctdb, called when we should try and establish a tcp connection to a node */ void ctdb_tcp_node_connect(struct event_context *ev, struct timed_event *te, - struct timeval t, void *private) + struct timeval t, void *private_data) { - struct ctdb_node *node = talloc_get_type(private, struct ctdb_node); - struct ctdb_tcp_node *tnode = talloc_get_type(node->private, + 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); struct ctdb_context *ctdb = node->ctdb; struct sockaddr_in sock_in; @@ -179,7 +181,7 @@ static void ctdb_listen_event(struct event_context *ev, struct fd_event *fde, struct ctdb_incoming *in; ctdb = talloc_get_type(private, struct ctdb_context); - ctcp = talloc_get_type(ctdb->private, struct ctdb_tcp); + ctcp = talloc_get_type(ctdb->private_data, struct ctdb_tcp); memset(&addr, 0, sizeof(addr)); len = sizeof(addr); fd = accept(ctcp->listen_fd, (struct sockaddr *)&addr, &len); @@ -203,7 +205,8 @@ static void ctdb_listen_event(struct event_context *ev, struct fd_event *fde, */ int ctdb_tcp_listen(struct ctdb_context *ctdb) { - struct ctdb_tcp *ctcp = talloc_get_type(ctdb->private, struct ctdb_tcp); + struct ctdb_tcp *ctcp = talloc_get_type(ctdb->private_data, + struct ctdb_tcp); struct sockaddr_in sock; int one = 1; diff --git a/ctdb/tcp/tcp_init.c b/ctdb/tcp/tcp_init.c index d9725a0e62e..20b9bc9e33e 100644 --- a/ctdb/tcp/tcp_init.c +++ b/ctdb/tcp/tcp_init.c @@ -66,7 +66,7 @@ static int ctdb_tcp_add_node(struct ctdb_node *node) CTDB_NO_MEMORY(node->ctdb, tnode); tnode->fd = -1; - node->private = tnode; + node->private_data = tnode; tnode->queue = ctdb_queue_setup(node->ctdb, node, tnode->fd, CTDB_TCP_ALIGNMENT, ctdb_tcp_tnode_cb, node); @@ -105,7 +105,7 @@ int ctdb_tcp_init(struct ctdb_context *ctdb) CTDB_NO_MEMORY(ctdb, ctcp); ctcp->listen_fd = -1; - ctdb->private = ctcp; + ctdb->private_data = ctcp; ctdb->methods = &ctdb_tcp_methods; return 0; } diff --git a/ctdb/tcp/tcp_io.c b/ctdb/tcp/tcp_io.c index 8ec0a1e538c..150d726afb0 100644 --- a/ctdb/tcp/tcp_io.c +++ b/ctdb/tcp/tcp_io.c @@ -73,7 +73,7 @@ void ctdb_tcp_read_cb(uint8_t *data, size_t cnt, void *args) */ 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, + struct ctdb_tcp_node *tnode = talloc_get_type(node->private_data, struct ctdb_tcp_node); return ctdb_queue_send(tnode->queue, data, length); } -- 2.34.1