aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-cluster/lustre/files/0013-LU-1337-kernel-3.5-kernel-encode_fh-passes-in-parent.patch')
-rw-r--r--sys-cluster/lustre/files/0013-LU-1337-kernel-3.5-kernel-encode_fh-passes-in-parent.patch88
1 files changed, 88 insertions, 0 deletions
diff --git a/sys-cluster/lustre/files/0013-LU-1337-kernel-3.5-kernel-encode_fh-passes-in-parent.patch b/sys-cluster/lustre/files/0013-LU-1337-kernel-3.5-kernel-encode_fh-passes-in-parent.patch
new file mode 100644
index 000000000..28f02823c
--- /dev/null
+++ b/sys-cluster/lustre/files/0013-LU-1337-kernel-3.5-kernel-encode_fh-passes-in-parent.patch
@@ -0,0 +1,88 @@
+From c3b73bfe1e157ec42be9015d231da66808483554 Mon Sep 17 00:00:00 2001
+From: Peng Tao <tao.peng@emc.com>
+Date: Thu, 23 Aug 2012 13:55:46 +0800
+Subject: [PATCH 13/13] LU-1337 kernel: 3.5 kernel encode_fh passes in parent
+ inode
+
+Changed by upsteam commit b0b0382b.
+
+Signed-off-by: Peng Tao <tao.peng@emc.com>
+Change-Id: I6d7223b934bfe4151371744ad72bdab6b170c700
+---
+ lustre/autoconf/lustre-core.m4 | 30 ++++++++++++++++++++++++++++++
+ lustre/llite/llite_nfs.c | 6 ++++++
+ 2 files changed, 36 insertions(+)
+
+diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
+index 3f47dab..dbf7233 100644
+--- a/lustre/autoconf/lustre-core.m4
++++ b/lustre/autoconf/lustre-core.m4
+@@ -2066,6 +2066,35 @@ LB_LINUX_TRY_COMPILE([
+ ])
+
+ #
++# 3.5 encode_fh has parent inode passed in directly
++# see kernel commit b0b0382b
++#
++AC_DEFUN([LC_HAVE_ENCODE_FH_PARENT],
++[AC_MSG_CHECKING([if encode_fh have parent inode as parameter])
++tmp_flags="$EXTRA_KCFLAGS"
++EXTRA_KCFLAGS="-Werror"
++LB_LINUX_TRY_COMPILE([
++ #include <linux/exportfs.h>
++ #include <linux/fs.h>
++ #include <linux/types.h>
++ int ll_encode_fh(struct inode *i, __u32 *a, int *b, struct inode*p)
++ {
++ return 0;
++ }
++],[
++ struct export_operations exp_op;
++ exp_op.encode_fh = ll_encode_fh;
++],[
++ AC_DEFINE(HAVE_ENCODE_FH_PARENT, 1,
++ [have parent inode as parameter])
++ AC_MSG_RESULT([yes])
++],[
++ AC_MSG_RESULT([no])
++])
++EXTRA_KCFLAGS="$tmp_flags"
++])
++
++#
+ # LC_PROG_LINUX
+ #
+ # Lustre linux kernel checks
+@@ -2231,6 +2260,7 @@ AC_DEFUN([LC_PROG_LINUX],
+
+ # 3.5
+ LC_HAVE_CLEAR_INODE
++ LC_HAVE_ENCODE_FH_PARENT
+
+ #
+ if test x$enable_server = xyes ; then
+diff --git a/lustre/llite/llite_nfs.c b/lustre/llite/llite_nfs.c
+index 809a564..ba4f9f1 100644
+--- a/lustre/llite/llite_nfs.c
++++ b/lustre/llite/llite_nfs.c
+@@ -173,11 +173,17 @@ ll_iget_for_nfs(struct super_block *sb, struct lu_fid *fid, struct lu_fid *paren
+ * 2 -- contains child file handle and parent file handle;
+ * 255 -- error.
+ */
++#ifndef HAVE_ENCODE_FH_PARENT
+ static int ll_encode_fh(struct dentry *de, __u32 *fh, int *plen,
+ int connectable)
+ {
+ struct inode *inode = de->d_inode;
+ struct inode *parent = de->d_parent->d_inode;
++#else
++static int ll_encode_fh(struct inode *inode, __u32 *fh, int *plen,
++ struct inode *parent)
++{
++#endif
+ struct lustre_nfs_fid *nfs_fid = (void *)fh;
+ ENTRY;
+
+--
+1.7.12
+