]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
change ctdb_get_vnn to ctdb_get_pnn
authorRonnie Sahlberg <sahlberg@ronnie>
Tue, 4 Sep 2007 00:18:44 +0000 (10:18 +1000)
committerRonnie Sahlberg <sahlberg@ronnie>
Tue, 4 Sep 2007 00:18:44 +0000 (10:18 +1000)
(This used to be ctdb commit 1e19930198c2bcc7ccb755e0ee51555fb823029a)

ctdb/client/ctdb_client.c
ctdb/include/ctdb.h
ctdb/server/ctdb_daemon.c
ctdb/server/ctdb_recoverd.c
ctdb/tests/ctdb_bench.c
ctdb/tests/ctdb_fetch.c
ctdb/tests/ctdb_store.c

index 05f5eb1e2deaf1889281e9f072fe30173afcde8f..a49e64d484dac8d92cd1833781109b4f6c616c7d 100644 (file)
@@ -2474,9 +2474,9 @@ int ctdb_set_socketname(struct ctdb_context *ctdb, const char *socketname)
 }
 
 /*
-  return the vnn of this node
+  return the pnn of this node
 */
-uint32_t ctdb_get_vnn(struct ctdb_context *ctdb)
+uint32_t ctdb_get_pnn(struct ctdb_context *ctdb)
 {
        return ctdb->pnn;
 }
index 133b667cc93001c47bac1dd1b474bc44a7b6b994..64534e81a52a16dacd6b4fe9ea57d3c1afdaac7e 100644 (file)
@@ -201,8 +201,8 @@ int ctdb_call(struct ctdb_db_context *ctdb_db, struct ctdb_call *call);
 */
 void ctdb_shutdown(struct ctdb_context *ctdb);
 
-/* return vnn of this node */
-uint32_t ctdb_get_vnn(struct ctdb_context *ctdb);
+/* return pnn of this node */
+uint32_t ctdb_get_pnn(struct ctdb_context *ctdb);
 
 /*
   return the number of nodes
index 0112fd61d11da8b5d68d86cdb28a18a5220531e9..a49f0245935da4e7251c9e871ba545fc7a90bc7a 100644 (file)
@@ -262,7 +262,7 @@ static void daemon_request_message_from_client(struct ctdb_client *client,
        int res;
 
        /* maybe the message is for another client on this node */
