diff options
author | Lee Schermerhorn <lee.schermerhorn@hp.com> | 2009-12-14 20:58:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-15 11:53:12 -0500 |
commit | c1e6c8d074ea3621106548654cc244d2edc12ead (patch) | |
tree | 0b16357dc7d15ba8f1c4d9d295873b9528b5d397 /include/linux/nodemask.h | |
parent | 6ae11b278bca1cd41651bae49a8c69de2f6a6262 (diff) |
hugetlb: factor init_nodemask_of_node()
Factor init_nodemask_of_node() out of the nodemask_of_node() macro.
This will be used to populate the huge pages "nodes_allowed" nodemask for
a single node when basing nodes_allowed on a preferred/local mempolicy or
when a persistent huge page pool page count is modified via a per node
sysfs attribute.
Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Reviewed-by: Andi Kleen <andi@firstfloor.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Nishanth Aravamudan <nacc@us.ibm.com>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Adam Litke <agl@us.ibm.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Eric Whitney <eric.whitney@hp.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/nodemask.h')
-rw-r--r-- | include/linux/nodemask.h | 11 |
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 | ||
248 | static 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 | }) |