[PATCH 08/35] cpumask: cpumask_size() From: Mike Travis <travis@sgi.com>

From: Mike Travis
Date: Wed Oct 22 2008 - 22:11:42 EST


Dynamic allocation of cpumasks requires the size.

Signed-off-by: Mike Travis <travis@xxxxxxx>
---
include/linux/cpumask.h | 3 +++
1 file changed, 3 insertions(+)

--- linux-2.6.28.orig/include/linux/cpumask.h
+++ linux-2.6.28/include/linux/cpumask.h
@@ -64,6 +64,7 @@
* int next_cpu(cpu, mask) Next cpu past 'cpu', or NR_CPUS
* int next_cpu_nr(cpu, mask) Next cpu past 'cpu', or nr_cpu_ids
*
+ * size_t cpumask_size() Length of cpumask in bytes.
* cpumask_t cpumask_of_cpu(cpu) Return cpumask with bit 'cpu' set
* (can be used as an lvalue)
* CPU_MASK_ALL Initializer - all bits set
@@ -147,6 +148,8 @@ struct cpumask {
};
#define cpumask_bits(maskp) ((maskp)->bits)

+#define cpumask_size() (BITS_TO_LONGS(NR_CPUS) * sizeof(long))
+
/* Deprecated. */
typedef struct cpumask cpumask_t;
extern cpumask_t _unused_cpumask_arg_;

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/