aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/nodemask.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index ca9b489a27f8..cbd521a03127 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -245,14 +245,19 @@ static inline int __next_node(int n, const nodemask_t *srcp)
245 return min_t(int,MAX_NUMNODES,find_next_bit(srcp->bits, MAX_NUMNODES, n+1)); 245 return min_t(int,MAX_NUMNODES,find_next_bit(srcp->bits, MAX_NUMNODES, n+1));
246} 246}
247 247
248static inline void init_nodemask_of_node(nodemask_t *mask, int node)
249{
250 nodes_clear(*mask);
251 node_set(node, *mask);
252}
253
248#define nodemask_of_node(node) \ 254#define nodemask_of_node(node) \
249({ \ 255({ \
250 typeof(_unused_nodemask_arg_) m; \ 256 typeof(_unused_nodemask_arg_) m; \
251 if (sizeof(m) == sizeof(unsigned long)) { \ 257 if (sizeof(m) == sizeof(unsigned long)) { \
252 m.bits[0] = 1UL<<(node); \ 258 m.bits[0] = 1UL << (node); \
253 } else { \ 259 } else { \
254 nodes_clear(m); \ 260 init_nodemask_of_node(&m, (node)); \
255 node_set((node), m); \
256 } \ 261 } \
257 m; \ 262 m; \
258}) 263})