diff -u -r source-orig/vmblock-only/linux/dentry.c source/vmblock-only/linux/dentry.c
--- source-orig/vmblock-only/linux/dentry.c	2011-03-26 04:03:06.000000000 +0100
+++ source/vmblock-only/linux/dentry.c	2011-05-27 07:32:17.000000000 +0200
@@ -104,7 +104,11 @@
       return actualDentry->d_op->d_revalidate(actualDentry, nd);
    }
 
-   if (path_lookup(iinfo->name, 0, &actualNd)) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
+   if (compat_path_lookup(iinfo->name, 0, &actualNd)) {
+#else
+   if (kern_path(iinfo->name, 0, &(actualNd.path))) {
+#endif
       LOG(4, "DentryOpRevalidate: [%s] no longer exists\n", iinfo->name);
       return 0;
    }
diff -u -r source-orig/vmblock-only/linux/filesystem.c source/vmblock-only/linux/filesystem.c
--- source-orig/vmblock-only/linux/filesystem.c	2011-03-26 04:03:06.000000000 +0100
+++ source/vmblock-only/linux/filesystem.c	2011-05-30 10:20:50.000000000 +0200
@@ -44,9 +44,14 @@
 /* File system operations */
 
 #if defined(VMW_GETSB_2618)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
 static int FsOpGetSb(struct file_system_type *fsType, int flags,
                      const char *devName, void *rawData, struct vfsmount *mnt);
 #else
+static struct dentry *FsOpMount(struct file_system_type *fsType, int flags,
+                     const char *devName, void *rawData);
+#endif
+#else
 static struct super_block *FsOpGetSb(struct file_system_type *fsType, int flags,
                                      const char *devName, void *rawData);
 #endif
@@ -66,7 +71,11 @@
 static struct file_system_type fsType = {
    .owner = THIS_MODULE,
    .name = VMBLOCK_FS_NAME,
+   #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
    .get_sb = FsOpGetSb,
+   #else
+   .mount = FsOpMount,
+   #endif
    .kill_sb = kill_anon_super,
 };
 
@@ -336,7 +345,11 @@
       goto error_inode;
    }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
    if (compat_path_lookup(iinfo->name, 0, &actualNd)) {
+#else
+   if (kern_path(iinfo->name, 0, &(actualNd.path))) {
+#endif
       /*
        * This file does not exist, so we create an inode that doesn't know
        * about its underlying file.  Operations that create files and
@@ -533,18 +546,17 @@
    return 0;
 }
 
-
 #if defined(VMW_GETSB_2618)
 /*
  *-----------------------------------------------------------------------------
  *
- * FsOpGetSb --
+ * FsOpGetSb/FsOpMount --
  *
  *    Invokes generic kernel code to prepare superblock for
  *    deviceless filesystem.
  *
  * Results:
- *    0 on success
+ *    0/dentry on success
  *    negative error code on failure
  *
  * Side effects:
@@ -552,7 +564,7 @@
  *
  *-----------------------------------------------------------------------------
  */
-
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)
 static int
 FsOpGetSb(struct file_system_type *fs_type, // IN: file system type of mount
           int flags,                        // IN: mount flags
@@ -563,6 +575,16 @@
    return get_sb_nodev(fs_type, flags, rawData, FsOpReadSuper, mnt);
 }
 #else
+struct dentry *
+FsOpMount(struct file_system_type *fs_type, // IN: file system type of mount
+          int flags,                        // IN: mount flags
+          const char *dev_name,             // IN: device mounting on
+          void *rawData)                    // IN: mount arguments
+{
+   return mount_nodev(fs_type, flags, rawData, FsOpReadSuper);
+}
+#endif
+#else
 /*
  *-----------------------------------------------------------------------------
  *
diff -u -r source-orig/vmci-only/linux/driver.c source/vmci-only/linux/driver.c
--- source-orig/vmci-only/linux/driver.c	2011-03-26 06:37:32.000000000 +0100
+++ source/vmci-only/linux/driver.c	2011-04-02 13:32:12.000000000 +0200
@@ -42,7 +42,6 @@
 #include <linux/miscdevice.h>
 #include <linux/poll.h>
 #include <linux/smp.h>
-#include <linux/smp_lock.h>
 
 #include "compat_file.h"
 #include "compat_highmem.h"
diff -u -r source-orig/vmmon-only/linux/driver.c source/vmmon-only/linux/driver.c
--- source-orig/vmmon-only/linux/driver.c	2011-03-26 06:37:28.000000000 +0100
+++ source/vmmon-only/linux/driver.c	2011-04-02 13:26:59.000000000 +0200
@@ -780,7 +780,7 @@
 
 
 #define POLLQUEUE_MAX_TASK 1000
-static spinlock_t pollQueueLock __attribute__((unused)) = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(pollQueueLock);
 static void *pollQueue[POLLQUEUE_MAX_TASK];
 static unsigned int pollQueueCount = 0;
 
@@ -1041,7 +1041,8 @@
 		* but unfortunately there is no way how to detect that
 		* we are building for RedHat's kernel...
 		*/
-	       static spinlock_t timerLock = SPIN_LOCK_UNLOCKED;
+
+	       static DEFINE_SPINLOCK(timerLock);
 
 	       spin_lock(&timerLock);
 	       mod_timer(&linuxState.pollTimer, jiffies + 1);
diff -u -r source-orig/vmmon-only/linux/hostif.c source/vmmon-only/linux/hostif.c
--- source-orig/vmmon-only/linux/hostif.c	2011-03-26 06:37:27.000000000 +0100
+++ source/vmmon-only/linux/hostif.c	2011-04-02 13:27:58.000000000 +0200
@@ -46,7 +46,6 @@
 #include <linux/mman.h>
 
 #include <linux/smp.h>
-#include <linux/smp_lock.h>
 
 #include <asm/io.h>
 #include <linux/mc146818rtc.h>
diff -u -r source-orig/vmmon-only/linux/iommu.c source/vmmon-only/linux/iommu.c
--- source-orig/vmmon-only/linux/iommu.c	2011-03-26 06:37:27.000000000 +0100
+++ source/vmmon-only/linux/iommu.c	2011-04-02 13:28:58.000000000 +0200
@@ -44,7 +44,7 @@
 
 
 static LIST_HEAD(passthruDeviceList);
-static spinlock_t passthruDeviceListLock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(passthruDeviceListLock);
 static void *pciHolePage = NULL;
 
 /*
diff -u -r source-orig/vmnet-only/compat_netdevice.h source/vmnet-only/compat_netdevice.h
--- source-orig/vmnet-only/compat_netdevice.h	2011-03-26 06:37:29.000000000 +0100
+++ source/vmnet-only/compat_netdevice.h	2011-08-10 08:17:57.000000000 +0200
@@ -47,6 +47,19 @@
 #   define net_device device
 #endif
 
+/* it looks like these have been removed from the kernel 3.1
+ * probably because the "transition" is considered complete.
+ * so to keep this source compatible we just redefine them like they were
+ * previously
+ */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 41, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
+#define HAVE_ALLOC_NETDEV		/* feature macro: alloc_xxxdev
+					   functions are available. */
+#define HAVE_FREE_NETDEV		/* free_netdev() */
+#define HAVE_NETDEV_PRIV		/* netdev_priv() */
+#define HAVE_NETIF_QUEUE
+#define HAVE_NET_DEVICE_OPS
+#endif
 
 /*
  * SET_MODULE_OWNER appeared sometime during 2.3.x. It was setting
diff -u -r source-orig/vmnet-only/driver.c source/vmnet-only/driver.c
--- source-orig/vmnet-only/driver.c	2011-03-26 06:37:29.000000000 +0100
+++ source/vmnet-only/driver.c	2011-04-02 14:14:57.000000000 +0200
@@ -28,7 +28,6 @@
 #include <linux/poll.h>
 
 #include <linux/smp.h>
-#include <linux/smp_lock.h>
 
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
@@ -105,7 +104,7 @@
  * not have vnetStructureMutex already acquired,
  * it is most certainly a bug.
  */
-static rwlock_t vnetPeerLock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(vnetPeerLock);
 
 /*
  * All concurrent changes to the network structure are
@@ -115,6 +114,7 @@
  * vnetStructureMutex and vnetPeerLock for write.
  */
 compat_define_mutex(vnetStructureMutex);
+compat_define_mutex(vnetMutex);
 
 #if defined(VM_X86_64) && !defined(HAVE_COMPAT_IOCTL)
 /*
@@ -264,11 +264,11 @@
 			    struct file * filp)  // IN:
 {
    int ret = -ENOTTY;
-   lock_kernel();
+   compat_mutex_lock(&vnetMutex);
    if (filp && filp->f_op && filp->f_op->ioctl == VNetFileOpIoctl) {
       ret = VNetFileOpIoctl(filp->f_dentry->d_inode, filp, iocmd, ioarg);
    }
-   unlock_kernel();
+   compat_mutex_unlock(&vnetMutex);
    return ret;
 }
 
@@ -1134,9 +1134,9 @@
    if (filp && filp->f_dentry) {
       inode = filp->f_dentry->d_inode;
    }
-   lock_kernel();
+   compat_mutex_lock(&vnetMutex);
    err = VNetFileOpIoctl(inode, filp, iocmd, ioarg);
-   unlock_kernel();
+   compat_mutex_unlock(&vnetMutex);
    return err;
 }
 #endif
diff -u -r source-orig/vmnet-only/filter.c source/vmnet-only/filter.c
--- source-orig/vmnet-only/filter.c	2011-03-26 06:37:29.000000000 +0100
+++ source/vmnet-only/filter.c	2011-04-02 14:16:50.000000000 +0200
@@ -85,7 +85,7 @@
  * callbacks can be concurrently executing on multiple threads on multiple
  * CPUs, so we should revisit locking for allowing for that in the future.
  */
-spinlock_t activeRuleLock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(activeRuleLock);
 
 /*
  * Logging.
diff -u -r source-orig/vmnet-only/hub.c source/vmnet-only/hub.c
--- source-orig/vmnet-only/hub.c	2011-03-26 06:37:29.000000000 +0100
+++ source/vmnet-only/hub.c	2011-04-02 14:15:56.000000000 +0200
@@ -81,7 +81,7 @@
  * so we use __attribute__((unused)) to quiet the compiler.
  */
 
-static spinlock_t vnetHubLock __attribute__((unused)) = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(vnetHubLock);
 
 
 /*
diff -u -r source-orig/vsock-only/linux/af_vsock.c source/vsock-only/linux/af_vsock.c
--- source-orig/vsock-only/linux/af_vsock.c	2011-03-26 04:03:08.000000000 +0100
+++ source/vsock-only/linux/af_vsock.c	2011-04-02 13:33:39.000000000 +0200
@@ -102,7 +102,6 @@
 #include <linux/miscdevice.h>
 #include <linux/poll.h>
 #include <linux/smp.h>
-#include <linux/smp_lock.h>
 #include <asm/io.h>
 #if defined(__x86_64__) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12)
 #   if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
diff -u -r source-orig/vsock-only/linux/util.c source/vsock-only/linux/util.c
--- source-orig/vsock-only/linux/util.c	2011-03-26 04:03:08.000000000 +0100
+++ source/vsock-only/linux/util.c	2011-04-02 13:35:45.000000000 +0200
@@ -34,7 +34,7 @@
 struct list_head vsockBindTable[VSOCK_HASH_SIZE + 1];
 struct list_head vsockConnectedTable[VSOCK_HASH_SIZE];
 
-spinlock_t vsockTableLock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(vsockTableLock);
 
 /*
  * snprintf() wasn't exported until 2.4.10: fall back on sprintf in those
diff -u -r source30//vmmon-only/linux/iommu.c source/vmmon-only/linux/iommu.c
--- source30//vmmon-only/linux/iommu.c	2011-08-23 02:11:45.000000000 +0200
+++ source/vmmon-only/linux/iommu.c	2011-11-09 15:19:36.000000000 +0100
@@ -42,6 +42,12 @@
 #define PCI_BDF_SLOTFUNC(bdf) PCI_DEVFN(PCI_SLOT(bdf), PCI_FUNC(bdf))
 #define PCI_BDF_BUS(bdf)      (((bdf) >> 8) & 0xff)
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 42, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
+#include <linux/pci.h>
+#define iommu_found() iommu_present(&pci_bus_type)
+#define iommu_domain_alloc() iommu_domain_alloc(&pci_bus_type)
+#endif
+
 typedef struct PassthruDevice {
    uint32 bdf;
    struct pci_dev *pdev;
diff -u -r source30//vmnet-only/filter.c source/vmnet-only/filter.c
--- source30//vmnet-only/filter.c	2011-08-23 02:11:47.000000000 +0200
+++ source/vmnet-only/filter.c	2011-11-09 15:57:12.000000000 +0100
@@ -40,6 +40,10 @@
 #include "vnetInt.h"
 #include "vmnetInt.h"
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
+#include <linux/export.h>
+#endif
+
 // VNet_FilterLogPacket.action for dropped packets
 #define VNET_FILTER_ACTION_DRP         (1)
 #define VNET_FILTER_ACTION_DRP_SHORT   (2)
diff -u -r source30//vmnet-only/netif.c source/vmnet-only/netif.c
--- source30//vmnet-only/netif.c	2011-08-23 02:11:47.000000000 +0200
+++ source/vmnet-only/netif.c	2011-11-09 15:53:30.000000000 +0100
@@ -62,7 +62,9 @@
 static int  VNetNetifStartXmit(struct sk_buff *skb, struct net_device *dev);
 static struct net_device_stats *VNetNetifGetStats(struct net_device *dev);
 static int  VNetNetifSetMAC(struct net_device *dev, void *addr);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 42, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
 static void VNetNetifSetMulticast(struct net_device *dev);
+#endif
 #if 0
 static void VNetNetifTxTimeout(struct net_device *dev);
 #endif
@@ -131,7 +133,9 @@
       .ndo_stop = VNetNetifClose,
       .ndo_get_stats = VNetNetifGetStats,
       .ndo_set_mac_address = VNetNetifSetMAC,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
       .ndo_set_multicast_list = VNetNetifSetMulticast,
+#endif
       /*
        * We cannot stuck... If someone will report problems under
        * low memory conditions or some such, we should enable it.
@@ -625,11 +629,12 @@
  *----------------------------------------------------------------------
  */
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 42, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
 void
 VNetNetifSetMulticast(struct net_device *dev) // IN: unused
 {
 }
-
+#endif
 
 /*
  *----------------------------------------------------------------------
diff -u -r source30//vmnet-only/userif.c source/vmnet-only/userif.c
--- source30//vmnet-only/userif.c	2011-08-23 02:11:46.000000000 +0200
+++ source/vmnet-only/userif.c	2011-11-09 16:21:20.000000000 +0100
@@ -517,10 +517,18 @@
 	 unsigned int tmpCsum;
 	 const void *vaddr;
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 42, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
+	 vaddr = kmap(skb_frag_page(frag));
+#else
 	 vaddr = kmap(frag->page);
+#endif
 	 tmpCsum = csum_and_copy_to_user(vaddr + frag->page_offset,
 					 curr, frag->size, 0, &err);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 42, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
+	 kunmap(skb_frag_page(frag));
+#else
 	 kunmap(frag->page);
+#endif
 	 if (err) {
 	    return err;
 	 }
