]> granicus.if.org Git - zfs/commitdiff
Start bringing in Ricardo's spl-00-rhel4-compat.patch, a few chunks
authorbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>
Tue, 5 Aug 2008 04:16:09 +0000 (04:16 +0000)
committerbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>
Tue, 5 Aug 2008 04:16:09 +0000 (04:16 +0000)
at a time as I audit it.  This chunk finishes moving the SPL entirely
off the linux slab on to the SPL implementation.  It differs slightly
from the proposed version in that the spl continues to export to
all the Solaris types and functions.  These do conflict with the
Linux slab so a module usings these interfaces must not include the
SPL slab if they also intend to use the linux slab.  Or they must
explcitly #undef the macros which remap the functioin to their
spl_* equivilants.

A nice side of effect of dropping the entire linux slab is we
don't need to autoconf checks anymore.  They kept messing with
the slab API endlessly!

git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@148 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

autoconf/spl-build.m4
configure.ac
include/sys/kmem.h
include/sys/types.h
modules/spl/spl-vnode.c

index d77c7aa8061e62cf9d7d0109d97976bb1314b13a..2f09fa87e5fc14521099b053349b1084ea585577 100644 (file)
@@ -308,44 +308,6 @@ AC_DEFUN([SPL_AC_TYPE_UINTPTR_T],
        ])
 ])
 
-dnl #
-dnl # 2.6.x API change
-dnl # check if kmem_cache_t typedef is defined
-dnl #
-AC_DEFUN([SPL_AC_TYPE_KMEM_CACHE_T],
-       [AC_MSG_CHECKING([whether kernel defines kmem_cache_t])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/slab.h>
-       ],[
-               kmem_cache_t *cache;
-       ],[
-               AC_MSG_RESULT([yes])
-               AC_DEFINE(HAVE_KMEM_CACHE_T, 1, 
-                         [kernel defines kmem_cache_t])
-       ],[
-               AC_MSG_RESULT([no])
-       ])
-])
-
-dnl #
-dnl # 2.6.19 API change
-dnl # kmem_cache_destroy() return void instead of int
-dnl #
-AC_DEFUN([SPL_AC_KMEM_CACHE_DESTROY_INT],
-       [AC_MSG_CHECKING([whether kmem_cache_destroy() returns int])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/slab.h>
-       ],[
-               int i = kmem_cache_destroy(NULL);
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_KMEM_CACHE_DESTROY_INT, 1,
-                       [kmem_cache_destroy() returns int])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
-
 dnl #
 dnl # 2.6.19 API change
 dnl # panic_notifier_list use atomic_notifier operations
@@ -407,77 +369,6 @@ AC_DEFUN([SPL_AC_2ARGS_REGISTER_SYSCTL],
        ])
 ])
 
-dnl #
-dnl # 2.6.21 API change
-dnl # Use struct kmem_cache for missing kmem_cache_t
-dnl #
-AC_DEFUN([SPL_AC_KMEM_CACHE_T], [
-       AC_MSG_CHECKING([whether kernel has kmem_cache_t])
-       tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Werror"
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/slab.h>
-       ],[
-               kmem_cache_t *cachep = NULL;
-               kmem_cache_free(cachep, NULL);
-
-       ],[
-               AC_MSG_RESULT([yes])
-               AC_DEFINE(HAVE_KMEM_CACHE_T, 1,
-                         [kernel has struct kmem_cache_t])
-       ],[
-               AC_MSG_RESULT([no])
-       ])
-       EXTRA_KCFLAGS="$tmp_flags"
-])
-
-dnl #
-dnl # 2.6.23 API change
-dnl # Slab no longer accepts a dtor argument
-dnl # 
-AC_DEFUN([SPL_AC_KMEM_CACHE_CREATE_DTOR],
-       [AC_MSG_CHECKING([whether kmem_cache_create() has dtor arg])
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/slab.h>
-       ],[
-               kmem_cache_create(NULL, 0, 0, 0, NULL, NULL);
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_KMEM_CACHE_CREATE_DTOR, 1,
-                         [kmem_cache_create() has dtor arg])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-])
-
-dnl #
-dnl # 2.6.x API change
-dnl # Slab ctor no longer takes 3 args
-dnl # 
-AC_DEFUN([SPL_AC_3ARG_KMEM_CACHE_CREATE_CTOR],
-       [AC_MSG_CHECKING([whether slab ctor wants 3 args])
-       tmp_flags="$EXTRA_KCFLAGS"
-       EXTRA_KCFLAGS="-Werror"
-       SPL_LINUX_TRY_COMPILE([
-               #include <linux/slab.h>
-       ],[
-               void (*ctor)(void *,struct kmem_cache *,unsigned long) = NULL;
-
-               #ifdef HAVE_KMEM_CACHE_CREATE_DTOR
-               kmem_cache_create(NULL, 0, 0, 0, ctor, NULL);
-               #else
-               kmem_cache_create(NULL, 0, 0, 0, ctor);
-               #endif
-       ],[
-               AC_MSG_RESULT(yes)
-               AC_DEFINE(HAVE_3ARG_KMEM_CACHE_CREATE_CTOR, 1,
-                         [slab ctor wants 3 args])
-       ],[
-               AC_MSG_RESULT(no)
-       ])
-       EXTRA_KCFLAGS="$tmp_flags"
-])
-
 dnl #
 dnl # 2.6.x API change
 dnl # Old set_shrinker API replaced with register_shrinker
