summaryrefslogtreecommitdiffstats
path: root/include/sys
diff options
context:
space:
mode:
authorbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-08-11 22:13:47 +0000
committerbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-08-11 22:13:47 +0000
commit3d061e9d1092364be132fc3f6c478add94b4e482 (patch)
treea66be5ccb1cf64b3b966e11b84e99a1cae47f875 /include/sys
parent322640b7b5a5336e4681d77778736339164a4501 (diff)
Commit bulk of remaining 2.6.9 and 2.6.26 compat changes.
git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@155 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/kmem.h39
-rw-r--r--include/sys/taskq.h9
2 files changed, 27 insertions, 21 deletions
diff --git a/include/sys/kmem.h b/include/sys/kmem.h
index dd1514fb9..1ca2c261a 100644
--- a/include/sys/kmem.h
+++ b/include/sys/kmem.h
@@ -54,6 +54,13 @@ extern "C" {
#define KM_VMFLAGS GFP_LEVEL_MASK
#define KM_FLAGS __GFP_BITS_MASK
+/*
+ * Used internally, the kernel does not need to support this flag
+ */
+#ifndef __GFP_ZERO
+#define __GFP_ZERO 0x8000
+#endif
+
#ifdef DEBUG_KMEM
extern atomic64_t kmem_alloc_used;
extern unsigned long kmem_alloc_max;
@@ -113,7 +120,7 @@ __kmem_del_init(spinlock_t *lock,struct hlist_head *table,int bits,void *addr)
return NULL;
}
-#define __kmem_alloc(size, flags, allocator) \
+#define __kmem_alloc(size, flags, allocator, args...) \
({ void *_ptr_ = NULL; \
kmem_debug_t *_dptr_; \
unsigned long _flags_; \
@@ -133,7 +140,7 @@ __kmem_del_init(spinlock_t *lock,struct hlist_head *table,int bits,void *addr)
atomic64_read(&kmem_alloc_used), \
kmem_alloc_max); \
\
- _ptr_ = (void *)allocator((size), (flags)); \
+ _ptr_ = (void *)allocator((size), (flags), ## args); \
if (_ptr_ == NULL) { \
kfree(_dptr_); \
__CDEBUG_LIMIT(S_KMEM, D_WARNING, "Warning " \
@@ -273,7 +280,7 @@ __kmem_del_init(spinlock_t *lock,struct hlist_head *table,int bits,void *addr)
#else /* DEBUG_KMEM_TRACKING */
-#define __kmem_alloc(size, flags, allocator) \
+#define __kmem_alloc(size, flags, allocator, args...) \
({ void *_ptr_ = NULL; \
\
/* Marked unlikely because we should never be doing this, */ \
@@ -285,7 +292,7 @@ __kmem_del_init(spinlock_t *lock,struct hlist_head *table,int bits,void *addr)
atomic64_read(&kmem_alloc_used), \
kmem_alloc_max); \
\
- _ptr_ = (void *)allocator((size), (flags)); \
+ _ptr_ = (void *)allocator((size), (flags), ## args); \
if (_ptr_ == NULL) { \
__CDEBUG_LIMIT(S_KMEM, D_WARNING, "Warning " \
"kmem_alloc(%d, 0x%x) failed (%ld/" \
@@ -370,6 +377,14 @@ __kmem_del_init(spinlock_t *lock,struct hlist_head *table,int bits,void *addr)
#define kmem_alloc(size, flags) __kmem_alloc((size), (flags), kmalloc)
#define kmem_zalloc(size, flags) __kmem_alloc((size), (flags), kzalloc)
+#ifdef HAVE_KMALLOC_NODE
+#define kmem_alloc_node(size, flags, node) \
+ __kmem_alloc((size), (flags), kmalloc_node, node)
+#else
+#define kmem_alloc_node(size, flags, node) \
+ __kmem_alloc((size), (flags), kmalloc)
+#endif
+
#define vmem_alloc(size, flags) __vmem_alloc((size), (flags))
#define vmem_zalloc(size, flags) __vmem_alloc((size), ((flags) | __GFP_ZERO))
@@ -379,6 +394,14 @@ __kmem_del_init(spinlock_t *lock,struct hlist_head *table,int bits,void *addr)
#define kmem_zalloc(size, flags) kzalloc((size), (flags))
#define kmem_free(ptr, size) kfree(ptr)
+#ifdef HAVE_KMALLOC_NODE
+#define kmem_alloc_node(size, flags, node) \
+ kmalloc_node((size), (flags), (node))
+#else
+#define kmem_alloc_node(size, flags, node) \
+ kmalloc((size), (flags))
+#endif
+
#define vmem_alloc(size, flags) __vmalloc((size), ((flags) | \
__GFP_HIGHMEM), PAGE_KERNEL)
#define vmem_zalloc(size, flags) \
@@ -555,14 +578,6 @@ void spl_kmem_fini(void);
#define kmem_virt(ptr) (((ptr) >= (void *)VMALLOC_START) && \
((ptr) < (void *)VMALLOC_END))
-#ifdef HAVE_KMEM_CACHE_CREATE_DTOR
-#define __kmem_cache_create(name, size, align, flags, ctor, dtor) \
- kmem_cache_create(name, size, align, flags, ctor, dtor)
-#else
-#define __kmem_cache_create(name, size, align, flags, ctor, dtor) \
- kmem_cache_create(name, size, align, flags, ctor)
-#endif /* HAVE_KMEM_CACHE_CREATE_DTOR */
-
#ifdef __cplusplus
}
#endif
diff --git a/include/sys/taskq.h b/include/sys/taskq.h
index 11b1cbbfb..fbcc5556d 100644
--- a/include/sys/taskq.h
+++ b/include/sys/taskq.h
@@ -37,7 +37,6 @@ extern "C" {
#include <linux/interrupt.h>
#include <linux/kthread.h>
#include <sys/types.h>
-#include <sys/kmem.h>
#define TASKQ_NAMELEN 31
@@ -60,14 +59,6 @@ typedef void (task_func_t)(void *);
#define TQ_NEW 0x04000000
#define TQ_ACTIVE 0x80000000
-typedef struct task {
- spinlock_t t_lock;
- struct list_head t_list;
- taskqid_t t_id;
- task_func_t *t_func;
- void *t_arg;
-} task_t;
-
typedef struct taskq {
spinlock_t tq_lock; /* protects taskq_t */
struct task_struct **tq_threads; /* thread pointers */