private -> private_data for samba3
authorAndrew Tridgell <tridge@samba.org>
Fri, 13 Apr 2007 10:38:24 +0000 (20:38 +1000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 13 Apr 2007 10:38:24 +0000 (20:38 +1000)
16 files changed:
common/ctdb_call.c
common/ctdb_client.c
common/ctdb_daemon.c
common/ctdb_io.c
common/ctdb_message.c
ib/ibw_ctdb.c
ib/ibw_ctdb.h
ib/ibw_ctdb_init.c
ib/ibwrapper_test.c
include/ctdb_private.h
tcp/ctdb_tcp.h
tcp/tcp_connect.c
tests/ctdb_bench.c
tests/ctdb_fetch.c
tests/ctdb_fetch1.c
tests/ctdb_messaging.c

index 0b7b3bc6c81619d8edb3c2febea310b7652fa063..b03c8729edb5d59a5a42c90bd1f4eb40f650cdfa 100644 (file)
@@ -528,9 +528,9 @@ static int ctdb_call_destructor(struct ctdb_call_state *state)
   called when a ctdb_call times out
 */
 void ctdb_call_timeout(struct event_context *ev, struct timed_event *te, 
-                      struct timeval t, void *private)
+                      struct timeval t, void *private_data)
 {
-       struct ctdb_call_state *state = talloc_get_type(private, struct ctdb_call_state);
+       struct ctdb_call_state *state = talloc_get_type(private_data, struct ctdb_call_state);
        state->state = CTDB_CALL_ERROR;
        ctdb_set_error(state->node->ctdb, "ctdb_call %u timed out",
                       state->c->hdr.reqid);
@@ -543,9 +543,9 @@ void ctdb_call_timeout(struct event_context *ev, struct timed_event *te,
   this allows the caller to setup a async.fn 
 */
 static void call_local_trigger(struct event_context *ev, struct timed_event *te, 
-                      struct timeval t, void *private)
+                      struct timeval t, void *private_data)
 {
-       struct ctdb_call_state *state = talloc_get_type(private, struct ctdb_call_state);
+       struct ctdb_call_state *state = talloc_get_type(private_data, struct ctdb_call_state);
        if (state->async.fn) {
                state->async.fn(state);
        }
index fc6cefb7f9da319bad2921e18269557bcc58a98f..d6853fd2de6364df0e36ed8307c8fa44f70df795 100644 (file)
@@ -354,7 +354,7 @@ struct ctdb_call_state *ctdb_client_call_send(struct ctdb_db_context *ctdb_db,
 */
 int ctdb_client_set_message_handler(struct ctdb_context *ctdb, uint32_t srvid, 
                                    ctdb_message_fn_t handler,
-                                   void *private)
+                                   void *private_data)
                                    
 {
        struct ctdb_req_register c;
@@ -379,7 +379,7 @@ int ctdb_client_set_message_handler(struct ctdb_context *ctdb, uint32_t srvid,
        }
 
        /* also need to register the handler with our ctdb structure */
-       return ctdb_register_message_handler(ctdb, ctdb, srvid, handler, private);
+       return ctdb_register_message_handler(ctdb, ctdb, srvid, handler, private_data);
 }
 
 
@@ -390,12 +390,12 @@ int ctdb_client_set_message_handler(struct ctdb_context *ctdb, uint32_t srvid,
 int ctdb_set_message_handler(struct ctdb_context *ctdb, 
                             uint32_t srvid, 
                             ctdb_message_fn_t handler,
-                            void *private)
+                            void *private_data)
 {
        if (ctdb->flags & CTDB_FLAG_DAEMON_MODE) {
-               return ctdb_client_set_message_handler(ctdb, srvid, handler, private);
+               return ctdb_client_set_message_handler(ctdb, srvid, handler, private_data);
        }
-       return ctdb_daemon_set_message_handler(ctdb, srvid, handler, private);
+       return ctdb_daemon_set_message_handler(ctdb, srvid, handler, private_data);
 }
 
 
index b727bd62b237444c77c2f254b0da4818e533a1ba..b97b31ccb4c2fd4de85184c13b544c65c24dd8d2 100644 (file)
@@ -63,9 +63,9 @@ struct ctdb_client {
   to the right client
  */
 static void daemon_message_handler(struct ctdb_context *ctdb, uint32_t srvid, 
-                                   TDB_DATA data, void *private)
+                                   TDB_DATA data, void *private_data)
 {
-       struct ctdb_client *client = talloc_get_type(private, struct ctdb_client);
+       struct ctdb_client *client = talloc_get_type(private_data, struct ctdb_client);
        struct ctdb_req_message *r;
        int len;
 
@@ -147,7 +147,7 @@ struct client_fetch_lock_data {
 static void daemon_fetch_lock_complete(struct ctdb_call_state *state)
 {
        struct ctdb_reply_fetch_lock *r;
-       struct client_fetch_lock_data *data = talloc_get_type(state->async.private, struct client_fetch_lock_data);
+       struct client_fetch_lock_data *data = talloc_get_type(state->async.private_data, struct client_fetch_lock_data);
        struct ctdb_client *client = talloc_get_type(data->client, struct ctdb_client);
        int length, res;
 
@@ -201,7 +201,7 @@ static void daemon_request_fetch_lock(struct ctdb_client *client,
        fl_data->client = client;
        fl_data->reqid  = f->hdr.reqid;
        state->async.fn = daemon_fetch_lock_complete;
-       state->async.private = fl_data;
+       state->async.private_data = fl_data;
 }
 
 /*
@@ -445,12 +445,12 @@ static void ctdb_client_read_cb(uint8_t *data, size_t cnt, void *args)
 }
 
 static void ctdb_accept_client(struct event_context *ev, struct fd_event *fde, 
-                        uint16_t flags, void *private)
+                        uint16_t flags, void *private_data)
 {
        struct sockaddr_in addr;
        socklen_t len;
        int fd;
-       struct ctdb_context *ctdb = talloc_get_type(private, struct ctdb_context);
+       struct ctdb_context *ctdb = talloc_get_type(private_data, struct ctdb_context);
        struct ctdb_client *client;
 
        memset(&addr, 0, sizeof(addr));
@@ -474,9 +474,9 @@ static void ctdb_accept_client(struct event_context *ev, struct fd_event *fde,
 
 
 static void ctdb_read_from_parent(struct event_context *ev, struct fd_event *fde, 
-                        uint16_t flags, void *private)
+                        uint16_t flags, void *private_data)
 {
-       int *fd = private;
+       int *fd = private_data;
        int cnt;
        char buf;
 
@@ -600,8 +600,8 @@ void *ctdbd_allocate_pkt(struct ctdb_context *ctdb, size_t len)
 
 int ctdb_daemon_set_message_handler(struct ctdb_context *ctdb, uint32_t srvid, 
                             ctdb_message_fn_t handler,
-                            void *private)
+                            void *private_data)
 {
-       return ctdb_register_message_handler(ctdb, ctdb, srvid, handler, private);
+       return ctdb_register_message_handler(ctdb, ctdb, srvid, handler, private_data);
 }
 
index eb1d47bae397247fc8ad5f15f83af36315d68b7a..d998540e834fb16dbb0a0f6e0ac2ba3cd26d7e51 100644 (file)
@@ -49,7 +49,7 @@ struct ctdb_queue {
        struct fd_event *fde;
        int fd;
        size_t alignment;
-       void *private;
+       void *private_data;
        ctdb_queue_cb_fn_t callback;
 };
 
@@ -93,7 +93,7 @@ static void queue_io_read(struct ctdb_queue *queue)
        if (nread >= 4 && *(uint32_t *)data == nread) {
                /* it is the responsibility of the incoming packet
                 function to free 'data' */
-               queue->callback(data, nread, queue->private);
+               queue->callback(data, nread, queue->private_data);
                return;
        }
 
@@ -109,7 +109,7 @@ static void queue_io_read(struct ctdb_queue *queue)
                        /* sigh */
                        goto failed;
                }
-               queue->callback(d2, len, queue->private);
+               queue->callback(d2, len, queue->private_data);
                data += len;
                nread -= len;           
        }
@@ -134,16 +134,16 @@ static void queue_io_read(struct ctdb_queue *queue)
        return;
 
 failed:
-       queue->callback(NULL, 0, queue->private);
+       queue->callback(NULL, 0, queue->private_data);
 }
 
 
 /* used when an event triggers a dead queue */
 static void queue_dead(struct event_context *ev, struct timed_event *te, 
-                      struct timeval t, void *private)
+                      struct timeval t, void *private_data)
 {
-       struct ctdb_queue *queue = talloc_get_type(private, struct ctdb_queue);
-       queue->callback(NULL, 0, queue->private);
+       struct ctdb_queue *queue = talloc_get_type(private_data, struct ctdb_queue);
+       queue->callback(NULL, 0, queue->private_data);
 }
 
 
