summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2013-08-16 20:10:10 +1000
committerAmitay Isaacs <amitay@gmail.com>2013-09-19 12:54:30 +1000
commit4c3f8dc3bbafeaedbbc60e83aacb36df20337ae4 (patch)
tree91c26b088fc06f785f1cda143371d5d40ee655e2
parentc503997746d74c50a6f1e92ad1210fb9c536149f (diff)
downloadsamba-4c3f8dc3bbafeaedbbc60e83aacb36df20337ae4.tar.gz
samba-4c3f8dc3bbafeaedbbc60e83aacb36df20337ae4.tar.xz
samba-4c3f8dc3bbafeaedbbc60e83aacb36df20337ae4.zip
recoverd: Make the SRVID request structure generic
No need for a separate one for each SRVID. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d9c22b04d5aa7938a3965bd3144568664eb772ce)
-rw-r--r--ctdb/include/ctdb_private.h13
-rw-r--r--ctdb/server/ctdb_monitor.c2
-rw-r--r--ctdb/server/ctdb_recoverd.c18
-rw-r--r--ctdb/tools/ctdb.c5
4 files changed, 16 insertions, 22 deletions
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h
index 987502ef008..d300d896551 100644
--- a/ctdb/include/ctdb_private.h
+++ b/ctdb/include/ctdb_private.h
@@ -24,19 +24,12 @@
#include <sys/socket.h>
/*
- recovery daemon memdump reply address
+ * Structure to support SRVID requests and replies
*/
-struct rd_memdump_reply {
- uint32_t pnn;
- uint64_t srvid;
-};
-
-/*
- description for a TAKEOVER_RUN message reply address
- */
-struct takeover_run_reply {
+struct srvid_request {
uint32_t pnn;
uint64_t srvid;
+ uint32_t data;
};
/*
diff --git a/ctdb/server/ctdb_monitor.c b/ctdb/server/ctdb_monitor.c
index c23477d1641..acd68c834da 100644
--- a/ctdb/server/ctdb_monitor.c
+++ b/ctdb/server/ctdb_monitor.c
@@ -113,7 +113,7 @@ static void ctdb_health_callback(struct ctdb_context *ctdb, int status, void *p)
uint32_t next_interval;
int ret;
TDB_DATA rddata;
- struct takeover_run_reply rd;
+ struct srvid_request rd;
const char *state_str = NULL;
c.pnn = ctdb->pnn;
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index 2d01e050ab8..ef80defa891 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -40,7 +40,7 @@ struct reloadips_all_reply *reload_all_ips_request = NULL;
*/
struct ip_reallocate_list {
struct ip_reallocate_list *next;
- struct rd_memdump_reply *rd;
+ struct srvid_request *rd;
};
struct ctdb_banning_state {
@@ -2162,14 +2162,14 @@ static void mem_dump_handler(struct ctdb_context *ctdb, uint64_t srvid,
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
TDB_DATA *dump;
int ret;
- struct rd_memdump_reply *rd;
+ struct srvid_request *rd;
- if (data.dsize != sizeof(struct rd_memdump_reply)) {
+ if (data.dsize != sizeof(struct srvid_request)) {
DEBUG(DEBUG_ERR, (__location__ " Wrong size of return address.\n"));
talloc_free(tmp_ctx);
return;
}
- rd = (struct rd_memdump_reply *)data.dptr;
+ rd = (struct srvid_request *)data.dptr;
dump = talloc_zero(tmp_ctx, TDB_DATA);
if (dump == NULL) {
@@ -2441,9 +2441,9 @@ reload_all_ips(struct ctdb_context *ctdb, struct ctdb_recoverd *rec, struct ctdb
/*
- handler for ip reallocate, just add it to the list of callers and
+ handler for ip reallocate, just add it to the list of requests and
handle this later in the monitor_cluster loop so we do not recurse
- with other callers to takeover_run()
+ with other requests to takeover_run()
*/
static void ip_reallocate_handler(struct ctdb_context *ctdb, uint64_t srvid,
TDB_DATA data, void *private_data)
@@ -2451,7 +2451,7 @@ static void ip_reallocate_handler(struct ctdb_context *ctdb, uint64_t srvid,
struct ctdb_recoverd *rec = talloc_get_type(private_data, struct ctdb_recoverd);
struct ip_reallocate_list *caller;
- if (data.dsize != sizeof(struct rd_memdump_reply)) {
+ if (data.dsize != sizeof(struct srvid_request)) {
DEBUG(DEBUG_ERR, (__location__ " Wrong size of return address.\n"));
return;
}
@@ -2464,7 +2464,7 @@ static void ip_reallocate_handler(struct ctdb_context *ctdb, uint64_t srvid,
caller = talloc(rec->ip_reallocate_ctx, struct ip_reallocate_list);
CTDB_NO_MEMORY_FATAL(ctdb, caller);
- caller->rd = (struct rd_memdump_reply *)talloc_steal(caller, data.dptr);
+ caller->rd = (struct srvid_request *)talloc_steal(caller, data.dptr);
caller->next = rec->reallocate_callers;
rec->reallocate_callers = caller;
@@ -3112,7 +3112,7 @@ static int verify_local_ip_allocation(struct ctdb_context *ctdb, struct ctdb_rec
}
if (need_takeover_run) {
- struct takeover_run_reply rd;
+ struct srvid_request rd;
TDB_DATA data;
DEBUG(DEBUG_CRIT,("Trigger takeoverrun\n"));
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index 6ca340770fb..db4b1d31f23 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -2005,7 +2005,7 @@ static int ipreallocate(struct ctdb_context *ctdb)
{
int ret;
TDB_DATA data;
- struct takeover_run_reply rd;
+ struct srvid_request rd;
struct timeval tv;
/* Time ticks to enable timeouts to be processed */
@@ -2015,6 +2015,7 @@ static int ipreallocate(struct ctdb_context *ctdb)
rd.pnn = ctdb_get_pnn(ctdb);
rd.srvid = getpid();
+ rd.data = 0;
/* Register message port for reply from recovery master */
ctdb_client_set_message_handler(ctdb, rd.srvid, ip_reallocate_handler, NULL);
@@ -5713,7 +5714,7 @@ static int control_rddumpmemory(struct ctdb_context *ctdb, int argc, const char
{
int ret;
TDB_DATA data;
- struct rd_memdump_reply rd;
+ struct srvid_request rd;
rd.pnn = ctdb_get_pnn(ctdb);
rd.srvid = getpid();