1 diff -ur open-vm-tools-9.4.6-1770165.orig/modules/linux/shared/compat_fs.h open-vm-tools-9.4.6-1770165/modules/linux/shared/compat_fs.h
2 --- open-vm-tools-9.4.6-1770165.orig/modules/linux/shared/compat_fs.h 2014-07-02 00:21:14.000000000 +0200
3 +++ open-vm-tools-9.4.6-1770165/modules/linux/shared/compat_fs.h 2014-08-25 22:33:18.134858340 +0200
5 * changed over time, so for simplicity, we'll only enable it from 2.6.19 and
8 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
9 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) && \
10 + LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
14 diff -ur open-vm-tools-9.4.6-1770165.orig/modules/linux/shared/compat_netdevice.h open-vm-tools-9.4.6-1770165/modules/linux/shared/compat_netdevice.h
15 --- open-vm-tools-9.4.6-1770165.orig/modules/linux/shared/compat_netdevice.h 2014-07-02 00:21:14.000000000 +0200
16 +++ open-vm-tools-9.4.6-1770165/modules/linux/shared/compat_netdevice.h 2014-08-25 22:28:49.471534485 +0200
18 typedef u32 compat_netdev_features_t;
21 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) || defined(SET_ETHTOOL_OPS)
22 +#define VMW_HAVE_ETHTOOL_OPS 1
25 #endif /* __COMPAT_NETDEVICE_H__ */
26 diff -ur open-vm-tools-9.4.6-1770165.orig/modules/linux/vmhgfs/file.c open-vm-tools-9.4.6-1770165/modules/linux/vmhgfs/file.c
27 --- open-vm-tools-9.4.6-1770165.orig/modules/linux/vmhgfs/file.c 2014-08-25 22:27:54.758203080 +0200
28 +++ open-vm-tools-9.4.6-1770165/modules/linux/vmhgfs/file.c 2014-08-25 22:33:18.134858340 +0200
33 -#if defined VMW_USE_AIO
35 .aio_read = HgfsAioRead,
36 .aio_write = HgfsAioWrite,
38 +#else /* !VMW_USE_AIO */
39 +# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
40 + .read_iter = generic_file_read_iter,
41 + .write_iter = generic_file_write_iter,
46 +#endif /* !VMW_USE_AIO */
49 .release = HgfsRelease,
58 *----------------------------------------------------------------------
60 LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRead: invalid dentry\n"));
64 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
65 + result = new_sync_read(file, buf, count, offset);
67 result = generic_file_read(file, buf, count, offset);
76 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
77 + result = new_sync_write(file, buf, count, offset);
79 result = generic_file_write(file, buf, count, offset);
84 diff -ur open-vm-tools-9.4.6-1770165.orig/modules/linux/vmhgfs/file.c.orig open-vm-tools-9.4.6-1770165/modules/linux/vmhgfs/file.c.orig
85 --- open-vm-tools-9.4.6-1770165.orig/modules/linux/vmhgfs/file.c.orig 2014-08-25 22:27:54.758203080 +0200
86 +++ open-vm-tools-9.4.6-1770165/modules/linux/vmhgfs/file.c.orig 2014-08-25 22:32:31.411526655 +0200
88 static int HgfsOpen(struct inode *inode,
90 #if defined VMW_USE_AIO
91 +# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
92 static ssize_t HgfsAioRead(struct kiocb *iocb,
93 const struct iovec *iov,
94 unsigned long numSegs,
96 const struct iovec *iov,
97 unsigned long numSegs,
101 static ssize_t HgfsRead(struct file *file,
103 @@ -128,13 +130,18 @@
104 .owner = THIS_MODULE,
107 -#if defined VMW_USE_AIO
109 +# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
110 + .read_iter = generic_file_read_iter,
111 + .write_iter = generic_file_write_iter,
113 .aio_read = HgfsAioRead,
114 .aio_write = HgfsAioWrite,
117 +#else /* !VMW_USE_AIO */
121 +#endif /* !VMW_USE_AIO */
124 .release = HgfsRelease,
126 iparent = dparent->d_inode;
128 HgfsSetUidGid(iparent, file->f_dentry,
129 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0)
130 current_fsuid(), current_fsgid());
132 + from_kuid(&init_user_ns, current_fsuid()),
133 + from_kgid(&init_user_ns,current_fsgid()));
141 #if defined VMW_USE_AIO
142 +# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
144 *----------------------------------------------------------------------
151 +# endif /* if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0) */
154 *----------------------------------------------------------------------
155 diff -ur open-vm-tools-9.4.6-1770165.orig/modules/linux/vmxnet/vmxnet.c open-vm-tools-9.4.6-1770165/modules/linux/vmxnet/vmxnet.c
156 --- open-vm-tools-9.4.6-1770165.orig/modules/linux/vmxnet/vmxnet.c 2014-07-02 00:21:14.000000000 +0200
157 +++ open-vm-tools-9.4.6-1770165/modules/linux/vmxnet/vmxnet.c 2014-08-25 22:28:49.471534485 +0200
163 -#ifdef SET_ETHTOOL_OPS
164 +#ifdef VMW_HAVE_ETHTOOL_OPS
166 *----------------------------------------------------------------------------
172 -#else /* !defined(SET_ETHTOOL_OPS) */
173 +#else /* !defined(VMW_HAVE_ETHTOOL_OPS) */
181 -#endif /* SET_ETHTOOL_OPS */
182 +#endif /* !defined(VMW_HAVE_ETHTOOL_OPS) */
186 @@ -1142,8 +1141,12 @@
187 dev->watchdog_timeo = VMXNET_WATCHDOG_TIMEOUT;
190 -#ifdef SET_ETHTOOL_OPS
191 +#ifdef VMW_HAVE_ETHTOOL_OPS
192 +# ifdef SET_ETHTOOL_OPS
193 SET_ETHTOOL_OPS(dev, &vmxnet_ethtool_ops);
195 + dev->ethtool_ops = &vmxnet_ethtool_ops;
198 dev->do_ioctl = vmxnet_ioctl;