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
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list