diff options
author | Martin Schwenke <martin@meltin.net> | 2016-05-29 19:27:23 +1000 |
---|---|---|
committer | Martin Schwenke <martins@samba.org> | 2016-06-08 00:51:28 +0200 |
commit | 5c4744e69d81fd5d2a06de6bf42c5beaf7aac57b (patch) | |
tree | 9f0dc0014a0a9827bf5ea0b19dad576e74b34fbd | |
parent | 58be187de02d3c24d2666b91990f9cd2a14f0b7f (diff) | |
download | samba-5c4744e69d81fd5d2a06de6bf42c5beaf7aac57b.tar.gz |
ctdb-cluster-mutex: Pass a talloc context to allocate the handle off
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
-rw-r--r-- | ctdb/server/ctdb_cluster_mutex.c | 5 | ||||
-rw-r--r-- | ctdb/server/ctdb_cluster_mutex.h | 5 | ||||
-rw-r--r-- | ctdb/server/ctdb_recover.c | 2 | ||||
-rw-r--r-- | ctdb/server/ctdb_recoverd.c | 2 |
4 files changed, 9 insertions, 5 deletions
diff --git a/ctdb/server/ctdb_cluster_mutex.c b/ctdb/server/ctdb_cluster_mutex.c index 8e9d1793c84..c8eaae90916 100644 --- a/ctdb/server/ctdb_cluster_mutex.c +++ b/ctdb/server/ctdb_cluster_mutex.c @@ -184,7 +184,8 @@ static bool cluster_mutex_helper_args(TALLOC_CTX *mem_ctx, } struct ctdb_cluster_mutex_handle * -ctdb_cluster_mutex(struct ctdb_context *ctdb, +ctdb_cluster_mutex(TALLOC_CTX *mem_ctx, + struct ctdb_context *ctdb, const char *argstring, int timeout) { @@ -192,7 +193,7 @@ ctdb_cluster_mutex(struct ctdb_context *ctdb, char **args; int ret; - h = talloc(ctdb, struct ctdb_cluster_mutex_handle); + h = talloc(mem_ctx, struct ctdb_cluster_mutex_handle); if (h == NULL) { DEBUG(DEBUG_ERR, (__location__ " out of memory\n")); return NULL; diff --git a/ctdb/server/ctdb_cluster_mutex.h b/ctdb/server/ctdb_cluster_mutex.h index 9131eb31d0f..e76fdc7834f 100644 --- a/ctdb/server/ctdb_cluster_mutex.h +++ b/ctdb/server/ctdb_cluster_mutex.h @@ -22,6 +22,8 @@ #ifndef __CTDB_CLUSTER_MUTEX_H__ #define __CTDB_CLUSTER_MUTEX_H__ +#include <talloc.h> + #include "replace.h" #include "system/network.h" @@ -41,7 +43,8 @@ void ctdb_cluster_mutex_set_handler(struct ctdb_cluster_mutex_handle *h, void *private_data); struct ctdb_cluster_mutex_handle * -ctdb_cluster_mutex(struct ctdb_context *ctdb, +ctdb_cluster_mutex(TALLOC_CTX *mem_ctx, + struct ctdb_context *ctdb, const char *argstring, int timeout); diff --git a/ctdb/server/ctdb_recover.c b/ctdb/server/ctdb_recover.c index 7d0188c7e35..2f5e570dd0a 100644 --- a/ctdb/server/ctdb_recover.c +++ b/ctdb/server/ctdb_recover.c @@ -908,7 +908,7 @@ int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb, return 0; } - h = ctdb_cluster_mutex(ctdb, ctdb->recovery_lock, 5); + h = ctdb_cluster_mutex(ctdb, ctdb, ctdb->recovery_lock, 5); if (h == NULL) { return -1; } diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index 91428e2a46b..3b437bf1304 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -1590,7 +1590,7 @@ static bool ctdb_recovery_lock(struct ctdb_context *ctdb) .locked = false, }; - h = ctdb_cluster_mutex(ctdb, ctdb->recovery_lock, 0); + h = ctdb_cluster_mutex(ctdb, ctdb, ctdb->recovery_lock, 0); if (h == NULL) { return false; } |