You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-emulation/vmware-modules/files/304-4.2-00-inode_op.patch

46 lines
1.6 KiB

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)