Skip to content

Instantly share code, notes, and snippets.

@sjmh
Last active August 29, 2015 14:19
Show Gist options
  • Save sjmh/5b8280223f4c58711fa2 to your computer and use it in GitHub Desktop.
Save sjmh/5b8280223f4c58711fa2 to your computer and use it in GitHub Desktop.
VMware Tools hgfs patch for RHEL6 kernel 3.10.0-123
--- inode.c 2014-03-21 15:37:16.000000000 -0700
+++ inode.c-new 2014-07-17 14:20:50.202233706 -0700
@@ -31,6 +31,9 @@
#include <linux/namei.h>
#endif
#include <linux/highmem.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
+#include <linux/dcache.h>
+#endif
#include "compat_cred.h"
#include "compat_dcache.h"
@@ -1923,7 +1926,11 @@ HgfsPermission(struct inode *inode,
#endif
&inode->i_dentry,
d_alias) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
+ int dcount = d_count(dentry);
+#else
int dcount = hgfs_d_count(dentry);
+#endif
if (dcount) {
LOG(4, ("Found %s %d \n", dentry->d_name.name, dcount));
return HgfsAccessInt(dentry, mask & (MAY_READ | MAY_WRITE | MAY_EXEC));
@@ -1976,7 +1983,11 @@ HgfsPermission(struct inode *inode,
list_for_each(pos, &inode->i_dentry) {
int dcount;
struct dentry *dentry = list_entry(pos, struct dentry, d_alias);
- dcount = hgfs_d_count(dentry);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
+ dcount = d_count(entry);
+#else
+ dcount = compat_d_count(dentry);
+#endif
if (dcount) {
LOG(4, ("Found %s %d \n", (dentry)->d_name.name, dcount));
return HgfsAccessInt(dentry, mask & (MAY_READ | MAY_WRITE | MAY_EXEC));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment