diff -Nur vmhgfs-only.orig/compat_slab.h vmhgfs-only/compat_slab.h
--- vmhgfs-only.orig/compat_slab.h	2008-01-17 06:17:15.000000000 +0100
+++ vmhgfs-only/compat_slab.h	2008-04-27 13:11:47.000000000 +0200
@@ -50,4 +50,21 @@
 		kmem_cache_create(name, size, align, flags, ctor)
 #endif
 
+/*
+ * Up to 2.6.23 kmem_cache constructor has three arguments - pointer to block to
+ * prepare (aka "this"), from which cache it came, and some unused flags.  After
+ * 2.6.23 flags were removed, and order of "this" and cache parameters was swapped...
+ *
+ * Backported from open-vm-tools
+ * by Alexander Griesser <work@tuxx-home.at>, 2008-04-27
+ */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23) && !defined(VMW_KMEMCR_CTOR_HAS_3_ARGS)
+#  define VMW_KMEMCR_CTOR_HAS_3_ARGS
+#endif
+#ifdef VMW_KMEMCR_CTOR_HAS_3_ARGS
+typedef void compat_kmem_cache_ctor(void *, compat_kmem_cache *, unsigned long);
+#else
+typedef void compat_kmem_cache_ctor(compat_kmem_cache *, void *);
+#endif
+
 #endif /* __COMPAT_SLAB_H__ */
diff -Nur vmhgfs-only.orig/driver-config.h vmhgfs-only/driver-config.h
--- vmhgfs-only.orig/driver-config.h	2008-01-17 06:17:15.000000000 +0100
+++ vmhgfs-only/driver-config.h	2008-04-27 12:54:42.000000000 +0200
@@ -35,6 +35,23 @@
 #include <linux/autoconf.h>
 #include "compat_version.h"
 
+/*
+ * I still haven't figured out why the automagic checks in Makefile.kernel
+ * don't work. They call the script vm_check_build which isn't available
+ * on any of my systems so `make` is unable to find out whether this features
+ * need to be included or not.
+ *
+ * A simple workaround is to rely on the kernel configuration as shown below.
+ * If CONFIG_EPOLL is set, we have EPOLL set, basta.
+ *
+ * by Alexander Griesser <work@tuxx-home.at>, 2008-03-14
+ */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
+#ifdef CONFIG_EPOLL
+#define VMW_HAVE_EPOLL 1
+#endif
+#endif
+
 /* We rely on Kernel Module support.  Check here. */
 #ifndef CONFIG_MODULES
 #error "No Module support in this kernel.  Please configure with CONFIG_MODULES"
diff -Nur vmhgfs-only.orig/filesystem.c vmhgfs-only/filesystem.c
--- vmhgfs-only.orig/filesystem.c	2008-01-17 06:17:14.000000000 +0100
+++ vmhgfs-only/filesystem.c	2008-04-27 13:15:20.000000000 +0200
@@ -93,9 +93,7 @@
 
 /* Private functions. */
 static inline unsigned long HgfsComputeBlockBits(unsigned long blockSize);
