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
5 #include <linux/poll.h>
8 -#include <linux/smp_lock.h>
10 #include <linux/netdevice.h>
11 #include <linux/etherdevice.h>
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
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)
30 struct file * filp) // IN:
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);
39 + compat_mutex_unlock(&vnetMutex);
44 if (filp && filp->f_dentry) {
45 inode = filp->f_dentry->d_inode;
48 + compat_mutex_lock(&vnetMutex);
49 err = VNetFileOpIoctl(inode, filp, iocmd, ioarg);
51 + compat_mutex_unlock(&vnetMutex);
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
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);
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
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);