+# 3.5 renames end_writeback() back to clear_inode()...
+# see kernel commit dbd5768f87ff6fb0a4fe09c4d7b6c4a24de99430
+#
+AC_DEFUN([LC_HAVE_CLEAR_INODE],
+[AC_MSG_CHECKING([if have clear_inode])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+],[
+ clear_inode((struct inode *)NULL);
+],[
+ AC_DEFINE(HAVE_CLEAR_INODE, 1,
+ [have clear_inode])
+ AC_MSG_RESULT([yes])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+
+#
+# 3.5 encode_fh has parent inode passed in directly
+# see kernel commit b0b0382b
+#
+AC_DEFUN([LC_HAVE_ENCODE_FH_PARENT],
+[AC_MSG_CHECKING([if encode_fh have parent inode as parameter])
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_LINUX_TRY_COMPILE([
+ #include <linux/exportfs.h>
+ #include <linux/fs.h>
+ #include <linux/types.h>
+ int ll_encode_fh(struct inode *i, __u32 *a, int *b, struct inode *p)
+ {
+ return 0;
+ }
+],[
+ struct export_operations exp_op;
+ exp_op.encode_fh = ll_encode_fh;
+],[
+ AC_DEFINE(HAVE_ENCODE_FH_PARENT, 1,
+ [have parent inode as parameter])
+ AC_MSG_RESULT([yes])
+],[
+ AC_MSG_RESULT([no])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+])
+
+# 3.5 has generic_file_llseek_size with 5 args
+AC_DEFUN([LC_FILE_LLSEEK_SIZE_5ARG],
+[AC_MSG_CHECKING([if kernel has generic_file_llseek_size with 5 args])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+],[
+ generic_file_llseek_size(NULL, 0, 0, 0, 0);
+], [
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_FILE_LLSEEK_SIZE_5ARGS, 1,
+ [kernel has generic_file_llseek_size with 5 args])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+
+#
+# 3.6 switch i_dentry/d_alias from list to hlist
+#
+AC_DEFUN([LC_HAVE_DENTRY_D_ALIAS_HLIST],
+[AC_MSG_CHECKING([if i_dentry/d_alias uses hlist])
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ #include <linux/list.h>
+],[
+ struct inode inode;
+ struct dentry dentry;
+ struct hlist_head head;
+ struct hlist_node node;
+ inode.i_dentry = head;
+ dentry.d_alias = node;
+],[
+ AC_DEFINE(HAVE_DENTRY_D_ALIAS_HLIST, 1,
+ [have i_dentry/d_alias uses hlist])
+ AC_MSG_RESULT([yes])
+],[
+ AC_MSG_RESULT([no])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+])
+
+#
+# 3.6 dentry_open uses struct path as first argument
+# see kernel commit 765927b2
+#
+AC_DEFUN([LC_DENTRY_OPEN_USE_PATH],
+[AC_MSG_CHECKING([if dentry_open uses struct path as first argument])
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ #include <linux/path.h>
+],[
+ struct path path;
+ dentry_open(&path, 0, NULL);
+],[
+ AC_DEFINE(HAVE_DENTRY_OPEN_USE_PATH, 1,
+ [dentry_open uses struct path as first argument])
+ AC_MSG_RESULT([yes])
+],[
+ AC_MSG_RESULT([no])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+])
+
+#
+# 3.6 vfs adds iop->atomic_open
+#
+AC_DEFUN([LC_HAVE_IOP_ATOMIC_OPEN],
+[AC_MSG_CHECKING([if iop has atomic_open])
+LB_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+],[
+ struct inode_operations iop;
+ iop.atomic_open = NULL;
+],[
+ AC_DEFINE(HAVE_IOP_ATOMIC_OPEN, 1,
+ [have iop atomic_open])
+ AC_MSG_RESULT([yes])
+],[
+ AC_MSG_RESULT([no])
+])
+])
+
+#