diff options
Diffstat (limited to 'sys-cluster/lustre/files/0007-LU-1337-vfs-3.3-changes-super_operations-inode_opera.patch')
-rw-r--r-- | sys-cluster/lustre/files/0007-LU-1337-vfs-3.3-changes-super_operations-inode_opera.patch | 217 |
1 files changed, 217 insertions, 0 deletions
diff --git a/sys-cluster/lustre/files/0007-LU-1337-vfs-3.3-changes-super_operations-inode_opera.patch b/sys-cluster/lustre/files/0007-LU-1337-vfs-3.3-changes-super_operations-inode_opera.patch new file mode 100644 index 000000000..43cc7842d --- /dev/null +++ b/sys-cluster/lustre/files/0007-LU-1337-vfs-3.3-changes-super_operations-inode_opera.patch @@ -0,0 +1,217 @@ +From 87c734aec5ec3a73c8eeab425f501568b05874ba Mon Sep 17 00:00:00 2001 +From: Liu Xuezhao <xuezhao.liu@emc.com> +Date: Thu, 19 Jul 2012 17:43:16 +0800 +Subject: [PATCH 07/13] LU-1337 vfs: 3.3 changes + super_operations/inode_operations + +1. Kernel 3.3 switchs super_operations to use dentry as parameter + (kernel commit 34c80b1d93e6e20ca9dea0baf583a5b5510d92d4). + Add LC_SUPEROPS_USE_DENTRY/HAVE_SUPEROPS_USE_DENTRY to check it. +2. Kernel 3.3 switchs inode_operations to use umode_t as parameter + (kernel commit 1a67aafb5f72a436ca044293309fa7e6351d6a35). + Add LC_INODEOPS_USE_UMODE_T/HAVE_INODEOPS_USE_UMODE_T to check it. + +Signed-off-by: Liu Xuezhao <xuezhao.liu@emc.com> +Change-Id: I7564506cf4365c8da113a81058f68b9ef8b092a4 +--- + lustre/autoconf/lustre-core.m4 | 57 ++++++++++++++++++++++++++++++++++ + lustre/include/linux/lustre_compat25.h | 6 ++++ + lustre/llite/llite_internal.h | 4 +++ + lustre/llite/llite_lib.c | 13 ++++++-- + lustre/llite/namei.c | 13 +++++--- + 5 files changed, 87 insertions(+), 6 deletions(-) + +diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 +index 84f1678..15f58ab 100644 +--- a/lustre/autoconf/lustre-core.m4 ++++ b/lustre/autoconf/lustre-core.m4 +@@ -1954,6 +1954,61 @@ LB_LINUX_TRY_COMPILE([ + ]) + + # ++# 3.3 switchs super_operations to use dentry as parameter (but not vfsmount) ++# see kernel commit 34c80b1d93e6e20ca9dea0baf583a5b5510d92d4 ++# ++AC_DEFUN([LC_SUPEROPS_USE_DENTRY], ++[AC_MSG_CHECKING([if super_operations use dentry as parameter]) ++tmp_flags="$EXTRA_KCFLAGS" ++EXTRA_KCFLAGS="-Werror" ++LB_LINUX_TRY_COMPILE([ ++ #include <linux/fs.h> ++ int show_options(struct seq_file *seq, struct dentry *root){ ++ return 0; ++ } ++],[ ++ struct super_operations ops; ++ ops.show_options = show_options; ++],[ ++ AC_DEFINE(HAVE_SUPEROPS_USE_DENTRY, 1, ++ [super_operations use dentry as parameter]) ++ AC_MSG_RESULT([yes]) ++],[ ++ AC_MSG_RESULT([no]) ++]) ++EXTRA_KCFLAGS="$tmp_flags" ++]) ++ ++# ++# 3.3 switchs inode_operations to use umode_t as parameter (but not int) ++# see kernel commit 1a67aafb5f72a436ca044293309fa7e6351d6a35 ++# ++AC_DEFUN([LC_INODEOPS_USE_UMODE_T], ++[AC_MSG_CHECKING([if inode_operations use umode_t as parameter]) ++tmp_flags="$EXTRA_KCFLAGS" ++EXTRA_KCFLAGS="-Werror" ++LB_LINUX_TRY_COMPILE([ ++ #include <linux/fs.h> ++ #include <linux/types.h> ++ int my_mknod(struct inode *dir, struct dentry *dchild, ++ umode_t mode, dev_t dev) ++ { ++ return 0; ++ } ++],[ ++ struct inode_operations ops; ++ ops.mknod = my_mknod; ++],[ ++ AC_DEFINE(HAVE_INODEOPS_USE_UMODE_T, 1, ++ [inode_operations use umode_t as parameter]) ++ AC_MSG_RESULT([yes]) ++],[ ++ AC_MSG_RESULT([no]) ++]) ++EXTRA_KCFLAGS="$tmp_flags" ++]) ++ ++# + # LC_PROG_LINUX + # + # Lustre linux kernel checks +@@ -2110,6 +2165,8 @@ AC_DEFUN([LC_PROG_LINUX], + # 3.3 + LC_HAVE_MIGRATE_HEADER + LC_MIGRATEPAGE_4ARGS ++ LC_SUPEROPS_USE_DENTRY ++ LC_INODEOPS_USE_UMODE_T + + # + if test x$enable_server = xyes ; then +diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h +index 7ead133..070ad83 100644 +--- a/lustre/include/linux/lustre_compat25.h ++++ b/lustre/include/linux/lustre_compat25.h +@@ -847,5 +847,11 @@ static inline void set_nlink(struct inode *inode, unsigned int nlink) + } + #endif + ++#ifdef HAVE_INODEOPS_USE_UMODE_T ++# define ll_umode_t umode_t ++#else ++# define ll_umode_t int ++#endif ++ + #endif /* __KERNEL__ */ + #endif /* _COMPAT25_H */ +diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h +index a1c02e5..a942134 100644 +--- a/lustre/llite/llite_internal.h ++++ b/lustre/llite/llite_internal.h +@@ -830,7 +830,11 @@ void ll_umount_begin(struct vfsmount *vfsmnt, int flags); + void ll_umount_begin(struct super_block *sb); + #endif + int ll_remount_fs(struct super_block *sb, int *flags, char *data); ++#ifdef HAVE_SUPEROPS_USE_DENTRY ++int ll_show_options(struct seq_file *seq, struct dentry *dentry); ++#else + int ll_show_options(struct seq_file *seq, struct vfsmount *vfs); ++#endif + int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req, + struct super_block *); + void lustre_dump_dentry(struct dentry *, int recur); +diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c +index 07efcfc..18246ac 100644 +--- a/lustre/llite/llite_lib.c ++++ b/lustre/llite/llite_lib.c +@@ -2294,12 +2294,21 @@ void ll_finish_md_op_data(struct md_op_data *op_data) + OBD_FREE_PTR(op_data); + } + ++#ifdef HAVE_SUPEROPS_USE_DENTRY ++int ll_show_options(struct seq_file *seq, struct dentry *dentry) ++#else + int ll_show_options(struct seq_file *seq, struct vfsmount *vfs) ++#endif + { + struct ll_sb_info *sbi; + +- LASSERT((seq != NULL) && (vfs != NULL)); +- sbi = ll_s2sbi(vfs->mnt_sb); ++#ifdef HAVE_SUPEROPS_USE_DENTRY ++ LASSERT((seq != NULL) && (dentry != NULL)); ++ sbi = ll_s2sbi(dentry->d_sb); ++#else ++ LASSERT((seq != NULL) && (vfs != NULL)); ++ sbi = ll_s2sbi(vfs->mnt_sb); ++#endif + + if (sbi->ll_flags & LL_SBI_NOLCK) + seq_puts(seq, ",nolock"); +diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c +index 036674f..a439e2f 100644 +--- a/lustre/llite/namei.c ++++ b/lustre/llite/namei.c +@@ -815,7 +815,7 @@ static int ll_mknod_generic(struct inode *dir, struct qstr *name, int mode, + } + + static int ll_create_nd(struct inode *dir, struct dentry *dentry, +- int mode, struct nameidata *nd) ++ ll_umode_t mode, struct nameidata *nd) + { + struct lookup_intent *it = ll_d2d(dentry)->lld_it; + int rc; +@@ -1128,8 +1128,8 @@ static int ll_rename_generic(struct inode *src, struct dentry *src_dparent, + RETURN(err); + } + +-static int ll_mknod(struct inode *dir, struct dentry *dchild, int mode, +- ll_dev_t rdev) ++static int ll_mknod(struct inode *dir, struct dentry *dchild, ++ ll_umode_t mode, ll_dev_t rdev) + { + return ll_mknod_generic(dir, &dchild->d_name, mode, + old_encode_dev(rdev), dchild); +@@ -1139,25 +1139,30 @@ static int ll_unlink(struct inode * dir, struct dentry *dentry) + { + return ll_unlink_generic(dir, NULL, dentry, &dentry->d_name); + } +-static int ll_mkdir(struct inode *dir, struct dentry *dentry, int mode) ++ ++static int ll_mkdir(struct inode *dir, struct dentry *dentry, ll_umode_t mode) + { + return ll_mkdir_generic(dir, &dentry->d_name, mode, dentry); + } ++ + static int ll_rmdir(struct inode *dir, struct dentry *dentry) + { + return ll_rmdir_generic(dir, NULL, dentry, &dentry->d_name); + } ++ + static int ll_symlink(struct inode *dir, struct dentry *dentry, + const char *oldname) + { + return ll_symlink_generic(dir, &dentry->d_name, oldname, dentry); + } ++ + static int ll_link(struct dentry *old_dentry, struct inode *dir, + struct dentry *new_dentry) + { + return ll_link_generic(old_dentry->d_inode, dir, &new_dentry->d_name, + new_dentry); + } ++ + static int ll_rename(struct inode *old_dir, struct dentry *old_dentry, + struct inode *new_dir, struct dentry *new_dentry) + { +-- +1.7.12 + |