aboutsummaryrefslogtreecommitdiffstats
path: root/lib/cpumask.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cpumask.c')
-rw-r--r--lib/cpumask.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/cpumask.c b/lib/cpumask.c
index 1f71b97de0f9..7bb4142a502f 100644
--- a/lib/cpumask.c
+++ b/lib/cpumask.c
@@ -92,15 +92,8 @@ int cpumask_any_but(const struct cpumask *mask, unsigned int cpu)
92 */ 92 */
93bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node) 93bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node)
94{ 94{
95 if (likely(slab_is_available())) 95 *mask = kmalloc_node(cpumask_size(), flags, node);
96 *mask = kmalloc_node(cpumask_size(), flags, node); 96
97 else {
98#ifdef CONFIG_DEBUG_PER_CPU_MAPS
99 printk(KERN_ERR
100 "=> alloc_cpumask_var: kmalloc not available!\n");
101#endif
102 *mask = NULL;
103 }
104#ifdef CONFIG_DEBUG_PER_CPU_MAPS 97#ifdef CONFIG_DEBUG_PER_CPU_MAPS
105 if (!*mask) { 98 if (!*mask) {
106 printk(KERN_ERR "=> alloc_cpumask_var: failed!\n"); 99 printk(KERN_ERR "=> alloc_cpumask_var: failed!\n");
@@ -119,6 +112,12 @@ bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node)
119} 112}
120EXPORT_SYMBOL(alloc_cpumask_var_node); 113EXPORT_SYMBOL(alloc_cpumask_var_node);
121 114
115bool zalloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node)
116{
117 return alloc_cpumask_var_node(mask, flags | __GFP_ZERO, node);
118}
119EXPORT_SYMBOL(zalloc_cpumask_var_node);
120
122/** 121/**
123 * alloc_cpumask_var - allocate a struct cpumask 122 * alloc_cpumask_var - allocate a struct cpumask
124 * @mask: pointer to cpumask_var_t where the cpumask is returned 123 * @mask: pointer to cpumask_var_t where the cpumask is returned
@@ -135,6 +134,12 @@ bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
135} 134}
136EXPORT_SYMBOL(alloc_cpumask_var); 135EXPORT_SYMBOL(alloc_cpumask_var);
137 136
137bool zalloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
138{
139 return alloc_cpumask_var(mask, flags | __GFP_ZERO);
140}
141EXPORT_SYMBOL(zalloc_cpumask_var);
142
138/** 143/**
139 * alloc_bootmem_cpumask_var - allocate a struct cpumask from the bootmem arena. 144 * alloc_bootmem_cpumask_var - allocate a struct cpumask from the bootmem arena.
140 * @mask: pointer to cpumask_var_t where the cpumask is returned 145 * @mask: pointer to cpumask_var_t where the cpumask is returned