-static void HgfsInodeCacheCtor(void *slabElem,
-                               compat_kmem_cache *cache,
-                               unsigned long flags);
+static compat_kmem_cache_ctor HgfsInodeCacheCtor;
 static HgfsSuperInfo *HgfsInitSuperInfo(HgfsMountInfo *mountInfo);
 static int HgfsReadSuper(struct super_block *sb,
                          void *rawData,
@@ -191,13 +189,20 @@
  * Side effects:
  *      None.
  *
+ * CTOR_HAS_3_ARGS check on top backported from open-vm-tools
+ * by Alexander Griesser <work@tuxx-home.at>, 2008-04-27
  *-----------------------------------------------------------------------------
  */
-
+#ifdef VMW_KMEMCR_CTOR_HAS_3_ARGS
 static void
 HgfsInodeCacheCtor(void *slabElem,           // IN: slab item to initialize
                    compat_kmem_cache *cache, // IN: cache slab is from
                    unsigned long flags)      // IN: flags associated with allocation
+#else
+static void
+HgfsInodeCacheCtor(compat_kmem_cache *cache, // IN: cache slab is from
+                   void *slabElem)           // IN: allocated slab item to initialize
+#endif
 {
 #ifdef VMW_EMBED_INODE
    HgfsInodeInfo *iinfo = (HgfsInodeInfo *)slabElem;
diff -Nur vmhgfs-only.orig/vm_basic_types.h vmhgfs-only/vm_basic_types.h
--- vmhgfs-only.orig/vm_basic_types.h	2008-01-17 06:17:14.000000000 +0100
+++ vmhgfs-only/vm_basic_types.h	2008-04-27 12:55:56.000000000 +0200
@@ -27,6 +27,16 @@
 #ifndef _VM_BASIC_TYPES_H_
 #define _VM_BASIC_TYPES_H_
 
+/*
+ * Since we do some kernel version checks in here, make sure to include
+ * compat_version.h.
+ * <linux/types.h> is needed for uintptr on 2.6.24
+ *
+ * by Alexander Griesser <work@tuxx-home.at>, 2008-03-14
+ */
+#include "compat_version.h"
+#include <linux/types.h>
+
 #define INCLUDE_ALLOW_USERLEVEL
 #define INCLUDE_ALLOW_VMMEXT
 #define INCLUDE_ALLOW_MODULE
@@ -176,18 +186,25 @@
 #      endif
 #   endif
 
-#   ifndef _STDINT_H
-#      ifdef VM_I386
-#         ifdef VM_X86_64
+/*
+ * uintptr_t is defined since 2.6.24, so defining it here will lead to
+ * compile errors.
+ *
+ * by Alexander Griesser <work@tuxx-home.at>, 2008-03-10
+ */
+#   if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
+#      ifndef _STDINT_H
+#         ifdef VM_I386
+#            ifdef VM_X86_64
+                typedef uint64    uintptr_t;
+#            else
+                typedef uint32    uintptr_t;
+#            endif
+#         endif
+#         ifdef VM_IA64
              typedef uint64    uintptr_t;
-#         else
-             typedef uint32    uintptr_t;
 #         endif
 #      endif
-
-#      ifdef VM_IA64
-          typedef uint64    uintptr_t;
-#      endif
 #   endif
 #endif
 
diff -Nur vmhgfs-only.orig/x86cpuid.h vmhgfs-only/x86cpuid.h
--- vmhgfs-only.orig/x86cpuid.h	2008-01-17 06:17:14.000000000 +0100
+++ vmhgfs-only/x86cpuid.h	2008-04-27 13:16:20.000000000 +0200
@@ -394,12 +394,12 @@
  * Note: The FEATURE/MASK definitions must use some gymnastics to get
  * around a warning when shifting left by 32.
  */
-#define BIT_MASK(shift)  (((1 << (shift - 1)) << 1) - 1)
+#define VMW_BIT_MASK(shift)  (((1 << (shift - 1)) << 1) - 1)
 
 #define FIELDDEF(lvl, reg, vend, bitpos, size, name, m, v)              \
    CPUID_##vend##_ID##lvl##reg##_##name##_SHIFT = bitpos,               \
    CPUID_##vend##_ID##lvl##reg##_##name##_MASK  =                       \
-                      BIT_MASK(size) << bitpos,                         \
+                      VMW_BIT_MASK(size) << bitpos,                     \
    CPUID_FEATURE_##vend##_ID##lvl##reg##_##name =                       \
                       CPUID_##vend##_ID##lvl##reg##_##name##_MASK,
 
@@ -413,7 +413,7 @@
    /* Define data for every CPUID field we have */
    CPUID_FIELD_DATA
 };
-#undef BIT_MASK
+#undef VMW_BIT_MASK
 #undef FIELDDEF
 #undef FLAGDEF
 #undef FIELDDEFA
