forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
304-4.2-00-inode_op.patch
45 lines (42 loc) · 1.58 KB
/
304-4.2-00-inode_op.patch
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
diff -rupN vmblock-only/linux/inode.c vmblock-only.new/linux/inode.c
--- vmblock-only/linux/inode.c 2016-03-16 21:24:25.771034759 -0400
+++ vmblock-only.new/linux/inode.c 2016-03-16 21:26:22.697036311 -0400
@@ -44,7 +44,9 @@ static struct dentry *InodeOpLookup(stru
static int InodeOpReadlink(struct dentry *, char __user *, int);
#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
+static const char *InodeOpFollowlink(struct dentry *dentry, void **cookie);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
static void *InodeOpFollowlink(struct dentry *dentry, struct nameidata *nd);
#else
static int InodeOpFollowlink(struct dentry *dentry, struct nameidata *nd);
@@ -220,7 +222,9 @@ InodeOpReadlink(struct dentry *dentry,
*
*----------------------------------------------------------------------------
*/
-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
+static const char *InodeOpFollowlink(struct dentry *dentry, void **cookie)
+#else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
static void *
#else
@@ -228,6 +232,7 @@ static int
#endif
InodeOpFollowlink(struct dentry *dentry, // IN : dentry of symlink
struct nameidata *nd) // OUT: stores result
+#endif
{
int ret;
VMBlockInodeInfo *iinfo;
@@ -244,7 +249,11 @@ InodeOpFollowlink(struct dentry *dentry,
goto out;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
+ return *cookie = (char *)(iinfo->name);
+#else
nd_set_link(nd, iinfo->name);
+#endif
out:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)