updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / vmware-patch / vmnet-2.6.39.diff
blobfeef12cb2c9b44c66847a02f92d182683cb2a394
1 diff -u -r vmnet-only/driver.c vmnet-only/driver.c
2 --- vmnet-only/driver.c 2011-03-26 06:37:29.000000000 +0100
3 +++ vmnet-only/driver.c 2011-04-02 14:14:57.000000000 +0200
4 @@ -28,7 +28,6 @@
5 #include <linux/poll.h>
7 #include <linux/smp.h>
8 -#include <linux/smp_lock.h>
10 #include <linux/netdevice.h>
11 #include <linux/etherdevice.h>
12 @@ -105,7 +104,7 @@
13 * not have vnetStructureMutex already acquired,
14 * it is most certainly a bug.
16 -static rwlock_t vnetPeerLock = RW_LOCK_UNLOCKED;
17 +static DEFINE_RWLOCK(vnetPeerLock);
20 * All concurrent changes to the network structure are
21 @@ -115,6 +114,7 @@
22 * vnetStructureMutex and vnetPeerLock for write.
24 compat_define_mutex(vnetStructureMutex);
25 +compat_define_mutex(vnetMutex);
27 #if defined(VM_X86_64) && !defined(HAVE_COMPAT_IOCTL)
29 @@ -264,11 +264,11 @@
30 struct file * filp) // IN:
32 int ret = -ENOTTY;
33 - lock_kernel();
34 + compat_mutex_lock(&vnetMutex);
35 if (filp && filp->f_op && filp->f_op->ioctl == VNetFileOpIoctl) {
36 ret = VNetFileOpIoctl(filp->f_dentry->d_inode, filp, iocmd, ioarg);
38 - unlock_kernel();
39 + compat_mutex_unlock(&vnetMutex);
40 return ret;
43 @@ -1134,9 +1134,9 @@
44 if (filp && filp->f_dentry) {
45 inode = filp->f_dentry->d_inode;
47 - lock_kernel();
48 + compat_mutex_lock(&vnetMutex);
49 err = VNetFileOpIoctl(inode, filp, iocmd, ioarg);
50 - unlock_kernel();
51 + compat_mutex_unlock(&vnetMutex);
52 return err;
54 #endif
55 diff -u -r vmnet-only/filter.c vmnet-only/filter.c
56 --- vmnet-only/filter.c 2011-03-26 06:37:29.000000000 +0100
57 +++ vmnet-only/filter.c 2011-04-02 14:16:50.000000000 +0200
58 @@ -85,7 +85,7 @@
59 * callbacks can be concurrently executing on multiple threads on multiple
60 * CPUs, so we should revisit locking for allowing for that in the future.
62 -spinlock_t activeRuleLock = SPIN_LOCK_UNLOCKED;
63 +DEFINE_SPINLOCK(activeRuleLock);
66 * Logging.
67 diff -u -r vmnet-only/hub.c vmnet-only/hub.c
68 --- vmnet-only/hub.c 2011-03-26 06:37:29.000000000 +0100
69 +++ vmnet-only/hub.c 2011-04-02 14:15:56.000000000 +0200
70 @@ -81,7 +81,7 @@
71 * so we use __attribute__((unused)) to quiet the compiler.
74 -static spinlock_t vnetHubLock __attribute__((unused)) = SPIN_LOCK_UNLOCKED;
75 +static DEFINE_SPINLOCK(vnetHubLock);