diff options
author | Amitay Isaacs <amitay@gmail.com> | 2017-04-21 17:18:49 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2017-05-24 17:03:28 +0200 |
commit | 9ec302bfad6abcbb1d6dfc759fa607757360ba66 (patch) | |
tree | 7528392ab0720d6ad243f408b09dcdd46058545d /ctdb | |
parent | 075613489cbcc024c0f9269b68c32db9213650b2 (diff) | |
download | samba-9ec302bfad6abcbb1d6dfc759fa607757360ba66.tar.gz |
ctdb-keepalive: Move ctdb_send_keepalive() to ctdb_keepalive.c
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb')
-rw-r--r-- | ctdb/include/ctdb_private.h | 2 | ||||
-rw-r--r-- | ctdb/server/ctdb_call.c | 28 | ||||
-rw-r--r-- | ctdb/server/ctdb_keepalive.c | 27 |
3 files changed, 27 insertions, 30 deletions
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index 91e98857a15..7d16c425881 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -511,8 +511,6 @@ struct ctdb_call_state *ctdb_daemon_call_send_remote( int ctdb_daemon_call_recv(struct ctdb_call_state *state, struct ctdb_call *call); -void ctdb_send_keepalive(struct ctdb_context *ctdb, uint32_t destnode); - int ctdb_start_revoke_ro_record(struct ctdb_context *ctdb, struct ctdb_db_context *ctdb_db, TDB_DATA key, struct ctdb_ltdb_header *header, diff --git a/ctdb/server/ctdb_call.c b/ctdb/server/ctdb_call.c index fa82b49b556..c6bff4954ca 100644 --- a/ctdb/server/ctdb_call.c +++ b/ctdb/server/ctdb_call.c @@ -1542,34 +1542,6 @@ int ctdb_daemon_call_recv(struct ctdb_call_state *state, struct ctdb_call *call) } -/* - send a keepalive packet to the other node -*/ -void ctdb_send_keepalive(struct ctdb_context *ctdb, uint32_t destnode) -{ - struct ctdb_req_keepalive_old *r; - - if (ctdb->methods == NULL) { - DEBUG(DEBUG_INFO,(__location__ " Failed to send keepalive. Transport is DOWN\n")); - return; - } - - r = ctdb_transport_allocate(ctdb, ctdb, CTDB_REQ_KEEPALIVE, - sizeof(struct ctdb_req_keepalive_old), - struct ctdb_req_keepalive_old); - CTDB_NO_MEMORY_FATAL(ctdb, r); - r->hdr.destnode = destnode; - r->hdr.reqid = 0; - - CTDB_INCREMENT_STAT(ctdb, keepalive_packets_sent); - - ctdb_queue_packet(ctdb, &r->hdr); - - talloc_free(r); -} - - - struct revokechild_deferred_call { struct revokechild_deferred_call *prev, *next; struct ctdb_context *ctdb; diff --git a/ctdb/server/ctdb_keepalive.c b/ctdb/server/ctdb_keepalive.c index a8acded6946..5562bffd8ba 100644 --- a/ctdb/server/ctdb_keepalive.c +++ b/ctdb/server/ctdb_keepalive.c @@ -37,6 +37,33 @@ /* + send a keepalive packet to the other node +*/ +static void ctdb_send_keepalive(struct ctdb_context *ctdb, uint32_t destnode) +{ + struct ctdb_req_keepalive_old *r; + + if (ctdb->methods == NULL) { + DEBUG(DEBUG_INFO, + ("Failed to send keepalive. Transport is DOWN\n")); + return; + } + + r = ctdb_transport_allocate(ctdb, ctdb, CTDB_REQ_KEEPALIVE, + sizeof(struct ctdb_req_keepalive_old), + struct ctdb_req_keepalive_old); + CTDB_NO_MEMORY_FATAL(ctdb, r); + r->hdr.destnode = destnode; + r->hdr.reqid = 0; + + CTDB_INCREMENT_STAT(ctdb, keepalive_packets_sent); + + ctdb_queue_packet(ctdb, &r->hdr); + + talloc_free(r); +} + +/* see if any nodes are dead */ static void ctdb_check_for_dead_nodes(struct tevent_context *ev, |