----- "Michael Holzheu" <holzheu(a)linux.vnet.ibm.com> wrote:
> So yes, while STRUCT_SIZE("cpumask_t") would always be
appropriate for that
> data type, it would fail for the older kernel types which don't use it.
So if for older kernels it was an unsigned long, the function should
work:
+static int
+cpu_map_size(void)
+{
+ int len;
+
+ len = STRUCT_SIZE("cpumask_t");
+ if (len < 0)
+ return sizeof(ulong);
+ else
+ return len;
+}
Yeah, you're right, that will probably work. There were definitions for
"cpumask_t" that existed prior to the transition of cpu_online_map symbol
from being an unsigned long to a cpumask_t. But except for mips64 (unsupported)
they all appear to have been unsigned longs anyway.
So it should in all probability be safe. Let me play around with the patch.
Thanks again for taking the time to work this out,
Dave