aboutsummaryrefslogtreecommitdiffstats
path: root/config/kernel-spinlock.m4
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2018-02-07 11:50:24 -0800
committerGitHub <[email protected]>2018-02-07 11:50:24 -0800
commit48ef8ba07094afcd67355940ca8db92d76f7c096 (patch)
treec0f847b7ce7c93950d313ca7708bce4bc1f3621e /config/kernel-spinlock.m4
parent5461eefe50427a8f8caf0b92f0195c754bed8ec6 (diff)
Split spl-build.m4
Split the kernel interface configure checks in to seperate m4 macro files. This is intended to facilitate moving the spl source code in to the zfs repository. Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #682
Diffstat (limited to 'config/kernel-spinlock.m4')
-rw-r--r--config/kernel-spinlock.m424
1 files changed, 24 insertions, 0 deletions
diff --git a/config/kernel-spinlock.m4 b/config/kernel-spinlock.m4
new file mode 100644
index 000000000..136262d0e
--- /dev/null
+++ b/config/kernel-spinlock.m4
@@ -0,0 +1,24 @@
+dnl #
+dnl # 2.6.36 API change,
+dnl # The 'struct fs_struct->lock' was changed from a rwlock_t to
+dnl # a spinlock_t to improve the fastpath performance.
+dnl #
+AC_DEFUN([SPL_AC_FS_STRUCT_SPINLOCK], [
+ AC_MSG_CHECKING([whether struct fs_struct uses spinlock_t])
+ tmp_flags="$EXTRA_KCFLAGS"
+ EXTRA_KCFLAGS="-Werror"
+ SPL_LINUX_TRY_COMPILE([
+ #include <linux/sched.h>
+ #include <linux/fs_struct.h>
+ ],[
+ static struct fs_struct fs;
+ spin_lock_init(&fs.lock);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_FS_STRUCT_SPINLOCK, 1,
+ [struct fs_struct uses spinlock_t])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+ EXTRA_KCFLAGS="$tmp_flags"
+])