From 49863be66b28d1181eb7baa706c3e339e0422311 Mon Sep 17 00:00:00 2001 From: brian Date: Mon, 4 May 2009 21:30:59 +0000 Subject: [PATCH] b=17671 i=zhen.liang i=sheng.yang Enable Lustre to be built with OFED 1.4.1. This is just the glue needed for the build with OFED 1.4.1 to actually work. OFED 1.4.1 won't actually get built with a Lustre branch until a target file specifies: OFED_VERSION=1.4.1-rc4 Note that OFED 1.4.1 only supports RHEL4, RHEL5 and SLES10 targets. SLES9 users are out of luck (but have been for some time with OFED). --- lustre/autoconf/lustre-core.m4 | 28 ++++++++++++++++++++++++++-- lustre/include/linux/lustre_compat25.h | 22 +++++++++++++--------- 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index f046a92..f5facd4 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -1563,6 +1563,29 @@ AC_DEFUN([LC_HAVE_SYSCTL_VFS_CACHE_PRESSURE], ]) ]) +# vfs_symlink seems to have started out with 3 args until 2.6.7 where a +# "mode" argument was added, but then again, in some later version it was +# removed +AC_DEFUN([LC_4ARGS_VFS_SYMLINK], +[AC_MSG_CHECKING([if vfs_symlink wants 4 args]) +LB_LINUX_TRY_COMPILE([ + #include +],[ + struct inode *dir; + struct dentry *dentry; + const char *oldname = NULL; + int mode = 0; + + vfs_symlink(dir, dentry, oldname, mode); +],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_4ARGS_VFS_SYMLINK, 1, + [vfs_symlink wants 4 args]) +],[ + AC_MSG_RESULT(no) +]) +]) + # # LC_PROG_LINUX # @@ -1617,6 +1640,7 @@ AC_DEFUN([LC_PROG_LINUX], LC_FUNC_RCU LC_PERCPU_COUNTER LC_QUOTA64 + LC_4ARGS_VFS_SYMLINK # does the kernel have VFS intent patches? LC_VFS_INTENT_PATCHES @@ -1678,13 +1702,13 @@ AC_DEFUN([LC_PROG_LINUX], # 2.6.25 LC_MAPPING_CAP_WRITEBACK_DIRTY - + # 2.6.24 LC_HAVE_MMTYPES_H LC_BIO_ENDIO_2ARG LC_FH_TO_DENTRY LC_PROCFS_DELETED - + # 2.6.26 LC_FS_STRUCT_USE_PATH LC_RCU_LIST_SAFE diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h index 64c62fe..1902b6e 100644 --- a/lustre/include/linux/lustre_compat25.h +++ b/lustre/include/linux/lustre_compat25.h @@ -283,23 +283,27 @@ static inline int mapping_has_pages(struct address_space *mapping) #define KIOBUF_GET_BLOCKS(k) ((k)->blocks) #endif -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,7)) -#define ll_set_dflags(dentry, flags) do { dentry->d_vfs_flags |= flags; } while(0) +#ifdef HAVE_SECURITY_PLUG +#define ll_vfs_symlink(dir, dentry, mnt, path, mode) \ + vfs_symlink(dir, dentry, mnt, path, mode) +#else +#ifdef HAVE_4ARGS_VFS_SYMLINK +#define ll_vfs_symlink(dir, dentry, mnt, path, mode) \ + vfs_symlink(dir, dentry, path, mode) +#else #define ll_vfs_symlink(dir, dentry, mnt, path, mode) \ vfs_symlink(dir, dentry, path) +#endif +#endif + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,7)) +#define ll_set_dflags(dentry, flags) do { dentry->d_vfs_flags |= flags; } while(0) #else #define ll_set_dflags(dentry, flags) do { \ spin_lock(&dentry->d_lock); \ dentry->d_flags |= flags; \ spin_unlock(&dentry->d_lock); \ } while(0) -#ifdef HAVE_SECURITY_PLUG -#define ll_vfs_symlink(dir, dentry, mnt, path, mode) \ - vfs_symlink(dir, dentry, mnt, path, mode) -#else -#define ll_vfs_symlink(dir, dentry, mnt, path, mode) \ - vfs_symlink(dir, dentry, path, mode) -#endif #endif #ifndef container_of -- 1.8.3.1