Whamcloud - gitweb
LU-6215 llite: handle kernel symlink api changes in 4.2+
[fs/lustre-release.git] / lustre / autoconf / lustre-core.m4
index e1a2a2c..97f1a2d 100644 (file)
@@ -1827,7 +1827,7 @@ bdi_cap_map_copy, [
 #
 # LC_CANCEL_DIRTY_PAGE
 #
-# 4.0.0 kernel removed cancle_dirty_page
+# 4.0.0 kernel removed cancel_dirty_page
 #
 AC_DEFUN([LC_CANCEL_DIRTY_PAGE], [
 LB_CHECK_COMPILE([if cancel_dirty_page still exist],
@@ -1873,6 +1873,45 @@ LB_CHECK_EXPORT([new_sync_read], [fs/read_write.c],
 ]) # LC_HAVE_SYNC_READ_WRITE
 
 #
+# LC_NEW_CANCEL_DIRTY_PAGE
+#
+# 4.2 kernel has new cancel_dirty_page
+#
+AC_DEFUN([LC_NEW_CANCEL_DIRTY_PAGE], [
+LB_CHECK_COMPILE([if cancel_dirty_page with one argument exist],
+new_cancel_dirty_page, [
+       #include <linux/mm.h>
+],[
+       cancel_dirty_page(NULL);
+],[
+       AC_DEFINE(HAVE_NEW_CANCEL_DIRTY_PAGE, 1,
+               [cancel_dirty_page with one arguement is available])
+])
+]) # LC_NEW_CANCEL_DIRTY_PAGE
+
+#
+# LC_SYMLINK_OPS_USE_NAMEIDATA
+#
+# For the 4.2+ kernels the file system internal symlink api no
+# longer uses struct nameidata as a argument
+#
+AC_DEFUN([LC_SYMLINK_OPS_USE_NAMEIDATA], [
+LB_CHECK_COMPILE([if symlink inode operations have struct nameidata argument],
+symlink_use_nameidata, [
+       #include <linux/namei.h>
+       #include <linux/fs.h>
+],[
+       struct nameidata *nd = NULL;
+
+       ((struct inode_operations *)0)->follow_link(NULL, nd);
+       ((struct inode_operations *)0)->put_link(NULL, nd, NULL);
+],[
+       AC_DEFINE(HAVE_SYMLINK_OPS_USE_NAMEIDATA, 1,
+               [symlink inode operations need struct nameidata argument])
+])
+]) # LC_SYMLINK_OPS_USE_NAMEIDATA
+
+#
 # LC_PROG_LINUX
 #
 # Lustre linux kernel checks
@@ -2027,6 +2066,10 @@ AC_DEFUN([LC_PROG_LINUX], [
        LC_IOV_ITER_RW
        LC_HAVE_SYNC_READ_WRITE
 
+       # 4.2
+       LC_NEW_CANCEL_DIRTY_PAGE
+       LC_SYMLINK_OPS_USE_NAMEIDATA
+
        #
        AS_IF([test "x$enable_server" != xno], [
                LC_FUNC_DEV_SET_RDONLY