aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2009-02-02 15:12:30 -0800
committerBrian Behlendorf <[email protected]>2009-02-02 15:12:30 -0800
commit31a033ecd49c2f691d6a377db2882ed941f47481 (patch)
tree4fe82ef3038f051bb02cd5e1de8333908e1da455 /include
parentf220894e1fc86cbfaf073dc4cca519887c41e78e (diff)
2.6.27+ portability changes
- Added SPL_AC_3ARGS_ON_EACH_CPU configure check to determine if the older 4 argument version of on_each_cpu() should be used or the new 3 argument version. The retry argument was dropped in the new API which was never used anyway. - Updated work queue compatibility wrappers. The old way this worked was to pass a data point when initialized the workqueue. The new API assumed the work item is embedding in a structure and we us container_of() to find that data pointer. - Updated skc->skc_flags to be an unsigned long which is now type checked in the bit operations. This silences the warnings. - Updated autogen products and splat tests accordingly
Diffstat (limited to 'include')
-rw-r--r--include/linux/smp_compat.h16
-rw-r--r--include/linux/workqueue_compat.h25
-rw-r--r--include/sys/kmem.h3
-rw-r--r--include/sys/types.h2
-rw-r--r--include/sys/workqueue.h55
5 files changed, 44 insertions, 57 deletions
diff --git a/include/linux/smp_compat.h b/include/linux/smp_compat.h
new file mode 100644
index 000000000..4da35f4ad
--- /dev/null
+++ b/include/linux/smp_compat.h
@@ -0,0 +1,16 @@
+#ifndef _SPL_SMP_COMPAT_H
+#define _SPL_SMP_COMPAT_H
+
+#include <linux/smp.h>
+
+#ifdef HAVE_3ARGS_ON_EACH_CPU
+
+#define spl_on_each_cpu(func,info,wait) on_each_cpu(func,info,wait)
+
+#else
+
+#define spl_on_each_cpu(func,info,wait) on_each_cpu(func,info,0,wait)
+
+#endif /* HAVE_3ARGS_ON_EACH_CPU */
+
+#endif /* _SPL_SMP_COMPAT_H */
diff --git a/include/linux/workqueue_compat.h b/include/linux/workqueue_compat.h
new file mode 100644
index 000000000..3dab8776a
--- /dev/null
+++ b/include/linux/workqueue_compat.h
@@ -0,0 +1,25 @@
+#ifndef _SPL_WORKQUEUE_COMPAT_H
+#define _SPL_WORKQUEUE_COMPAT_H
+
+#include <linux/workqueue.h>
+#include <sys/types.h>
+
+#ifdef HAVE_3ARGS_INIT_WORK
+
+#define delayed_work work_struct
+
+#define spl_init_work(wq, cb, d) INIT_WORK((wq), (void *)(cb), \
+ (void *)(d))
+#define spl_init_delayed_work(wq,cb,d) INIT_WORK((wq), (void *)(cb), \
+ (void *)(d))
+#define spl_get_work_data(d, t, f) (t *)(d)
+
+#else
+
+#define spl_init_work(wq, cb, d) INIT_WORK((wq), (void *)(cb));
+#define spl_init_delayed_work(wq,cb,d) INIT_DELAYED_WORK((wq), (void *)(cb));
+#define spl_get_work_data(d, t, f) (t *)container_of(d, t, f)
+
+#endif /* HAVE_3ARGS_INIT_WORK */
+
+#endif /* _SPL_WORKQUEUE_COMPAT_H */
diff --git a/include/sys/kmem.h b/include/sys/kmem.h
index 4f939e0fc..5f2695d52 100644
--- a/include/sys/kmem.h
+++ b/include/sys/kmem.h
@@ -45,7 +45,6 @@ extern "C" {
#include <asm/atomic_compat.h>
#include <sys/types.h>
#include <sys/debug.h>
-#include <sys/workqueue.h>
/*
* Memory allocation interfaces
@@ -286,7 +285,7 @@ typedef struct spl_kmem_cache {
spl_kmem_reclaim_t skc_reclaim; /* Reclaimator */
void *skc_private; /* Private data */
void *skc_vmp; /* Unused */
- uint32_t skc_flags; /* Flags */
+ unsigned long skc_flags; /* Flags */
uint32_t skc_obj_size; /* Object size */
uint32_t skc_obj_align; /* Object alignment */
uint32_t skc_slab_objs; /* Objects per slab */
diff --git a/include/sys/types.h b/include/sys/types.h
index b67336bae..0b5cae641 100644
--- a/include/sys/types.h
+++ b/include/sys/types.h
@@ -14,6 +14,8 @@ extern "C" {
#include <linux/list_compat.h>
#include <linux/time_compat.h>
#include <linux/bitops_compat.h>
+#include <linux/smp_compat.h>
+#include <linux/workqueue_compat.h>
#ifndef HAVE_UINTPTR_T
typedef unsigned long uintptr_t;
diff --git a/include/sys/workqueue.h b/include/sys/workqueue.h
deleted file mode 100644
index 711c32ed2..000000000
--- a/include/sys/workqueue.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * This file is part of the SPL: Solaris Porting Layer.
- *
- * Copyright (c) 2008 Lawrence Livermore National Security, LLC.
- * Produced at Lawrence Livermore National Laboratory
- * Written by:
- * Brian Behlendorf <[email protected]>,
- * Herb Wartens <[email protected]>,
- * Jim Garlick <[email protected]>
- * UCRL-CODE-235197
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef _SPL_WORKQUEUE_H
-#define _SPL_WORKQUEUE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <linux/workqueue.h>
-#include <sys/types.h>
-
-#ifdef HAVE_3ARGS_INIT_WORK
-
-#define delayed_work work_struct
-
-#define spl_init_work(wq, cb, d) INIT_WORK((wq), (void *)(cb), \
- (void *)(d))
-#define spl_init_delayed_work(wq,cb,d) INIT_WORK((wq), (void *)(cb), \
- (void *)(d))
-#define spl_get_work_data(d, t, f) (t *)(d)
-
-#else
-
-#define spl_init_work(wq, cb, d) INIT_WORK((wq), (void *)(cb));
-#define spl_init_delayed_work(wq,cb,d) INIT_DELAYED_WORK((wq), (void *)(cb));
-#define spl_get_work_data(d, t, f) (t *)container_of(d, t, f)
-
-#endif /* HAVE_3ARGS_INIT_WORK */
-
-#endif /* _SPL_WORKQUEUE_H */