]> granicus.if.org Git - spl/commitdiff
Remove atomic64_xchg() wrappers
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 1 Oct 2014 20:31:11 +0000 (16:31 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 17 Oct 2014 22:11:50 +0000 (15:11 -0700)
The atomic64_xchg() and atomic64_cmpxchg() functions have been
available since Linux 2.6.24.  There is no longer a need to
maintain this compatibility code.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
config/spl-build.m4
include/sys/atomic.h

index 109c653c132a365eef7181d9812d0bd84f2df246..2a3d278deb3145fdf10fc2158f394a6298e48991 100644 (file)
@@ -23,8 +23,6 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
        SPL_AC_DEBUG_KMEM_TRACKING
        SPL_AC_TEST_MODULE
        SPL_AC_ATOMIC_SPINLOCK
-       SPL_AC_TYPE_ATOMIC64_CMPXCHG
-       SPL_AC_TYPE_ATOMIC64_XCHG
        SPL_AC_TYPE_UINTPTR_T
        SPL_AC_SHRINKER_CALLBACK
        SPL_AC_CTL_NAME
@@ -808,44 +806,6 @@ AC_DEFUN([SPL_AC_ATOMIC_SPINLOCK], [
        AC_MSG_RESULT([$have_atomic64_t])
 ])
 
-dnl #
-dnl # 2.6.24 API change,
-dnl # check if atomic64_cmpxchg is defined
-dnl #
-AC_DEFUN([SPL_AC_TYPE_ATOMIC64_CMPXCHG],
-       [AC_MSG_CHECKING([whether kernel defines atomic64_cmpxchg])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/fs.h>
-       ],[
-               atomic64_cmpxchg((atomic64_t *)NULL, 0, 0);
-       ],[
-               AC_MSG_RESULT([yes])
-               AC_DEFINE(HAVE_ATOMIC64_CMPXCHG, 1,
-                         [kernel defines atomic64_cmpxchg])
-       ],[
-               AC_MSG_RESULT([no])
-       ])
-])
-
-dnl #
-dnl # 2.6.24 API change,
-dnl # check if atomic64_xchg is defined
-dnl #
-AC_DEFUN([SPL_AC_TYPE_ATOMIC64_XCHG],
-       [AC_MSG_CHECKING([whether kernel defines atomic64_xchg])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/fs.h>
-       ],[
-               atomic64_xchg((atomic64_t *)NULL, 0);
-       ],[
-               AC_MSG_RESULT([yes])
-               AC_DEFINE(HAVE_ATOMIC64_XCHG, 1,
-                         [kernel defines atomic64_xchg])
-       ],[
-               AC_MSG_RESULT([no])
-       ])
-])
-
 dnl #
 dnl # 2.6.24 API change,
 dnl # check if uintptr_t typedef is defined
index e034f2e2c836e55a24b16547e426266175ec85b5..07b460ef790e12e9ba7287b3173f987ceb435582 100644 (file)
 #include <linux/spinlock.h>
 #include <sys/types.h>
 
-#ifndef HAVE_ATOMIC64_CMPXCHG
-#define atomic64_cmpxchg(v, o, n)       (cmpxchg(&((v)->counter), (o), (n)))
-#endif
-
-#ifndef HAVE_ATOMIC64_XCHG
-#define atomic64_xchg(v, n)             (xchg(&((v)->counter), n))
-#endif
-
 /*
  * Two approaches to atomic operations are implemented each with its
  * own benefits are drawbacks imposed by the Solaris API.  Neither