open-vm-tools/0004-Use-new-link-helpers.patch
Dominique Leuenberger de200b6f0e - Sync up patches with ArchLinux:
+ Added 0001-Remove-unused-DEPRECATED-macro.patch
  + Added 0002-Conditionally-define-g_info-macro.patch
  + Added 0003-Add-kuid_t-kgid_t-compatibility-layer.patch
  + Added 0004-Use-new-link-helpers.patch
  + Added 0005-Update-hgfs-file-operations-for-newer-kernels.patch
  + Added 0006-Fix-vmxnet-module-on-kernels-3.16.patch
  + Added 0007-Fix-vmhgfs-module-on-kernels-3.16.patch
  + Added 0008-Fix-segfault-in-vmhgfs.patch
  + Droped g_info_redefine.patch (now named
    0002-Conditionally-define-g_info-macro.patch).
- Enable building of KMP packages.
- Fix bashisms in preun script.
- Do not generate timestamps in the doxygen docs.

OBS-URL: https://build.opensuse.org/package/show/Virtualization:VMware/open-vm-tools?expand=0&rev=267
2014-11-10 16:06:43 +00:00

54 lines
1.9 KiB
Diff

From 20437d731289126ee5363a6f73e4171d39f2e3d9 Mon Sep 17 00:00:00 2001
From: "Scott M. Kroll" <skroll@gmail.com>
Date: Mon, 14 Jul 2014 11:32:35 -0400
Subject: [PATCH 4/5] Use new link helpers
* vfs_follow_link was removed in 3.12.
* vfs_readlink was removed in 3.15.
---
open-vm-tools/modules/linux/vmhgfs/link.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/open-vm-tools/modules/linux/vmhgfs/link.c b/open-vm-tools/modules/linux/vmhgfs/link.c
index 9fb95a5..06ea953 100644
--- a/open-vm-tools/modules/linux/vmhgfs/link.c
+++ b/open-vm-tools/modules/linux/vmhgfs/link.c
@@ -110,9 +110,15 @@ HgfsFollowlink(struct dentry *dentry, // IN: Dentry containing link
"on something that wasn't a symlink\n"));
error = -EINVAL;
} else {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
+ LOG(6, (KERN_DEBUG "VMware hgfs: HgfsFollowlink: calling "
+ "nd_set_link\n"));
+ nd_set_link(nd, fileName);
+#else
LOG(6, (KERN_DEBUG "VMware hgfs: HgfsFollowlink: calling "
"vfs_follow_link\n"));
error = vfs_follow_link(nd, fileName);
+#endif
}
kfree(fileName);
}
@@ -172,9 +178,18 @@ HgfsReadlink(struct dentry *dentry, // IN: Dentry containing link
"on something that wasn't a symlink\n"));
error = -EINVAL;
} else {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
+ LOG(6, (KERN_DEBUG "VMware hgfs: HgfsReadlink: calling "
+ "readlink_copy\n"));
+ LOG(6, (KERN_DEBUG "VMware hgfs: %s: calling "
+ "readlink_copy\n",
+ __func__));
+ error = readlink_copy(buffer, buflen, fileName);
+#else
LOG(6, (KERN_DEBUG "VMware hgfs: HgfsReadlink: calling "
"vfs_readlink\n"));
error = vfs_readlink(dentry, buffer, buflen, fileName);
+#endif
}
kfree(fileName);
}
--
2.0.1