]> git.pld-linux.org Git - packages/open-vm-tools.git/blob - open-vm-tools-linux-3.16.patch
cad38046c59865c08b55c1a027ee1bdff6462cd1
[packages/open-vm-tools.git] / open-vm-tools-linux-3.16.patch
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
4 @@ -89,7 +89,8 @@
5   * changed over time, so for simplicity, we'll only enable it from 2.6.19 and
6   * on.
7   */
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)
11  # define VMW_USE_AIO
12  #endif
13  
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
17 @@ -337,4 +337,8 @@
18  typedef u32 compat_netdev_features_t;
19  #endif
20  
21 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) || defined(SET_ETHTOOL_OPS)
22 +#define VMW_HAVE_ETHTOOL_OPS 1
23 +#endif
24 +
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
29 @@ -128,13 +128,17 @@
30     .owner      = THIS_MODULE,
31     .open       = HgfsOpen,
32     .llseek     = HgfsSeek,
33 -#if defined VMW_USE_AIO
34 +#ifdef VMW_USE_AIO
35     .aio_read   = HgfsAioRead,
36     .aio_write  = HgfsAioWrite,
37 -#else
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,
42 +# endif
43     .read       = HgfsRead,
44     .write      = HgfsWrite,
45 -#endif
46 +#endif /* !VMW_USE_AIO */
47     .fsync      = HgfsFsync,
48     .mmap       = HgfsMmap,
49     .release    = HgfsRelease,
50 @@ -822,8 +826,6 @@
51    out:
52     return result;
53  }
54 -
55 -
56  #else
57  /*
58   *----------------------------------------------------------------------
59 @@ -865,8 +867,11 @@
60        LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRead: invalid dentry\n"));
61        goto out;
62     }
63 -
64 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
65 +   result = new_sync_read(file, buf, count, offset);
66 +#else
67     result = generic_file_read(file, buf, count, offset);
68 +#endif
69    out:
70     return result;
71  }
72 @@ -917,7 +922,11 @@
73        goto out;
74     }
75  
76 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
77 +   result = new_sync_write(file, buf, count, offset);
78 +#else
79     result = generic_file_write(file, buf, count, offset);
80 +#endif
81    out:
82     return result;
83  }
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
87 @@ -64,6 +64,7 @@
88  static int HgfsOpen(struct inode *inode,
89                      struct file *file);
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,
95 @@ -72,6 +73,7 @@
96                              const struct iovec *iov,
97                              unsigned long numSegs,
98                              loff_t offset);
99 +#  endif
100  #else
101  static ssize_t HgfsRead(struct file *file,
102                          char __user *buf,
103 @@ -128,13 +130,18 @@
104     .owner      = THIS_MODULE,
105     .open       = HgfsOpen,
106     .llseek     = HgfsSeek,
107 -#if defined VMW_USE_AIO
108 +#ifdef 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,
112 +#   else
113     .aio_read   = HgfsAioRead,
114     .aio_write  = HgfsAioWrite,
115 -#else
116 +#   endif
117 +#else /* !VMW_USE_AIO */
118     .read       = HgfsRead,
119     .write      = HgfsWrite,
120 -#endif
121 +#endif /* !VMW_USE_AIO */
122     .fsync      = HgfsFsync,
123     .mmap       = HgfsMmap,
124     .release    = HgfsRelease,
125 @@ -658,7 +665,12 @@
126              iparent = dparent->d_inode;
127  
128              HgfsSetUidGid(iparent, file->f_dentry,
129 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0)
130                            current_fsuid(), current_fsgid());
131 +#else
132 +                          from_kuid(&init_user_ns, current_fsuid()),
133 +                          from_kgid(&init_user_ns,current_fsgid()));
134 +#endif
135  
136              dput(dparent);
137           }
138 @@ -724,6 +736,7 @@
139  
140  
141  #if defined VMW_USE_AIO
142 +#  if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
143  /*
144   *----------------------------------------------------------------------
145   *
146 @@ -818,7 +831,7 @@
147     return result;
148  }
149  
150 -
151 +#   endif /* if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0) */
152  #else
153  /*
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
158 @@ -283,8 +283,7 @@
159  
160  #endif
161  
162 -
163 -#ifdef SET_ETHTOOL_OPS
164 +#ifdef VMW_HAVE_ETHTOOL_OPS
165  /*
166   *----------------------------------------------------------------------------
167   *
168 @@ -530,7 +529,7 @@
169  };
170  
171  
172 -#else   /* !defined(SET_ETHTOOL_OPS) */
173 +#else   /* !defined(VMW_HAVE_ETHTOOL_OPS) */
174  
175  
176  /*
177 @@ -743,7 +742,7 @@
178     }
179     return -EOPNOTSUPP;
180  }
181 -#endif /* SET_ETHTOOL_OPS */
182 +#endif /* !defined(VMW_HAVE_ETHTOOL_OPS) */
183  
184  
185  /*
186 @@ -1142,8 +1141,12 @@
187     dev->watchdog_timeo = VMXNET_WATCHDOG_TIMEOUT;
188  #endif
189  
190 -#ifdef SET_ETHTOOL_OPS
191 +#ifdef VMW_HAVE_ETHTOOL_OPS
192 +#  ifdef SET_ETHTOOL_OPS
193     SET_ETHTOOL_OPS(dev, &vmxnet_ethtool_ops);
194 +#  else
195 +   dev->ethtool_ops = &vmxnet_ethtool_ops;
196 +#  endif
197  #else
198     dev->do_ioctl = vmxnet_ioctl;
199  #endif
This page took 0.403994 seconds and 2 git commands to generate.