]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-cluster-mutex: Pass a talloc context to allocate the handle off
authorMartin Schwenke <martin@meltin.net>
Sun, 29 May 2016 09:27:23 +0000 (19:27 +1000)
committerMartin Schwenke <martins@samba.org>
Tue, 7 Jun 2016 22:51:28 +0000 (00:51 +0200)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_cluster_mutex.c
ctdb/server/ctdb_cluster_mutex.h
ctdb/server/ctdb_recover.c
ctdb/server/ctdb_recoverd.c

index 8e9d1793c8414d4f2a2db2ecfa0ca7d7111c4426..c8eaae909166412eb1eb9291bdd07af880e1aba5 100644 (file)
@@ -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;
index 9131eb31d0f56541e334f2320de10c0dacda215e..e76fdc7834f171bd8de0aa9004d33d98e8d68899 100644 (file)
@@ -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);
 
index 7d0188c7e3553310e7a82a59c35a737bbce59682..2f5e570dd0ad88959f6084d2d8e5e9e99db6dfac 100644 (file)
@@ -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;
        }
index 91428e2a46b7070d4ef3e328b6d31521a025c403..3b437bf1304d4f6195065a29f016eb827d4c184b 100644 (file)
@@ -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;
        }