Allow tests to use get_max_node().
Signed-off-by: Jan Stancek <[email protected]>
---
testcases/kernel/include/numa_helper.h | 1 +
testcases/kernel/lib/numa_helper.c | 6 ++++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/include/numa_helper.h
b/testcases/kernel/include/numa_helper.h
index 463019a..0be7a28 100644
--- a/testcases/kernel/include/numa_helper.h
+++ b/testcases/kernel/include/numa_helper.h
@@ -30,6 +30,7 @@
#define NH_MEMS (1 << 0)
#define NH_CPUS (1 << 1)
+unsigned long get_max_node();
int get_allowed_nodes_arr(int flag, int *num_nodes, int **nodes);
int get_allowed_nodes(int flag, int count, ...);
void nh_dump_nodes();
diff --git a/testcases/kernel/lib/numa_helper.c
b/testcases/kernel/lib/numa_helper.c
index aa98522..32d81a9 100644
--- a/testcases/kernel/lib/numa_helper.c
+++ b/testcases/kernel/lib/numa_helper.c
@@ -37,10 +37,10 @@
#include "numa_helper.h"
#include "linux_syscall_numbers.h"
-#if HAVE_NUMA_H
-static unsigned long get_max_node()
+unsigned long get_max_node()
{
unsigned long max_node = 0;
+#if HAVE_NUMA_H
#if !defined(LIBNUMA_API_VERSION) || LIBNUMA_API_VERSION < 2
max_node = NUMA_NUM_NODES;
/*
@@ -53,9 +53,11 @@ static unsigned long get_max_node()
#else
max_node = numa_max_possible_node() + 1;
#endif
+#endif /* HAVE_NUMA_H */
return max_node;
}
+#if HAVE_NUMA_H
static void get_nodemask_allnodes(nodemask_t *nodemask,
unsigned long max_node)
{
--
1.7.1
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list