ctdb-daemon: Instead of passing ctdb context, pass valgrinding boolean
authorAmitay Isaacs <amitay@gmail.com>
Fri, 6 Jun 2014 05:08:22 +0000 (15:08 +1000)
committerMartin Schwenke <martins@samba.org>
Thu, 12 Jun 2014 03:40:10 +0000 (05:40 +0200)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/common/ctdb_util.c
ctdb/include/ctdb_private.h
ctdb/server/ctdb_daemon.c
ctdb/server/ctdb_ltdb_server.c

index cd7b4d70498861b140f2f7b99ce03ee38b313e97..bbaa5ae21877217ea93ec41b8ffe1f2029c37e6b 100644 (file)
@@ -406,14 +406,14 @@ unsigned ctdb_addr_to_port(ctdb_sock_addr *addr)
 
 /* we don't lock future pages here; it would increase the chance that
  * we'd fail to mmap later on. */
-void ctdb_lockdown_memory(struct ctdb_context *ctdb)
+void ctdb_lockdown_memory(bool valgrinding)
 {
 #if defined(HAVE_MLOCKALL) && !defined(_AIX_)
        /* Extra stack, please! */
        char dummy[10000];
        memset(dummy, 0, sizeof(dummy));
 
-       if (ctdb->valgrinding) {
+       if (valgrinding) {
                return;
        }
 
index 3d17d3926e98974717f4fa8319ca9babf943e571..edba45be8046295acca912349735f5fba81c860d 100644 (file)
@@ -1370,7 +1370,7 @@ int ctdb_repack(struct ctdb_context *ctdb, int argc, const char **argv);
 int32_t ctdb_monitoring_mode(struct ctdb_context *ctdb);
 bool ctdb_stopped_monitoring(struct ctdb_context *ctdb);
 int ctdb_set_child_logging(struct ctdb_context *ctdb);
-void ctdb_lockdown_memory(struct ctdb_context *ctdb);
+void ctdb_lockdown_memory(bool valgrinding);
 
 struct client_async_data {
        enum ctdb_controls opcode;
index e4fe4b4a3ba57c556fc9e62515db92791ea77028..614ed6bd7e6835e6e3b582ffed4bf451a09d0df7 100644 (file)
@@ -1317,8 +1317,8 @@ int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork, bool use_syslog)
                exit(1);
        }
 
-       ctdb_lockdown_memory(ctdb);
-         
+       ctdb_lockdown_memory(ctdb->valgrinding);
+
        /* go into a wait loop to allow other nodes to complete */
        event_loop_wait(ctdb->ev);
 
index 6ff92c54e31d4dfe6d3c98fbb1b6cb6008a3f97a..b9445cdaaad5d9a2be1078309315f72156a6cb36 100644 (file)
@@ -1151,7 +1151,7 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
        outdata->dsize = sizeof(db->db_id);
 
        /* Try to ensure it's locked in mem */
-       ctdb_lockdown_memory(ctdb);
+       ctdb_lockdown_memory(ctdb->valgrinding);
 
        /* tell all the other nodes about this database */
        ctdb_daemon_send_control(ctdb, CTDB_BROADCAST_ALL, tdb_flags,