Rename "private" to "private_data"
authorVolker Lendecke <vl@samba.org>
Wed, 11 Apr 2007 18:12:15 +0000 (20:12 +0200)
committerVolker Lendecke <vl@samba.org>
Wed, 11 Apr 2007 18:12:15 +0000 (20:12 +0200)
include/ctdb.h
include/ctdb_private.h
tcp/tcp_connect.c
tcp/tcp_init.c
tcp/tcp_io.c

index becdea7cd77d417be79d3a8cf076fd2785b9bb9d..a3bbb1c99782e70587b68d7fa6aab5ab4a99a3f9 100644 (file)
@@ -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
index bd46f36be44c3b9f09c634dbc9663165d326bb4e..6a96009f7dc2787deeea17422b16a753aa8ccbd3 100644 (file)
@@ -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);
index 27928c071e554523d4b55ed51e5e5dcfc5c2ad7a..a6f562e2377f31ed5c2d5d0b862cc6b22756f099 100644 (file)
@@ -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;
 
index d9725a0e62e7e5e4943e7bfa223bd5c86ef521ff..20b9bc9e33ef2e4cf1ebc24c9477fb800ce623f7 100644 (file)
@@ -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;
 }
index 8ec0a1e538cc88dc3a7e4010bf2a68673e58e376..150d726afb011f4c4e6c0036dcd0fc282247c34a 100644 (file)
@@ -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);
 }