diff options
author | Brian Behlendorf <[email protected]> | 2016-07-26 23:37:46 +0000 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-07-29 14:17:53 -0700 |
commit | b7c7008ba28ca926fbda929aec52f3761d72cffe (patch) | |
tree | 21c4186bf940b6ed92a72960559bac0e4be31f90 /config | |
parent | d2f97b2a2651d8e1a6e9e1dcb07cfe8570efcfff (diff) |
Linux 4.8 compat: rw_semaphore atomic_long_t count
For non-rwsem-spinlocks the "count" member was changed from a
"long" to "atomic_long_t" type. A configure check has been
added to detect this change along with new versions of the
_rwsem_tryupgrade() function and RWSEM_COUNT() macro. See
https://github.com/torvalds/linux/commit/8ee62b18 for complete
details.
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #563
Diffstat (limited to 'config')
-rw-r--r-- | config/spl-build.m4 | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/config/spl-build.m4 b/config/spl-build.m4 index d705c6531..e9eb77861 100644 --- a/config/spl-build.m4 +++ b/config/spl-build.m4 @@ -40,6 +40,7 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [ SPL_AC_SHRINK_CONTROL_STRUCT SPL_AC_RWSEM_SPINLOCK_IS_RAW SPL_AC_RWSEM_ACTIVITY + SPL_AC_RWSEM_ATOMIC_LONG_COUNT SPL_AC_SCHED_RT_HEADER SPL_AC_2ARGS_VFS_GETATTR SPL_AC_USLEEP_RANGE @@ -1342,6 +1343,31 @@ AC_DEFUN([SPL_AC_RWSEM_ACTIVITY], [ ]) dnl # +dnl # 4.8 API Change +dnl # +dnl # rwsem "->count" changed to atomic_long_t type +dnl # +AC_DEFUN([SPL_AC_RWSEM_ATOMIC_LONG_COUNT], [ + AC_MSG_CHECKING( + [whether struct rw_semaphore has atomic_long_t member count]) + tmp_flags="$EXTRA_KCFLAGS" + EXTRA_KCFLAGS="-Werror" + SPL_LINUX_TRY_COMPILE([ + #include <linux/rwsem.h> + ],[ + DECLARE_RWSEM(dummy_semaphore); + (void) atomic_long_read(&dummy_semaphore.count); + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_RWSEM_ATOMIC_LONG_COUNT, 1, + [struct rw_semaphore has atomic_long_t member count]) + ],[ + AC_MSG_RESULT(no) + ]) + EXTRA_KCFLAGS="$tmp_flags" +]) + +dnl # dnl # 3.9 API change, dnl # Moved things from linux/sched.h to linux/sched/rt.h dnl # |