aboutsummaryrefslogtreecommitdiff
blob: 35905f0f2747d37cee052be7155beb0748438f63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
From da0f460ee306437c583147ea6832298cbc1e9202 Mon Sep 17 00:00:00 2001
From: Alexey Shvetsov <alexxy@gentoo.org>
Date: Sun, 31 Mar 2013 20:13:21 +0400
Subject: [PATCH 12/12] LU-2850 kernel: f_vfsmnt replaced by f_path.mnt

In linux 3.9 f_vfsmnt was killed and replaced

commit 182be684784334598eee1d90274e7f7aa0063616
Author: Al Viro <viro@zeniv.linux.org.uk>
Date:   Thu Jan 24 02:21:54 2013 -0500

    kill f_vfsmnt

    very few users left...

Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
Change-Id: I02f595f0b7bbe804c9695d6da2106deb2d17e0ee
---
 lustre/autoconf/lustre-core.m4 | 23 +++++++++++++++++++++++
 lustre/llite/dir.c             |  4 ++++
 2 files changed, 27 insertions(+)

diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
index 527052e..de79357 100644
--- a/lustre/autoconf/lustre-core.m4
+++ b/lustre/autoconf/lustre-core.m4
@@ -2314,6 +2314,28 @@ LB_LINUX_TRY_COMPILE([
 ])
 
 #
+# 3.9 killed f_vfsmnt by
+# 182be684784334598eee1d90274e7f7aa0063616
+# replacement is f_path.mnt
+#
+AC_DEFUN([LC_HAVE_F_PATH_MNT],
+[AC_MSG_CHECKING([if struct file has f_path.mnt])
+LB_LINUX_TRY_COMPILE([
+	#include <linux/fs.h>
+],[
+	struct file *fp = NULL;
+	struct path  path;
+
+	path.mnt = fp->f_path.mnt;
+],[
+	AC_DEFINE(HAVE_F_PATH_MNT,1,[yes])
+	AC_MSG_RESULT([yes])
+],[
+	AC_MSG_RESULT([no])
+])
+])
+
+#
 # LC_PROG_LINUX
 #
 # Lustre linux kernel checks
@@ -2504,6 +2526,7 @@ AC_DEFUN([LC_PROG_LINUX],
 
 	 # 3.9
 	 LC_HAVE_HLIST_FOR_EACH_3ARG
+	 LC_HAVE_F_PATH_MNT
 
 	 #
 	 if test x$enable_server = xyes ; then
diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c
index 14ea720..14d275c 100644
--- a/lustre/llite/dir.c
+++ b/lustre/llite/dir.c
@@ -639,7 +639,11 @@ static int ll_readdir(struct file *filp, void *cookie, filldir_t filldir)
         }
 	filp->f_version = inode->i_version;
 #ifdef HAVE_TOUCH_ATIME_1ARG
+#ifdef HAVE_F_PATH_MNT
+	path.mnt = filp->f_path.mnt;
+#else
 	path.mnt = filp->f_vfsmnt;
+#endif
 	path.dentry = filp->f_dentry;
 	touch_atime(&path);
 #else
-- 
1.8.1.5