Replace CONFIG_CPU_COUNT with plain CPU_COUNT
authorDaniel Gollub <daniel.gollub@gmail.com>
Thu, 1 May 2014 12:07:01 +0000 (14:07 +0200)
committerJens Axboe <axboe@fb.com>
Thu, 1 May 2014 17:21:51 +0000 (11:21 -0600)
Fixes double-declartion issue of CPU_COUNT when fio.h is included by
third-party projects.

Checking for a define of CPU_COUNT seems to be a common approach
to deal with different versions of sched.h

Signed-off-by: Daniel Gollub <daniel.gollub@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
configure
os/os.h

index 4757d6705e7ef95bac00eb4fbb2865a431703b20..2ba1dafea0f8a4e52181e34cba3a0e014d26afcd 100755 (executable)
--- a/configure
+++ b/configure
@@ -651,22 +651,6 @@ fi
 echo "sched_setaffinity(3 arg)      $linux_3arg_affinity"
 echo "sched_setaffinity(2 arg)      $linux_2arg_affinity"
 
-##########################################
-# CPU_COUNT test
-cpu_count="no"
-cat > $TMPC << EOF
-#include <sched.h>
-int main(int argc, char **argv)
-{
-  cpu_set_t mask;
-  return CPU_COUNT(&mask);
-}
-EOF
-if compile_prog "" "" "cpu_count"; then
-  cpu_count="yes"
-fi
-echo "CPU_COUNT                     $cpu_count"
-
 ##########################################
 # clock_gettime probe
 clock_gettime="no"
@@ -1335,9 +1319,6 @@ fi
 if test "$rbd" = "yes" ; then
   output_sym "CONFIG_RBD"
 fi
-if test "$cpu_count" = "yes" ; then
-  output_sym "CONFIG_CPU_COUNT"
-fi
 if test "$setvbuf" = "yes" ; then
   output_sym "CONFIG_SETVBUF"
 fi
diff --git a/os/os.h b/os/os.h
index 2f2d06981bdb0cbbdba24e52771551b2ed8a9fbc..98b45321962309baa304c3b87b30b819c3aa0888 100644 (file)
--- a/os/os.h
+++ b/os/os.h
@@ -321,7 +321,7 @@ static inline unsigned int cpus_online(void)
 }
 #endif
 
-#ifndef CONFIG_CPU_COUNT
+#ifndef CPU_COUNT
 #ifdef FIO_HAVE_CPU_AFFINITY
 static inline int CPU_COUNT(os_cpu_mask_t *mask)
 {