cpumask: cpumask_size()

Dynamic allocation of cpumasks requires the size.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 include/linux/cpumask.h |    3 +++
 1 file changed, 3 insertions(+)

diff -r 54b320957ea2 include/linux/cpumask.h
--- a/include/linux/cpumask.h	Fri Oct 03 16:50:05 2008 +1000
+++ b/include/linux/cpumask.h	Sat Oct 04 20:59:14 2008 +1000
@@ -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
@@ -184,6 +185,8 @@ extern cpumask_t _unused_cpumask_arg_;
 		cpumask_fold(&(dst), &(orig), sz)
 #define cpus_addr(src) ((src).bits)
 /* End deprecated region. */
+
+#define cpumask_size() (BITS_TO_LONGS(NR_CPUS) * sizeof(long))
 
 static inline void cpumask_set_cpu(int cpu, volatile struct cpumask *dstp)
 {
