From 517a57ca9846fbf9a09d1a54a5295f376b64d58e Mon Sep 17 00:00:00 2001 From: James Simmons Date: Thu, 10 Jul 2014 17:46:46 -0400 Subject: [PATCH 1/1] LU-5322 libcfs: handle vfs_rename change in 3.15+ kernels 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 Reviewed-on: http://review.whamcloud.com/11058 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Bob Glossman Reviewed-by: Yang Sheng Reviewed-by: Oleg Drokin --- lustre/autoconf/lustre-core.m4 | 24 ++++++++++++++++++++++-- lustre/include/linux/lustre_compat25.h | 2 ++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 8e12090..0891fd4 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -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 +],[ + 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 diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h index 4b6fddf..4ec8e55 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -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 -- 1.8.3.1