summaryrefslogtreecommitdiff
path: root/lib/mm/memlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mm/memlock.c')
-rw-r--r--lib/mm/memlock.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/mm/memlock.c b/lib/mm/memlock.c
index c5358dc1f..60686ea5f 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,15 @@ 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 */
+ */
+#ifndef VALGRIND_POOL
+ if (RUNNING_ON_VALGRIND)
+#endif
+ sz -= sz; /* = 0, but avoids getting warning about dead assigment */
#endif
*mstats += sz;
@@ -340,7 +347,7 @@ static int _memlock_maps(struct cmd_context *cmd, lvmlock_t lock, size_t *mstats
}
line = _maps_buffer;
- cn = find_config_tree_node(cmd, activation_mlock_filter_CFG, NULL);
+ cn = find_config_tree_array(cmd, activation_mlock_filter_CFG, NULL);
while ((line_end = strchr(line, '\n'))) {
*line_end = '\0'; /* remove \n */