[PATCH] add numa_random() stub for non-NUMA build

Lee Schermerhorn <[email protected]>
Newsgroups org.kernel.vger.linux-numa,org.kvack.linux-mm
Message-ID <[email protected]>
Against 2.6.34-rc7-mmotm-100514-1333:

Define stub numa_random() for !NUMA configuration.

Signed-off-by: Lee Schermerhorn <[email protected]>

 include/linux/nodemask.h |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

Index: linux-2.6.34-rc7-mmotm-100514-1333/include/linux/nodemask.h
===================================================================
--- linux-2.6.34-rc7-mmotm-100514-1333.orig/include/linux/nodemask.h	2010-05-17 08:40:39.000000000 -0400
+++ linux-2.6.34-rc7-mmotm-100514-1333/include/linux/nodemask.h	2010-05-17 16:37:18.000000000 -0400
@@ -269,9 +269,6 @@ static inline int __first_unset_node(con
 			find_first_zero_bit(maskp->bits, MAX_NUMNODES));
 }
 
-#define node_random(mask) __node_random(&(mask))
-extern int __node_random(const nodemask_t *maskp);
-
 #define NODE_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(MAX_NUMNODES)
 
 #if MAX_NUMNODES <= BITS_PER_LONG
@@ -435,6 +432,10 @@ static inline void node_set_offline(int 
 	node_clear_state(nid, N_ONLINE);
 	nr_online_nodes = num_node_state(N_ONLINE);
 }
+
+#define node_random(mask) __node_random(&(mask))
+extern int __node_random(const nodemask_t *maskp);
+
 #else
 
 static inline int node_state(int node, enum node_states state)
@@ -465,6 +466,8 @@ static inline int num_node_state(enum no
 
 #define node_set_online(node)	   node_set_state((node), N_ONLINE)
 #define node_set_offline(node)	   node_clear_state((node), N_ONLINE)
+
+static inline int node_random(const nodemask_t mask) { return 0; }
 #endif
 
 #define node_online_map 	node_states[N_ONLINE]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.