Whamcloud - gitweb
LU-12400 ptlrpc: Sun RPC changes for RCU locking
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
index 68c61f3..4950ea9 100644 (file)
@@ -2660,6 +2660,31 @@ EXTRA_KCFLAGS="$tmp_flags"
 ]) # LC_UAPI_LINUX_MOUNT_H
 
 #
+# LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
+#
+# kernel 4.20 commit 1863d77f15da0addcd293a1719fa5d3ef8cde3ca
+# SUNRPC: Replace the cache_detail->hash_lock with a regular spinlock
+#
+# Now that the reader functions are all RCU protected, use a regular
+# spinlock rather than a reader/writer lock.
+#
+AC_DEFUN([LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK], [
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_CHECK_COMPILE([if cache_detail->hash_lock is a spinlock],
+hash_lock_isa_spinlock_t, [
+       #include <linux/sunrpc/cache.h>
+],[
+       spinlock_t *lock = &(((struct cache_detail *)0)->hash_lock);
+       spin_lock(lock);
+],[
+       AC_DEFINE(HAVE_CACHE_HASH_SPINLOCK, 1,
+               [if cache_detail->hash_lock is a spinlock])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+]) # LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
+
+#
 # LC_BIO_INTEGRITY_ENABLED
 #
 # 4.13 removed bio_integrity_enabled
@@ -3024,6 +3049,9 @@ AC_DEFUN([LC_PROG_LINUX], [
        # 4.18
        LC_INODE_TIMESPEC64
 
+       # 4.20
+       LC_HAVE_SUNRPC_CACHE_HASH_LOCK_IS_A_SPINLOCK
+
        # 5.0
        LC_UAPI_LINUX_MOUNT_H