Define timestruc_t for Lustre compatibility
[zfs.git] / config / kernel-spinlock.m4
blobd6d6640070b54b6fd0add2e9319ca40a82c5b7ee
1 dnl #
2 dnl # 2.6.36 API change,
3 dnl # The 'struct fs_struct->lock' was changed from a rwlock_t to
4 dnl # a spinlock_t to improve the fastpath performance.
5 dnl #
6 AC_DEFUN([ZFS_AC_KERNEL_FS_STRUCT_SPINLOCK], [
7         AC_MSG_CHECKING([whether struct fs_struct uses spinlock_t])
8         tmp_flags="$EXTRA_KCFLAGS"
9         EXTRA_KCFLAGS="-Werror"
10         ZFS_LINUX_TRY_COMPILE([
11                 #include <linux/sched.h>
12                 #include <linux/fs_struct.h>
13         ],[
14                 static struct fs_struct fs;
15                 spin_lock_init(&fs.lock);
16         ],[
17                 AC_MSG_RESULT(yes)
18                 AC_DEFINE(HAVE_FS_STRUCT_SPINLOCK, 1,
19                           [struct fs_struct uses spinlock_t])
20         ],[
21                 AC_MSG_RESULT(no)
22         ])
23         EXTRA_KCFLAGS="$tmp_flags"