+#ifndef CPU_COUNT
+#ifdef FIO_HAVE_CPU_AFFINITY
+static inline int CPU_COUNT(os_cpu_mask_t *mask)
+{
+ int max_cpus = cpus_online();
+ int nr_cpus, i;
+
+ for (i = 0, nr_cpus = 0; i < max_cpus; i++)
+ if (fio_cpu_isset(mask, i))
+ nr_cpus++;
+
+ return nr_cpus;
+}
+#endif
+#endif
+