aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/nodemask.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/nodemask.h')
-rw-r--r--include/linux/nodemask.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index b359c4a9ec9e..ca9b489a27f8 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -481,14 +481,14 @@ static inline int num_node_state(enum node_states state)
481 481
482/* 482/*
483 * For nodemask scrach area.(See CPUMASK_ALLOC() in cpumask.h) 483 * For nodemask scrach area.(See CPUMASK_ALLOC() in cpumask.h)
484 * NODEMASK_ALLOC(x, m) allocates an object of type 'x' with the name 'm'.
484 */ 485 */
485
486#if NODES_SHIFT > 8 /* nodemask_t > 64 bytes */ 486#if NODES_SHIFT > 8 /* nodemask_t > 64 bytes */
487#define NODEMASK_ALLOC(x, m) struct x *m = kmalloc(sizeof(*m), GFP_KERNEL) 487#define NODEMASK_ALLOC(x, m) x *m = kmalloc(sizeof(*m), GFP_KERNEL)
488#define NODEMASK_FREE(m) kfree(m) 488#define NODEMASK_FREE(m) kfree(m)
489#else 489#else
490#define NODEMASK_ALLOC(x, m) struct x _m, *m = &_m 490#define NODEMASK_ALLOC(x, m) x _m, *m = &_m
491#define NODEMASK_FREE(m) 491#define NODEMASK_FREE(m) do {} while (0)
492#endif 492#endif
493 493
494/* A example struture for using NODEMASK_ALLOC, used in mempolicy. */ 494/* A example struture for using NODEMASK_ALLOC, used in mempolicy. */
@@ -497,8 +497,9 @@ struct nodemask_scratch {
497 nodemask_t mask2; 497 nodemask_t mask2;
498}; 498};
499 499
500#define NODEMASK_SCRATCH(x) NODEMASK_ALLOC(nodemask_scratch, x) 500#define NODEMASK_SCRATCH(x) \
501#define NODEMASK_SCRATCH_FREE(x) NODEMASK_FREE(x) 501 NODEMASK_ALLOC(struct nodemask_scratch, x)
502#define NODEMASK_SCRATCH_FREE(x) NODEMASK_FREE(x)
502 503
503 504
504#endif /* __LINUX_NODEMASK_H */ 505#endif /* __LINUX_NODEMASK_H */