@@ -183,9 +183,9 @@ static void queue_io_write(struct ctdb_queue *queue)
   called when an incoming connection is readable or writeable
 */
 static void queue_io_handler(struct event_context *ev, struct fd_event *fde, 
-                            uint16_t flags, void *private)
+                            uint16_t flags, void *private_data)
 {
-       struct ctdb_queue *queue = talloc_get_type(private, struct ctdb_queue);
+       struct ctdb_queue *queue = talloc_get_type(private_data, struct ctdb_queue);
 
        if (flags & EVENT_FD_READ) {
                queue_io_read(queue);
@@ -280,7 +280,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)
 {
        struct ctdb_queue *queue;
 
@@ -290,7 +290,7 @@ struct ctdb_queue *ctdb_queue_setup(struct ctdb_context *ctdb,
        queue->ctdb = ctdb;
        queue->fd = fd;
        queue->alignment = alignment;
-       queue->private = private;
+       queue->private_data = private_data;
        queue->callback = callback;
        if (fd != -1) {
                if (ctdb_queue_set_fd(queue, fd) != 0) {
index 0ee77f252b65acd576a40b9c6dd92d470f1ea762..b291258b0133b6060d89bff6b68003fb9e923fb4 100644 (file)
@@ -78,9 +78,9 @@ struct ctdb_local_message {
 };
 
 static void ctdb_local_message_trigger(struct event_context *ev, struct timed_event *te, 
-                                      struct timeval t, void *private)
+                                      struct timeval t, void *private_data)
 {
-       struct ctdb_local_message *m = talloc_get_type(private, 
+       struct ctdb_local_message *m = talloc_get_type(private_data
                                                       struct ctdb_local_message);
        int res;
 
@@ -176,7 +176,7 @@ 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)
 {
        struct ctdb_message_list *m;
 
@@ -186,7 +186,7 @@ int ctdb_register_message_handler(struct ctdb_context *ctdb,
        m->ctdb            = ctdb;
        m->srvid           = srvid;
        m->message_handler = handler;
-       m->message_private = private;
+       m->message_private = private_data;
        
        DLIST_ADD(ctdb->message_list, m);
 
index 50dd8d68d4310348c98509a73624914438cb9f2c..dfe4adc6d3e485cd22c68ea3f0af240afd4241cb 100644 (file)
@@ -31,7 +31,7 @@
 
 int ctdb_ibw_node_connect(struct ctdb_node *node)
 {
-       struct ctdb_ibw_node *cn = talloc_get_type(node->private, struct ctdb_ibw_node);
+       struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
        int     rc;
 
        assert(cn!=NULL);
@@ -56,9 +56,9 @@ int ctdb_ibw_node_connect(struct ctdb_node *node)
 }
 
 void ctdb_ibw_node_connect_event(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_node *node = talloc_get_type(private_data, struct ctdb_node);
 
        ctdb_ibw_node_connect(node);
 }
@@ -98,7 +98,7 @@ 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, struct ctdb_ibw_node);
+                               struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
 
                                node->ctdb->upcalls->node_connected(node);
                                ctdb_flush_cn_queue(cn);
@@ -116,7 +116,7 @@ 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, struct ctdb_ibw_node);
+                               struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
                                struct ibw_ctx *ictx = cn->conn->ctx;
 
                                DEBUG(10, ("IBWC_ERROR, reconnecting...\n"));
index 24adeb7233e96e2b065b18a2be578bdd6045a2b6..8286eef65aa44ad41f08a8f94fe46064b09cfa9d 100644 (file)
@@ -41,6 +41,6 @@ int ctdb_ibw_receive_handler(struct ibw_conn *conn, void *buf, int n);
 
 int ctdb_ibw_node_connect(struct ctdb_node *node);
 void ctdb_ibw_node_connect_event(struct event_context *ev, struct timed_event *te, 
-       struct timeval t, void *private);
+       struct timeval t, void *private_data);
 
 int ctdb_flush_cn_queue(struct ctdb_ibw_node *cn);
index 9c0300c4f4c4a556071a32cfa70b8614244bd1d3..3b0c6ad28fb102fb569b10d4878319dbd91f5877 100644 (file)
@@ -31,7 +31,7 @@
 
 static int ctdb_ibw_listen(struct ctdb_context *ctdb, int backlog)
 {
-       struct ibw_ctx *ictx = talloc_get_type(ctdb->private, struct ibw_ctx);
+       struct ibw_ctx *ictx = talloc_get_type(ctdb->private_data, struct ibw_ctx);
        struct sockaddr_in my_addr;
 
        assert(ictx!=NULL);
@@ -81,12 +81,12 @@ static int ctdb_ibw_start(struct ctdb_context *ctdb)
  */
 static int ctdb_ibw_add_node(struct ctdb_node *node)
 {
-       struct ibw_ctx *ictx = talloc_get_type(node->ctdb->private, struct ibw_ctx);
+       struct ibw_ctx *ictx = talloc_get_type(node->ctdb->private_data, struct ibw_ctx);
        struct ctdb_ibw_node *cn = talloc_zero(node, struct ctdb_ibw_node);
 
        assert(cn!=NULL);
        cn->conn = ibw_conn_new(ictx, node);
-       node->private = (void *)cn;
+       node->private_data = (void *)cn;
 
        return (cn->conn!=NULL ? 0 : -1);
 }
@@ -127,7 +127,7 @@ 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, struct ctdb_ibw_node);
+       struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
        int     rc;
 
        assert(length>=sizeof(uint32_t));
@@ -168,7 +168,7 @@ static void *ctdb_ibw_allocate_pkt(struct ctdb_context *ctdb, size_t size)
 
 static int ctdb_ibw_stop(struct ctdb_context *cctx)
 {
-       struct ibw_ctx *ictx = talloc_get_type(cctx->private, struct ibw_ctx);
+       struct ibw_ctx *ictx = talloc_get_type(cctx->private_data, struct ibw_ctx);
 
        assert(ictx!=NULL);
        return ibw_stop(ictx);
@@ -207,7 +207,7 @@ int ctdb_ibw_init(struct ctdb_context *ctdb)
        }
 
        ctdb->methods = &ctdb_ibw_methods;
-       ctdb->private = ictx;
+       ctdb->private_data = ictx;
        
        DEBUG(10, ("ctdb_ibw_init succeeded.\n"));
        return 0;
index 2ab4c97158ba6d553be39b4027c9e38ca995e8e4..fa506500e46b65faeb1d2c01aa783c47e461b4f7 100644 (file)
@@ -378,9 +378,9 @@ error:
 }
 
 void ibwtest_timeout_handler(struct event_context *ev, struct timed_event *te, 
-       struct timeval t, void *private)
+       struct timeval t, void *private_data)
 {
-       struct ibwtest_ctx *tcx = talloc_get_type(private, struct ibwtest_ctx);
+       struct ibwtest_ctx *tcx = talloc_get_type(private_data, struct ibwtest_ctx);
        int     rc;
 
        if (!tcx->is_server) {
index 10f85e670f14b176a28f5ad422604c9f01af592e..c50b481cf35124cbdb99f396e66a0f124c253ca0 100644 (file)
@@ -195,7 +195,7 @@ struct ctdb_call_state {
        void *fetch_private;
        struct {
                void (*fn)(struct ctdb_call_state *);
-               void *private;
+               void *private_data;
        } async;
 };
 
index 50cde530f02ab840ecd914757faeddc342bfb4cd..a34cd9736da4a16e73f1fa9b2a078d70fa8ceedb 100644 (file)
@@ -46,8 +46,8 @@ struct ctdb_tcp_node {
 int ctdb_tcp_queue_pkt(struct ctdb_node *node, uint8_t *data, uint32_t length);
 int ctdb_tcp_listen(struct ctdb_context *ctdb);
 void ctdb_tcp_node_connect(struct event_context *ev, struct timed_event *te, 
-                          struct timeval t, void *private);
+                          struct timeval t, void *private_data);
 void ctdb_tcp_read_cb(uint8_t *data, size_t cnt, void *args);
-void ctdb_tcp_tnode_cb(uint8_t *data, size_t cnt, void *private);
+void ctdb_tcp_tnode_cb(uint8_t *data, size_t cnt, void *private_data);
 
 #define CTDB_TCP_ALIGNMENT 8
index a6f562e2377f31ed5c2d5d0b862cc6b22756f099..a1f2d331cff09f5f6df8c288662ff359952d2bc2 100644 (file)
@@ -37,9 +37,9 @@ static void set_nonblocking(int fd)
 /*
   called when a complete packet has come in - should not happen on this socket
  */
-void ctdb_tcp_tnode_cb(uint8_t *data, size_t cnt, void *private)
+void ctdb_tcp_tnode_cb(uint8_t *data, size_t cnt, void *private_data)
 {
-       struct ctdb_node *node = talloc_get_type(private, struct ctdb_node);
+       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);
 
@@ -171,7 +171,7 @@ static int ctdb_incoming_destructor(struct ctdb_incoming *in)
   node in our cluster
 */
 static void ctdb_listen_event(struct event_context *ev, struct fd_event *fde, 
-                             uint16_t flags, void *private)
+                             uint16_t flags, void *private_data)
 {
        struct ctdb_context *ctdb;
        struct ctdb_tcp *ctcp;
@@ -180,7 +180,7 @@ static void ctdb_listen_event(struct event_context *ev, struct fd_event *fde,
        int fd;
        struct ctdb_incoming *in;
 
-       ctdb = talloc_get_type(private, struct ctdb_context);
+       ctdb = talloc_get_type(private_data, struct ctdb_context);
        ctcp = talloc_get_type(ctdb->private_data, struct ctdb_tcp);
        memset(&addr, 0, sizeof(addr));
        len = sizeof(addr);
index 658a2e4dadde095c8e2d3870ed0e32a284364d75..78d66f6f2cc2af8a2e65c1479aa767ec42d9a792 100644 (file)
@@ -130,10 +130,10 @@ static int msg_plus, msg_minus;
   handler for messages in bench_ring()
 */
 static void ring_message_handler(struct ctdb_context *ctdb, uint32_t srvid, 
-                                TDB_DATA data, void *private)
+                                TDB_DATA data, void *private_data)
 {
        int incr = *(int *)data.dptr;
-       int *count = (int *)private;
+       int *count = (int *)private_data;
        int dest;
        (*count)++;
        dest = (ctdb_get_vnn(ctdb) + incr) % ctdb_get_num_nodes(ctdb);
index eb2f25b9c4b67e40bd3df6a2faca38766e074005..45e5248980045aa9dec5e6a38cc09a350e3c6bf2 100644 (file)
@@ -106,7 +106,7 @@ static void bench_fetch_1node(struct ctdb_context *ctdb)
   handler for messages in bench_ring()
 */
 static void message_handler(struct ctdb_context *ctdb, uint32_t srvid, 
-                           TDB_DATA data, void *private)
+                           TDB_DATA data, void *private_data)
 {
        msg_count++;
        bench_fetch_1node(ctdb);
index 4e5bf63b6050047982298263af18b480aa61674f..f9c1b379b6a77f5af1da757e01f01cbabd9743a9 100644 (file)
@@ -25,7 +25,7 @@
 
 
 static void message_handler(struct ctdb_context *ctdb, uint32_t srvid, 
-                           TDB_DATA data, void *private)
+                           TDB_DATA data, void *private_data)
 {
 printf("received a message\n");
 }
index 0fa6bf66d2d1470ab60f603075507991d2691c8a..050f14de380e9cd187963027415da017c0ec4340 100644 (file)
@@ -34,7 +34,7 @@ static int num_clients = 2;
   handler for messages in bench_ring()
 */
 static void message_handler(struct ctdb_context *ctdb, uint32_t srvid, 
-                                TDB_DATA data, void *private)
+                                TDB_DATA data, void *private_data)
 {
        printf("client vnn:%d received a message to srvid:%d [%s]\n",ctdb_get_vnn(ctdb),srvid,data.dptr);
        fflush(stdout);