Kill duplicate __sync_fetch_and_add()
authorJens Axboe <axboe@fb.com>
Mon, 29 Jun 2015 19:19:24 +0000 (13:19 -0600)
committerJens Axboe <axboe@fb.com>
Mon, 29 Jun 2015 19:19:24 +0000 (13:19 -0600)
We already had CONFIG_SFAA, just missed it. No need to duplicate it,
get rid of it and update the check in workqueue.c.

Signed-off-by: Jens Axboe <axboe@fb.com>
configure
workqueue.c

index 2e859c7a7e4e915f245ac939c23659d8cd571a7a..085f01658f06221445577505831e2030aacb8d65 100755 (executable)
--- a/configure
+++ b/configure
@@ -271,7 +271,6 @@ CYGWIN*)
   output_sym "CONFIG_TCP_NODELAY"
   output_sym "CONFIG_TLS_THREAD"
   output_sym "CONFIG_IPV6"
   output_sym "CONFIG_TCP_NODELAY"
   output_sym "CONFIG_TLS_THREAD"
   output_sym "CONFIG_IPV6"
-  output_sym "CONFIG_SFA"
   echo "CC=$CC" >> $config_host_mak
   echo "BUILD_CFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
   exit 0
   echo "CC=$CC" >> $config_host_mak
   echo "BUILD_CFLAGS=$CFLAGS -include config-host.h -D_GNU_SOURCE" >> $config_host_mak
   exit 0
@@ -548,7 +547,7 @@ fi
 echo "Solaris AIO support           $solaris_aio"
 
 ##########################################
 echo "Solaris AIO support           $solaris_aio"
 
 ##########################################
-# __sync_fetch_and_and test
+# __sync_fetch_and_add test
 sfaa="no"
 cat > $TMPC << EOF
 static int sfaa(int *ptr)
 sfaa="no"
 cat > $TMPC << EOF
 static int sfaa(int *ptr)
@@ -1493,24 +1492,6 @@ if compile_prog "" "" "getmntinfo"; then
 fi
 echo "getmntinfo                    $getmntinfo"
 
 fi
 echo "getmntinfo                    $getmntinfo"
 
-##########################################
-# Check whether we have __sync_fetch_and_add()
-sfa=="no"
-cat > $TMPC << EOF
-#include <stdio.h>
-#include <stdlib.h>
-#include <inttypes.h>
-int main(int argc, char **argv)
-{
-  uint64_t dst = 1, src = 3;
-  __sync_fetch_and_add(&dst, src);
-}
-EOF
-if compile_prog "" "" "__sync_fetch_and_add"; then
-  sfa="yes"
-fi
-echo "__sync_fetch_and_add          $sfa"
-
 ##########################################
 # Check whether we have _Static_assert
 static_assert="no"
 ##########################################
 # Check whether we have _Static_assert
 static_assert="no"
@@ -1705,9 +1686,6 @@ fi
 if test "$getmntinfo" = "yes" ; then
   output_sym "CONFIG_GETMNTINFO"
 fi
 if test "$getmntinfo" = "yes" ; then
   output_sym "CONFIG_GETMNTINFO"
 fi
-if test "$sfa" = "yes" ; then
-  output_sym "CONFIG_SFA"
-fi
 if test "$static_assert" = "yes" ; then
   output_sym "CONFIG_STATIC_ASSERT"
 fi
 if test "$static_assert" = "yes" ; then
   output_sym "CONFIG_STATIC_ASSERT"
 fi
index 8f6963f58aaadac55ef37d378f8c7f05c928516e..0a6cd2027443f795e4d99a960b92c7d557745ea0 100644 (file)
@@ -197,7 +197,7 @@ err:
        return 1;
 }
 
        return 1;
 }
 
-#ifdef CONFIG_SFA
+#ifdef CONFIG_SFAA
 static void sum_val(uint64_t *dst, uint64_t *src)
 {
        if (*src) {
 static void sum_val(uint64_t *dst, uint64_t *src)
 {
        if (*src) {
@@ -218,7 +218,7 @@ static void sum_val(uint64_t *dst, uint64_t *src)
 static void sum_ddir(struct thread_data *dst, struct thread_data *src,
                     enum fio_ddir ddir)
 {
 static void sum_ddir(struct thread_data *dst, struct thread_data *src,
                     enum fio_ddir ddir)
 {
-#ifndef CONFIG_SFA
+#ifndef CONFIG_SFAA
        pthread_mutex_lock(&dst->io_wq.stat_lock);
        pthread_mutex_lock(&src->io_wq.stat_lock);
 #endif
        pthread_mutex_lock(&dst->io_wq.stat_lock);
        pthread_mutex_lock(&src->io_wq.stat_lock);
 #endif
@@ -229,7 +229,7 @@ static void sum_ddir(struct thread_data *dst, struct thread_data *src,
        sum_val(&dst->this_io_bytes[ddir], &src->this_io_bytes[ddir]);
        sum_val(&dst->bytes_done[ddir], &src->bytes_done[ddir]);
 
        sum_val(&dst->this_io_bytes[ddir], &src->this_io_bytes[ddir]);
        sum_val(&dst->bytes_done[ddir], &src->bytes_done[ddir]);
 
-#ifndef CONFIG_SFA
+#ifndef CONFIG_SFAA
        pthread_mutex_unlock(&src->io_wq.stat_lock);
        pthread_mutex_unlock(&dst->io_wq.stat_lock);
 #endif
        pthread_mutex_unlock(&src->io_wq.stat_lock);
        pthread_mutex_unlock(&dst->io_wq.stat_lock);
 #endif