summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-06-02 17:28:49 +0000
committerbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-06-02 17:28:49 +0000
commit57d862349b074974825e1228b7b51ac72e4ba2b3 (patch)
tree420a20c683886c7e23d70d5ffcf38b4d06624b95 /include
parent65a045dace36f9083b728aef731a56b789287a2a (diff)
Breaking the world for a little bit. If anyone is going to continue
working on this branch for the next few days I suggested you work off of the 0.3.1 tag. The following changes are fairly extensive and are designed to make the SPL compatible with all kernels in the range of 2.6.18-2.6.25. There were 13 relevant API changes between these releases and I have added the needed autoconf tests to check for them. However, this has not all been tested extensively. I'll sort of the breakage on Fedora Core 9 and RHEL5 this week. 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 SPL_AC_CTL_UNNUMBERED git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@119 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
Diffstat (limited to 'include')
-rw-r--r--include/sys/kmem.h13
-rw-r--r--include/sys/proc.h9
-rw-r--r--include/sys/sysmacros.h12
-rw-r--r--include/sys/types.h10
-rw-r--r--include/sys/vnode.h9
5 files changed, 42 insertions, 11 deletions
diff --git a/include/sys/kmem.h b/include/sys/kmem.h
index f61ace213..0b1b53687 100644
--- a/include/sys/kmem.h
+++ b/include/sys/kmem.h
@@ -41,6 +41,7 @@ extern "C" {
#include <linux/rwsem.h>
#include <linux/hash.h>
#include <linux/ctype.h>
+#include <sys/types.h>
#include <sys/debug.h>
/*
* Memory allocation interfaces
@@ -316,15 +317,6 @@ kmem_alloc_tryhard(size_t size, size_t *alloc_size, int kmflags)
#define KMC_REAP_CHUNK 256
#define KMC_DEFAULT_SEEKS DEFAULT_SEEKS
-/* Defined by linux slab.h
- * typedef struct kmem_cache_s kmem_cache_t;
- */
-
-/* No linux analog
- * extern int kmem_ready;
- * extern pgcnt_t kmem_reapahead;
- */
-
#ifdef DEBUG_KMEM_UNIMPLEMENTED
static __inline__ void kmem_init(void) {
#error "kmem_init() not implemented"
@@ -380,6 +372,7 @@ __kmem_cache_create(char *name, size_t size, size_t align,
extern int __kmem_cache_destroy(kmem_cache_t *cache);
extern void *__kmem_cache_alloc(kmem_cache_t *cache, gfp_t flags);
+extern void __kmem_cache_free(kmem_cache_t *cache, void *obj);
extern void __kmem_reap(void);
int kmem_init(void);
@@ -389,7 +382,7 @@ void kmem_fini(void);
__kmem_cache_create(name,size,align,ctor,dtor,rclm,priv,vmp,flags)
#define kmem_cache_destroy(cache) __kmem_cache_destroy(cache)
#define kmem_cache_alloc(cache, flags) __kmem_cache_alloc(cache, flags)
-#define kmem_cache_free(cache, ptr) kmem_cache_free(cache, ptr)
+#define kmem_cache_free(cache, obj) __kmem_cache_free(cache, obj)
#define kmem_cache_reap_now(cache) kmem_cache_shrink(cache)
#define kmem_reap() __kmem_reap()
diff --git a/include/sys/proc.h b/include/sys/proc.h
index 9944c74f9..0316a45fd 100644
--- a/include/sys/proc.h
+++ b/include/sys/proc.h
@@ -39,6 +39,15 @@
#include <sys/kstat.h>
#include <sys/debug.h>
+#ifdef CONFIG_SYSCTL
+#ifdef HAVE_2ARGS_REGISTER_SYSCTL
+#define spl_register_sysctl_table(t, a) register_sysctl_table(t, a)
+#else
+#define spl_register_sysctl_table(t, a) register_sysctl_table(t)
+#endif /* HAVE_2ARGS_REGISTER_SYSCTL */
+#define spl_unregister_sysctl_table(t) unregister_sysctl_table(t)
+#endif /* CONFIG_SYSCTL */
+
#ifdef DEBUG_KSTAT
extern struct proc_dir_entry *proc_sys_spl_kstat;
struct proc_dir_entry *proc_dir_entry_find(struct proc_dir_entry *root,
diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h
index c55b070ac..95f7f8a3b 100644
--- a/include/sys/sysmacros.h
+++ b/include/sys/sysmacros.h
@@ -197,6 +197,18 @@ extern int ddi_strtoul(const char *str, char **nptr,
#define offsetof(s, m) ((size_t)(&(((s *)0)->m)))
#endif
+#ifdef HAVE_3ARGS_INIT_WORK
+
+#define spl_init_work(wq,cb,d) INIT_WORK((wq), (void *)(cb), (void *)(d))
+#define spl_get_work_data(type,field,data) (data)
+
+#else
+
+#define spl_init_work(wq,cb,d) INIT_WORK((wq), (void *)(cb));
+#define spl_get_work_data(type,field,data) container_of(data,type,field)
+
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/include/sys/types.h b/include/sys/types.h
index dc660a761..c2ad9837d 100644
--- a/include/sys/types.h
+++ b/include/sys/types.h
@@ -7,9 +7,17 @@ extern "C" {
#include <linux/types.h>
#include <sys/sysmacros.h>
+#include "spl_config.h"
-typedef enum { B_FALSE=0, B_TRUE=1 } boolean_t;
+#ifndef HAVE_UINTPTR_T
typedef unsigned long uintptr_t;
+#endif
+
+#ifndef HAVE_KMEM_CACHE_T
+typedef struct kmem_cache kmem_cache_t;
+#endif
+
+typedef enum { B_FALSE=0, B_TRUE=1 } boolean_t;
typedef unsigned long intptr_t;
typedef unsigned long ulong_t;
typedef unsigned int uint_t;
diff --git a/include/sys/vnode.h b/include/sys/vnode.h
index 9123d7a13..eca33f4b1 100644
--- a/include/sys/vnode.h
+++ b/include/sys/vnode.h
@@ -40,6 +40,7 @@ extern "C" {
#include <linux/namei.h>
#include <linux/file.h>
#include <linux/fs.h>
+#include <linux/mount.h>
#include <sys/kmem.h>
#include <sys/mutex.h>
#include <sys/types.h>
@@ -92,6 +93,14 @@ extern "C" {
#define B_INVAL 0x01
#define B_TRUNC 0x02
+#ifdef HAVE_PATH_IN_NAMEIDATA
+# define nd_dentry path.dentry
+# define nd_mnt path.mnt
+#else
+# define nd_dentry dentry
+# define nd_mnt mnt
+#endif
+
typedef enum vtype {
VNON = 0,
VREG = 1,