summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Rockai <prockai@redhat.com>2014-10-01 08:17:59 +0200
committerPetr Rockai <prockai@redhat.com>2015-02-05 13:50:34 +0100
commit2a8dc7fb538595ffecee53298a38a284f8df89c0 (patch)
treead072ef9e3f536a3e0cf6b4b0a1ef1c46113c24c
parentd571eab3b2bbb9be80e75e633bf2e30834975552 (diff)
downloadlvm2-2a8dc7fb538595ffecee53298a38a284f8df89c0.tar.gz
memlock: Do not check memory balance if RUNNING_ON_VALGRIND.
-rw-r--r--lib/mm/memlock.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/mm/memlock.c b/lib/mm/memlock.c
index c5358dc1f..2327d4cd3 100644
--- a/lib/mm/memlock.c
+++ b/lib/mm/memlock.c
@@ -27,6 +27,10 @@
#include <sys/resource.h>
#include <malloc.h>
+#ifdef HAVE_VALGRIND
+#include <valgrind.h>
+#endif
+
#ifndef DEVMAPPER_SUPPORT
void memlock_inc_daemon(struct cmd_context *cmd)
@@ -254,12 +258,13 @@ static int _maps_line(const struct dm_config_node *cn, lvmlock_t lock,
}
}
-#ifdef VALGRIND_POOL
+#ifdef HAVE_VALGRIND
/*
* Valgrind is continually eating memory while executing code
* so we need to deactivate check of locked memory size
*/
- sz -= sz; /* = 0, but avoids getting warning about dead assigment */
+ if (RUNNING_ON_VALGRIND)
+ sz -= sz; /* = 0, but avoids getting warning about dead assigment */
#endif
*mstats += sz;