Whamcloud - gitweb
LU-5322 libcfs: handle vfs_rename change in 3.15+ kernels 58/11058/3
authorJames Simmons <uja.ornl@gmail.com>
Thu, 10 Jul 2014 21:46:46 +0000 (17:46 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 16 Jul 2014 17:57:54 +0000 (17:57 +0000)
Starting with 3.15 kernels vfs_rename takes 6 arguments.
This patch adds support for this change.

Change-Id: I64ac982a3d7be03c61005fc899786b710f2fde57
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Reviewed-on: http://review.whamcloud.com/11058
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/autoconf/lustre-core.m4
lustre/include/linux/lustre_compat25.h

index 8e12090..0891fd4 100644 (file)
@@ -1419,7 +1419,7 @@ kiocb_ki_left, [
 #
 # LC_VFS_RENAME_5ARGS
 #
-# 3.13 has vfs_renane with 5 args
+# 3.13 has vfs_rename with 5 args
 #
 AC_DEFUN([LC_VFS_RENAME_5ARGS], [
 LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 5 args],
@@ -1436,7 +1436,7 @@ vfs_rename_5args, [
 #
 # LC_VFS_UNLINK_3ARGS
 #
-# 3.13 has vfs_renane with 3 args
+# 3.13 has vfs_unlink with 3 args
 #
 AC_DEFUN([LC_VFS_UNLINK_3ARGS], [
 LB_CHECK_COMPILE([if Linux kernel has 'vfs_unlink' with 3 args],
@@ -1470,6 +1470,23 @@ have_bvec_iter, [
 ]) # LC_HAVE_BVEC_ITER
 
 #
+# LC_VFS_RENAME_6ARGS
+#
+# 3.15 has vfs_rename with 6 args
+#
+AC_DEFUN([LC_VFS_RENAME_6ARGS], [
+LB_CHECK_COMPILE([if Linux kernel has 'vfs_rename' with 6 args],
+vfs_rename_6args, [
+       #include <linux/fs.h>
+],[
+       vfs_rename(NULL, NULL, NULL, NULL, NULL, NULL);
+], [
+       AC_DEFINE(HAVE_VFS_RENAME_6ARGS, 1,
+               [kernel has vfs_rename with 6 args])
+])
+]) # LC_VFS_RENAME_6ARGS
+
+#
 # LC_PROG_LINUX
 #
 # Lustre linux kernel checks
@@ -1590,6 +1607,9 @@ AC_DEFUN([LC_PROG_LINUX], [
        # 3.14
        LC_HAVE_BVEC_ITER
 
+       # 3.15
+       LC_VFS_RENAME_6ARGS
+
        #
        AS_IF([test "x$enable_server" != xno], [
                LC_FUNC_DEV_SET_RDONLY
index 4b6fddf..4ec8e55 100644 (file)
@@ -342,6 +342,8 @@ static inline struct dentry *d_make_root(struct inode *root)
 
 #ifdef HAVE_VFS_RENAME_5ARGS
 #define ll_vfs_rename(a, b, c, d) vfs_rename(a, b, c, d, NULL)
+#elif defined HAVE_VFS_RENAME_6ARGS
+#define ll_vfs_rename(a, b, c, d) vfs_rename(a, b, c, d, NULL, 0)
 #else
 #define ll_vfs_rename(a, b, c, d) vfs_rename(a, b, c, d)
 #endif