From: Jens Axboe Date: Mon, 29 Jun 2015 19:19:24 +0000 (-0600) Subject: Kill duplicate __sync_fetch_and_add() X-Git-Tag: fio-2.2.10~52 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=f5cd2907de1e6c8281dfeb565c1dc94630e708b0 Kill duplicate __sync_fetch_and_add() 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 --- diff --git a/configure b/configure index 2e859c7a..085f0165 100755 --- 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_SFA" 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" ########################################## -# __sync_fetch_and_and test +# __sync_fetch_and_add test sfaa="no" cat > $TMPC << EOF static int sfaa(int *ptr) @@ -1493,24 +1492,6 @@ if compile_prog "" "" "getmntinfo"; then fi echo "getmntinfo $getmntinfo" -########################################## -# Check whether we have __sync_fetch_and_add() -sfa=="no" -cat > $TMPC << EOF -#include -#include -#include -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" @@ -1705,9 +1686,6 @@ 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 diff --git a/workqueue.c b/workqueue.c index 8f6963f5..0a6cd202 100644 --- a/workqueue.c +++ b/workqueue.c @@ -197,7 +197,7 @@ err: return 1; } -#ifdef CONFIG_SFA +#ifdef CONFIG_SFAA 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) { -#ifndef CONFIG_SFA +#ifndef CONFIG_SFAA 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]); -#ifndef CONFIG_SFA +#ifndef CONFIG_SFAA pthread_mutex_unlock(&src->io_wq.stat_lock); pthread_mutex_unlock(&dst->io_wq.stat_lock); #endif