AC_DEFUN([LB_LINUX_CONFIG],
[AC_MSG_CHECKING([if Linux was built with CONFIG_$1])
LB_LINUX_TRY_COMPILE([
-#ifndef AUTOCONF_INCLUDED
-#include <linux/config.h>
-#endif
+#include <linux/autoconf.h>
],[
#ifndef CONFIG_$1
#error CONFIG_$1 not #defined
#
AC_DEFUN([LB_LINUX_CONFIG_IM],
[AC_MSG_CHECKING([if Linux was built with CONFIG_$1 in or as module])
-LB_LINUX_TRY_COMPILE([#include <linux/config.h>],[
+LB_LINUX_TRY_COMPILE([
+#include <linux/autoconf.h>
+],[
#if !(defined(CONFIG_$1) || defined(CONFIG_$1_MODULE))
#error CONFIG_$1 and CONFIG_$1_MODULE not #defined
#endif
])
])
-# 2.6.21 uses struct kmem_cache instead of kmem_cache_s for
-# kmem_cache_t
-AC_DEFUN([LN_KMEM_CACHE_S],
-[AC_MSG_CHECKING([check kernel has struct kmem_cache_s])
+# 2.6.21 marks kmem_cache_t deprecated and uses struct kmem_cache
+# instead
+AC_DEFUN([LN_KMEM_CACHE],
+[AC_MSG_CHECKING([check kernel has struct kmem_cache])
tmp_flags="$EXTRA_KCFLAGS"
EXTRA_KCFLAGS="-Werror"
LB_LINUX_TRY_COMPILE([
#include <linux/slab.h>
+ typedef struct kmem_cache cache_t;
],[
- kmem_cache_s *cachep = NULL;
-
- kmem_cache_free(cachep, NULL);
+ cache_t *cachep = NULL;
+ kmem_cache_alloc(cachep, 0);
],[
AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_KMEM_CACHE_S, 1,
- [kernel has struct kmem_cache_s])
+ AC_DEFINE(HAVE_KMEM_CACHE, 1,
+ [kernel has struct kmem_cache])
],[
AC_MSG_RESULT(NO)
])
LB_LINUX_TRY_COMPILE([
#include <linux/slab.h>
],[
- struct kmem_cache_s *cachep = NULL;
kmem_cache_create(NULL, 0, 0, 0, NULL, NULL);
],[
AC_MSG_RESULT(yes)
LN_3ARGS_INIT_WORK
# 2.6.21
LN_2ARGS_REGISTER_SYSCTL
-LN_KMEM_CACHE_S
+LN_KMEM_CACHE
# 2.6.23
LN_KMEM_CACHE_CREATE_DTOR
])
* SLAB allocator
* XXX Liang: move these declare to public file
*/
-#ifdef HAVE_KMEM_CACHE_S
-typedef struct kmem_cache_s cfs_mem_cache_t;
-#else
+#ifdef HAVE_KMEM_CACHE
typedef struct kmem_cache cfs_mem_cache_t;
+#else
+typedef kmem_cache_t cfs_mem_cache_t;
#endif
extern cfs_mem_cache_t * cfs_mem_cache_create (const char *, size_t, size_t, unsigned long);
extern int cfs_mem_cache_destroy ( cfs_mem_cache_t * );
#ifdef __KERNEL__
struct obd_capa *ocapa;
- OBD_SLAB_ALLOC(ocapa, capa_cachep, SLAB_KERNEL, sizeof(*ocapa));
+ OBD_SLAB_ALLOC(ocapa, capa_cachep, GFP_KERNEL, sizeof(*ocapa));
if (ocapa) {
atomic_set(&ocapa->c_refc, 0);
spin_lock_init(&ocapa->c_lock);