[PATCH 08/35] cpumask: cpumask_size()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Ingo Molnar <mingo@xxxxxxx>, Rusty Russell <rusty@xxxxxxxxxxxxxxx>
- Subject: [PATCH 08/35] cpumask: cpumask_size()
- From: Mike Travis <travis@xxxxxxx>
- Date: Mon, 20 Oct 2008 10:03:27 -0700
- Cc: Andi Kleen <andi@xxxxxxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, davej@xxxxxxxxxxxxxxxxx, David Miller <davem@xxxxxxxxxxxxx>, Eric Dumazet <dada1@xxxxxxxxxxxxx>, Jack Steiner <steiner@xxxxxxx>, Jeremy Fitzhardinge <jeremy@xxxxxxxx>, Jes Sorensen <jes@xxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, peterz@xxxxxxxxxxxxx, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Yinghai Lu <yhlu.kernel@xxxxxxxxx>, IA64 <linux-ia64@xxxxxxxxxxxxxxx>, PowerPC <linuxppc-dev@xxxxxxxxxx>, S390 <linux-s390@xxxxxxxxxxxxxxx>, SPARC <sparclinux@xxxxxxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx
- List-id: <linux-ia64.vger.kernel.org>
- References: <20081020170319.539427000@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- User-agent: quilt/0.46-1
Dynamic allocation of cpumasks requires the size.
Signed-off-by: Mike Travis <travis@xxxxxxx>
---
include/linux/cpumask.h | 6 ++++++
1 file changed, 6 insertions(+)
--- test-compile.orig/include/linux/cpumask.h
+++ test-compile/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
@@ -148,6 +149,11 @@ struct cpumask
};
#define cpumask_bits(maskp) ((maskp)->bits)
+static inline ssize_t cpumask_size(void)
+{
+ return 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-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]