index 17a782a2b79b033be11b57415651d6e6e3582cb9..c4d424ea027eca9049a218c22d29ca8406555cbd 100644 (file)
@@ -44,14 +44,9 @@ SPL_AC_DEBUG_MUTEX
 SPL_AC_DEBUG_KSTAT
 SPL_AC_DEBUG_CALLB
 SPL_AC_TYPE_UINTPTR_T
-SPL_AC_TYPE_KMEM_CACHE_T
-SPL_AC_KMEM_CACHE_DESTROY_INT
 SPL_AC_ATOMIC_PANIC_NOTIFIER
 SPL_AC_3ARGS_INIT_WORK
 SPL_AC_2ARGS_REGISTER_SYSCTL
-SPL_AC_KMEM_CACHE_T
-SPL_AC_KMEM_CACHE_CREATE_DTOR
-SPL_AC_3ARG_KMEM_CACHE_CREATE_CTOR
 SPL_AC_SET_SHRINKER
 SPL_AC_PATH_IN_NAMEIDATA
 SPL_AC_TASK_CURR
index 9397caa0a56b1a940b4f6e68de936046444a25f2..dd1514fb95429a60ebed657385bf54517b699b34 100644 (file)
@@ -529,6 +529,7 @@ typedef struct spl_kmem_cache {
        uint64_t                skc_obj_alloc;  /* Obj alloc current */
        uint64_t                skc_obj_max;    /* Obj max historic */
 } spl_kmem_cache_t;
+#define kmem_cache_t           spl_kmem_cache_t
 
 extern spl_kmem_cache_t *
 spl_kmem_cache_create(char *name, size_t size, size_t align,
index c60bfb20865950fd761b0adc90a2e3e9f89ad045..eba23eae0b17f249790e385b18d5ab3421f792a1 100644 (file)
@@ -13,11 +13,6 @@ extern "C" {
 typedef unsigned long                  uintptr_t;
 #endif
 
-#ifndef HAVE_KMEM_CACHE_T
-typedef struct kmem_cache              kmem_cache_t;
-#endif
-#define kmem_cache_t                   spl_kmem_cache_t
-
 typedef enum { B_FALSE=0, B_TRUE=1 }   boolean_t;
 typedef unsigned long                  intptr_t;
 typedef unsigned long                  ulong_t;
index 678d94682ecd996ae1923979e90da1da5eab6297..bf9b3e97c6dfd5a372027cb216a2477e6ea035a6 100644 (file)
@@ -37,8 +37,8 @@
 void *rootdir = NULL;
 EXPORT_SYMBOL(rootdir);
 
-static kmem_cache_t *vn_cache;
-static kmem_cache_t *vn_file_cache;
+static spl_kmem_cache_t *vn_cache;
+static spl_kmem_cache_t *vn_file_cache;
 
 static spinlock_t vn_file_lock = SPIN_LOCK_UNLOCKED;
 static LIST_HEAD(vn_file_list);