Skip to content
Snippets Groups Projects
Commit 3301b4b5 authored by Alexey Lyashkov's avatar Alexey Lyashkov
Browse files

2.6.22 has only one visble change for patchless cleint, SLAB_CTOR_* constants is

removed. In this case we need drop using os depended interface to
kmem_cache and use cfs_mem_cache API.

b=12764
i=green
i=wangdi
parent cebabccc
No related branches found
No related tags found
No related merge requests found
...@@ -1120,7 +1120,7 @@ LB_LINUX_TRY_COMPILE([ ...@@ -1120,7 +1120,7 @@ LB_LINUX_TRY_COMPILE([
# 2.6.21 api change. 'register_sysctl_table' use only one argument, # 2.6.21 api change. 'register_sysctl_table' use only one argument,
# instead of more old which need two. # instead of more old which need two.
AC_DEFUN([LL_2ARGS_REGISTER_SYSCTL], AC_DEFUN([LN_2ARGS_REGISTER_SYSCTL],
[AC_MSG_CHECKING([check register_sysctl_table want 2 args]) [AC_MSG_CHECKING([check register_sysctl_table want 2 args])
LB_LINUX_TRY_COMPILE([ LB_LINUX_TRY_COMPILE([
#include <linux/sysctl.h> #include <linux/sysctl.h>
...@@ -1135,6 +1135,29 @@ LB_LINUX_TRY_COMPILE([ ...@@ -1135,6 +1135,29 @@ LB_LINUX_TRY_COMPILE([
]) ])
]) ])
# 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])
tmp_flags="$EXTRA_KCFLAGS"
EXTRA_KCFLAGS="-Werror"
LB_LINUX_TRY_COMPILE([
#include <linux/slab.h>
],[
struct kmem_cache_s *cachep = NULL;
kmem_cache_free(cachep, NULL);
],[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_KMEM_CACHE_n, 1,
[kernel has struct kmem_cache_s])
],[
AC_MSG_RESULT(NO)
])
EXTRA_KCFLAGS="$tmp_flags"
])
# #
# LN_PROG_LINUX # LN_PROG_LINUX
# #
...@@ -1170,7 +1193,8 @@ LN_ATOMIC_PANIC_NOTIFIER ...@@ -1170,7 +1193,8 @@ LN_ATOMIC_PANIC_NOTIFIER
# 2.6.20 # 2.6.20
LN_3ARGS_INIT_WORK LN_3ARGS_INIT_WORK
# 2.6.21 # 2.6.21
LL_2ARGS_REGISTER_SYSCTL LN_2ARGS_REGISTER_SYSCTL
LN_KMEM_CACHE_S
]) ])
# #
......
...@@ -97,7 +97,11 @@ extern void cfs_free_large(void *addr); ...@@ -97,7 +97,11 @@ extern void cfs_free_large(void *addr);
* SLAB allocator * SLAB allocator
* XXX Liang: move these declare to public file * XXX Liang: move these declare to public file
*/ */
typedef kmem_cache_t cfs_mem_cache_t; #ifdef HAVE_KMEM_CACHE_S
typedef struct kmem_cache_s cfs_mem_cache_t;
#else
typedef struct kmem_cache cfs_mem_cache_t;
#endif
extern cfs_mem_cache_t * cfs_mem_cache_create (const char *, size_t, size_t, unsigned long); 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 * ); extern int cfs_mem_cache_destroy ( cfs_mem_cache_t * );
extern void *cfs_mem_cache_alloc ( cfs_mem_cache_t *, int); extern void *cfs_mem_cache_alloc ( cfs_mem_cache_t *, int);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment