Index: linux-2.6/include/linux/slab.h =================================================================== --- linux-2.6.orig/include/linux/slab.h 2006-12-08 12:51:37.000000000 -0800 +++ linux-2.6/include/linux/slab.h 2006-12-11 17:01:54.000000000 -0800 @@ -52,10 +52,10 @@ int kmem_cache_shrink(struct kmem_cache *); void *kmem_cache_alloc(struct kmem_cache *, gfp_t); void *kmem_cache_zalloc(struct kmem_cache *, gfp_t); -void kmem_cache_free(struct kmem_cache *, void *); +void kmem_cache_free(struct kmem_cache *, const void *); unsigned int kmem_cache_size(struct kmem_cache *); const char *kmem_cache_name(struct kmem_cache *); -int kmem_ptr_validate(struct kmem_cache *cachep, void *ptr); +int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr); #ifdef CONFIG_NUMA extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); @@ -93,19 +93,15 @@ * ways to convert kmalloc() calls to kmem_cache_alloc() invocations by selecting * the appropriate general cache at compile time. */ + #ifdef CONFIG_SLAB #include #else - /* * Fallback definitions for an allocator not wanting to provide * its own optimized kmalloc definitions (like SLOB). */ -#if defined(CONFIG_NUMA) || defined(CONFIG_DEBUG_SLAB) -#error "SLAB fallback definitions not usable for NUMA or Slab debug" -#endif - /** * kmalloc - allocate memory * @size: how many bytes of memory are required. @@ -167,6 +163,18 @@ } #endif +#ifndef CONFIG_NUMA +static inline void *kmalloc_node(size_t size, gfp_t flags, int node) +{ + return kmalloc(size, flags); +} + +static inline void *__kmalloc_node(size_t size, gfp_t flags, int node) +{ + return __kmalloc(size, flags); +} +#endif /* !CONFIG_NUMA */ + /* * kmalloc_track_caller is a special version of kmalloc that records the * calling function of the routine calling it for slab leak tracking instead @@ -208,12 +216,8 @@ #define kmalloc_node_track_caller(size, flags, node) \ kmalloc_track_caller(size, flags) -static inline void *kmalloc_node(size_t size, gfp_t flags, int node) -{ - return kmalloc(size, flags); -} +#endif /* DEBUG_SLAB */ -#endif /* !CONFIG_NUMA */ #endif /* __KERNEL__ */ #endif /* _LINUX_SLAB_H */