-       if (ctdb_get_vnn(client->ctdb)==c->hdr.destnode) {
+       if (ctdb_get_pnn(client->ctdb)==c->hdr.destnode) {
                ctdb_request_message(client->ctdb, (struct ctdb_req_header *)c);
                return;
        }
index e687fe81048bba79eda37b7b2635d57cdcb17c71..f682cfc4f52a7a5c000b5a9b4a7dc2adef11be46 100644 (file)
@@ -1078,7 +1078,7 @@ static void election_handler(struct ctdb_context *ctdb, uint64_t srvid,
           send a new election message to all other nodes
         */
        if (ctdb_election_win(rec, em)) {
-               ret = send_election_request(rec, mem_ctx, ctdb_get_vnn(ctdb));
+               ret = send_election_request(rec, mem_ctx, ctdb_get_pnn(ctdb));
                if (ret!=0) {
                        DEBUG(0, (__location__ " failed to initiate recmaster election"));
                }
@@ -1096,7 +1096,7 @@ static void election_handler(struct ctdb_context *ctdb, uint64_t srvid,
        }
 
        /* ok, let that guy become recmaster then */
-       ret = ctdb_ctrl_setrecmaster(ctdb, CONTROL_TIMEOUT(), ctdb_get_vnn(ctdb), em->vnn);
+       ret = ctdb_ctrl_setrecmaster(ctdb, CONTROL_TIMEOUT(), ctdb_get_pnn(ctdb), em->vnn);
        if (ret != 0) {
                DEBUG(0, (__location__ " failed to send recmaster election request"));
                talloc_free(mem_ctx);
index e020c1b62f27862917b82c6eb1e8fd8cfc1f3e57..1eefe9ca4f4cab18e76fb802a484c55c474aa832 100644 (file)
@@ -90,7 +90,7 @@ static void ring_message_handler(struct ctdb_context *ctdb, uint64_t srvid,
        int *count = (int *)private_data;
        int dest;
        (*count)++;
-       dest = (ctdb_get_vnn(ctdb) + incr) % num_nodes;
+       dest = (ctdb_get_pnn(ctdb) + incr) % num_nodes;
        ctdb_send_message(ctdb, dest, srvid, data);
        if (incr == 1) {
                msg_plus++;
@@ -104,9 +104,9 @@ static void ring_message_handler(struct ctdb_context *ctdb, uint64_t srvid,
 */
 static void bench_ring(struct ctdb_context *ctdb, struct event_context *ev)
 {
-       int vnn=ctdb_get_vnn(ctdb);
+       int pnn=ctdb_get_pnn(ctdb);
 
-       if (vnn == 0) {
+       if (pnn == 0) {
                /* two messages are injected into the ring, moving
                   in opposite directions */
                int dest, incr;
@@ -116,18 +116,18 @@ static void bench_ring(struct ctdb_context *ctdb, struct event_context *ev)
                data.dsize = sizeof(incr);
 
                incr = 1;
-               dest = (ctdb_get_vnn(ctdb) + incr) % num_nodes;
+               dest = (ctdb_get_pnn(ctdb) + incr) % num_nodes;
                ctdb_send_message(ctdb, dest, 0, data);
                
                incr = -1;
-               dest = (ctdb_get_vnn(ctdb) + incr) % num_nodes;
+               dest = (ctdb_get_pnn(ctdb) + incr) % num_nodes;
                ctdb_send_message(ctdb, dest, 0, data);
        }
        
        start_timer();
 
        while (end_timer() < timelimit) {
-               if (vnn == 0 && msg_count % 10000 == 0) {
+               if (pnn == 0 && msg_count % 10000 == 0) {
                        printf("Ring: %.2f msgs/sec (+ve=%d -ve=%d)\r", 
                               msg_count/end_timer(), msg_plus, msg_minus);
                        fflush(stdout);
index 0a6351f1fdfe1c692d354b419e051907c169216b..1ac87017beea0fc5910c8f7e16eed2bc00c19041 100644 (file)
@@ -69,7 +69,7 @@ static void bench_fetch_1node(struct ctdb_context *ctdb)
        h = ctdb_fetch_lock(ctdb_db, tmp_ctx, key, &data);
        if (h == NULL) {
                printf("Failed to fetch record '%s' on node %d\n", 
-                      (const char *)key.dptr, ctdb_get_vnn(ctdb));
+                      (const char *)key.dptr, ctdb_get_pnn(ctdb));
                talloc_free(tmp_ctx);
                return;
        }
@@ -83,7 +83,7 @@ static void bench_fetch_1node(struct ctdb_context *ctdb)
        }
        data.dptr = (uint8_t *)talloc_asprintf_append((char *)data.dptr, 
                                                      "msg_count=%d on node %d\n",
-                                                     msg_count, ctdb_get_vnn(ctdb));
+                                                     msg_count, ctdb_get_pnn(ctdb));
        data.dsize = strlen((const char *)data.dptr)+1;
 
        ret = ctdb_record_store(h, data);
@@ -98,7 +98,7 @@ static void bench_fetch_1node(struct ctdb_context *ctdb)
        nulldata.dptr = NULL;
        nulldata.dsize = 0;
 
-       dest = (ctdb_get_vnn(ctdb) + 1) % num_nodes;
+       dest = (ctdb_get_pnn(ctdb) + 1) % num_nodes;
        ctdb_send_message(ctdb, dest, 0, nulldata);
 }
 
@@ -123,16 +123,16 @@ static void message_handler(struct ctdb_context *ctdb, uint64_t srvid,
 */
 static void bench_fetch(struct ctdb_context *ctdb, struct event_context *ev)
 {
-       int vnn=ctdb_get_vnn(ctdb);
+       int pnn=ctdb_get_pnn(ctdb);
 
-       if (vnn == num_nodes - 1) {
+       if (pnn == num_nodes - 1) {
                bench_fetch_1node(ctdb);
        }
        
        start_timer();
 
        while (end_timer() < timelimit) {
-               if (vnn == 0 && msg_count % 100 == 0) {
+               if (pnn == 0 && msg_count % 100 == 0) {
                        printf("Fetch: %.2f msgs/sec\r", msg_count/end_timer());
                        fflush(stdout);
                }
index ea7721a34c26868dc4650c942408fdec64a9adaa..9d4b30c2a7fd5fbeef4b8d7a994e6c4efd6972df 100644 (file)
@@ -49,7 +49,7 @@ static void store_records(struct ctdb_context *ctdb, struct event_context *ev)
                h = ctdb_fetch_lock(ctdb_db, tmp_ctx, key, &data);
                if (h == NULL) {
                        printf("Failed to fetch record '%s' on node %d\n", 
-                              (const char *)key.dptr, ctdb_get_vnn(ctdb));
+                              (const char *)key.dptr, ctdb_get_pnn(ctdb));
                        talloc_free(tmp_ctx);
                        return;
                }
@@ -77,7 +77,7 @@ static void store_records(struct ctdb_context *ctdb, struct event_context *ev)
                        h = ctdb_fetch_lock(ctdb_db, tmp_ctx, key, &data);
                        if (h == NULL) {
                                printf("Failed to fetch record '%s' on node %d\n", 
-                                      (const char *)key.dptr, ctdb_get_vnn(ctdb));
+                                      (const char *)key.dptr, ctdb_get_pnn(ctdb));
                                talloc_free(tmp_ctx);
                                return;
                        }