summaryrefslogtreecommitdiffstats
path: root/ctdb
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2014-06-06 15:08:22 +1000
committerMartin Schwenke <martins@samba.org>2014-06-12 05:40:10 +0200
commit22f71579a46203236bb6ec7e5bef3b2151700898 (patch)
treece2d7c262145871e1665e5269433956559718ea2 /ctdb
parente11483012460fd3654bd0a3640755f581d3fecf4 (diff)
downloadsamba-22f71579a46203236bb6ec7e5bef3b2151700898.tar.gz
samba-22f71579a46203236bb6ec7e5bef3b2151700898.tar.xz
samba-22f71579a46203236bb6ec7e5bef3b2151700898.zip
ctdb-daemon: Instead of passing ctdb context, pass valgrinding boolean
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/common/ctdb_util.c4
-rw-r--r--ctdb/include/ctdb_private.h2
-rw-r--r--ctdb/server/ctdb_daemon.c4
-rw-r--r--ctdb/server/ctdb_ltdb_server.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/ctdb/common/ctdb_util.c b/ctdb/common/ctdb_util.c
index cd7b4d70498..bbaa5ae2187 100644
--- a/ctdb/common/ctdb_util.c
+++ b/ctdb/common/ctdb_util.c
@@ -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;
}
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h
index 3d17d3926e9..edba45be804 100644
--- a/ctdb/include/ctdb_private.h
+++ b/ctdb/include/ctdb_private.h
@@ -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;
diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c
index e4fe4b4a3ba..614ed6bd7e6 100644
--- a/ctdb/server/ctdb_daemon.c
+++ b/ctdb/server/ctdb_daemon.c
@@ -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);
diff --git a/ctdb/server/ctdb_ltdb_server.c b/ctdb/server/ctdb_ltdb_server.c
index 6ff92c54e31..b9445cdaaad 100644
--- a/ctdb/server/ctdb_ltdb_server.c
+++ b/ctdb/server/ctdb_ltdb_server.c
@@ -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,