summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-02-27 19:09:51 +0000
committerbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-02-27 19:09:51 +0000
commitf1b59d2620ae2bd977e67e292f9bebc43049872c (patch)
tree914f1f0e03a05326af10cab4b374a023e74b8875 /src
parent3d4ea0ced6c2400d2b7d62d4f90b1a69d7e1a04e (diff)
Lots of build fixes. This is turning out to be a very good
idea since it forcefully codifing the ABI. Since the shim layer is no longer linked at build time in to the test suite we can;'t cut any corners and get away with it. Everything is working now with the exception of sorting setting Module.symvers properly. This may take a little Makefile reorg. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@5 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
Diffstat (limited to 'src')
-rw-r--r--src/spl/Makefile.in3
-rw-r--r--src/spl/linux-generic.c8
-rw-r--r--src/spl/linux-kmem.c14
-rw-r--r--src/spl/linux-rwlock.c4
-rw-r--r--src/spl/linux-taskq.c6
-rw-r--r--src/spl/linux-thread.c11
-rw-r--r--src/splat/splat-condvar.c3
-rw-r--r--src/splat/splat-ctl.c21
-rw-r--r--src/splat/splat-kmem.c7
-rw-r--r--src/splat/splat-mutex.c3
-rw-r--r--src/splat/splat-random.c3
-rw-r--r--src/splat/splat-rwlock.c3
-rw-r--r--src/splat/splat-taskq.c3
-rw-r--r--src/splat/splat-thread.c3
-rw-r--r--src/splat/splat-time.c3
15 files changed, 47 insertions, 48 deletions
diff --git a/src/spl/Makefile.in b/src/spl/Makefile.in
index 2a77394d3..82b45a287 100644
--- a/src/spl/Makefile.in
+++ b/src/spl/Makefile.in
@@ -2,7 +2,8 @@
MODULES := spl
DISTFILES = Makefile.in \
- linux-kmem.c linux-rwlock.c linux-taskq.c linux-thread.c
+ linux-kmem.c linux-rwlock.c linux-taskq.c \
+ linux-thread.c linux-generic.c
CPPFLAGS += @KERNELCPPFLAGS@
# Solaris porting layer module
diff --git a/src/spl/linux-generic.c b/src/spl/linux-generic.c
new file mode 100644
index 000000000..fa1ebab85
--- /dev/null
+++ b/src/spl/linux-generic.c
@@ -0,0 +1,8 @@
+#include "linux-generic.h"
+
+/*
+ * Generic support
+ */
+
+int p0 = 0;
+EXPORT_SYMBOL(p0);
diff --git a/src/spl/linux-kmem.c b/src/spl/linux-kmem.c
index e5ebdc175..4dc7c01d8 100644
--- a/src/spl/linux-kmem.c
+++ b/src/spl/linux-kmem.c
@@ -172,9 +172,9 @@ kmem_cache_generic_shrinker(int nr_to_scan, unsigned int gfp_mask)
kmem_cache_t *
__kmem_cache_create(char *name, size_t size, size_t align,
- int (*constructor)(void *, void *, int),
- void (*destructor)(void *, void *),
- void (*reclaim)(void *),
+ kmem_constructor_t constructor,
+ kmem_destructor_t destructor,
+ kmem_reclaim_t reclaim,
void *priv, void *vmp, int flags)
{
kmem_cache_t *cache;
@@ -216,6 +216,7 @@ __kmem_cache_create(char *name, size_t size, size_t align,
return cache;
}
+EXPORT_SYMBOL(__kmem_cache_create);
/* Return codes discarded because Solaris implementation has void return */
void
@@ -239,11 +240,12 @@ __kmem_cache_destroy(kmem_cache_t *cache)
spin_unlock(&kmem_cache_cb_lock);
}
+EXPORT_SYMBOL(__kmem_cache_destroy);
-void
+void
__kmem_reap(void) {
- /* Since there's no easy hook in to linux to force all the registered
+ /* Since there's no easy hook in to linux to force all the registered
* shrinkers to run we just run the ones registered for this shim */
kmem_cache_generic_shrinker(KMC_REAP_CHUNK, GFP_KERNEL);
}
-
+EXPORT_SYMBOL(__kmem_reap);
diff --git a/src/spl/linux-rwlock.c b/src/spl/linux-rwlock.c
index e95ec1555..24775c414 100644
--- a/src/spl/linux-rwlock.c
+++ b/src/spl/linux-rwlock.c
@@ -1,4 +1,4 @@
-#include <sys/linux-rwlock.h>
+#include <linux-rwlock.h>
int
rw_lock_held(krwlock_t *rwlp)
@@ -12,7 +12,7 @@ rw_lock_held(krwlock_t *rwlp)
#endif
return 1;
}
-
+
return 0;
}
diff --git a/src/spl/linux-taskq.c b/src/spl/linux-taskq.c
index 0babd2395..ddcf57c3c 100644
--- a/src/spl/linux-taskq.c
+++ b/src/spl/linux-taskq.c
@@ -1,4 +1,4 @@
-#include <sys/linux-taskq.h>
+#include <linux-taskq.h>
/*
* Task queue interface
@@ -58,6 +58,7 @@ __taskq_dispatch(taskq_t *tq, task_func_t func, void *priv, uint_t flags)
return (taskqid_t)wq;
}
+EXPORT_SYMBOL(__taskq_dispatch);
/* XXX - Most args ignored until we decide if it's worth the effort
* to emulate the solaris notion of dynamic thread pools. For
@@ -72,7 +73,8 @@ taskq_t *
__taskq_create(const char *name, int nthreads, pri_t pri,
int minalloc, int maxalloc, uint_t flags)
{
- /* NOTE: Linux workqueue names are limited to 10 chars */
+ /* NOTE: Linux workqueue names are limited to 10 chars */
return create_singlethread_workqueue(name);
}
+EXPORT_SYMBOL(__taskq_create);
diff --git a/src/spl/linux-thread.c b/src/spl/linux-thread.c
index f3caa6365..9785d50d3 100644
--- a/src/spl/linux-thread.c
+++ b/src/spl/linux-thread.c
@@ -15,7 +15,7 @@ typedef struct thread_priv_s {
wait_queue_head_t tp_waitq; /* Syncronization wait queue */
} thread_priv_t;
-int
+static int
thread_generic_wrapper(void *arg)
{
thread_priv_t *tp = (thread_priv_t *)arg;
@@ -38,8 +38,8 @@ thread_generic_wrapper(void *arg)
spin_unlock(&tp->tp_lock);
wake_up(&tp->tp_waitq);
- /* DO NOT USE 'ARG' AFTER THIS POINT, EVER, EVER, EVER!
- * Local variables are used here because after the calling thread
+ /* DO NOT USE 'ARG' AFTER THIS POINT, EVER, EVER, EVER!
+ * Local variables are used here because after the calling thread
* has been woken up it will exit and this memory will no longer
* be safe to access since it was declared on the callers stack. */
if (func)
@@ -53,6 +53,7 @@ __thread_exit(void)
{
return;
}
+EXPORT_SYMBOL(__thread_exit);
/* thread_create() may block forever if it cannot create a thread or
* allocate memory. This is preferable to returning a NULL which Solaris
@@ -63,7 +64,6 @@ __thread_create(caddr_t stk, size_t stksize, void (*proc)(void *),
{
thread_priv_t tp;
DEFINE_WAIT(wait);
- kthread_t *task;
long pid;
/* Option pp is simply ignored */
@@ -106,8 +106,9 @@ __thread_create(caddr_t stk, size_t stksize, void (*proc)(void *),
/* Verify the pid retunred matches the pid in the task struct */
BUG_ON(pid != (tp.tp_task)->pid);
-
+
spin_unlock(&tp.tp_lock);
return (kthread_t *)tp.tp_task;
}
+EXPORT_SYMBOL(__thread_create);
diff --git a/src/splat/splat-condvar.c b/src/splat/splat-condvar.c
index eaab2ac0a..7c9b55784 100644
--- a/src/splat/splat-condvar.c
+++ b/src/splat/splat-condvar.c
@@ -1,5 +1,4 @@
-#include <sys/zfs_context.h>
-#include <sys/splat-ctl.h>
+#include <splat-ctl.h>
#define KZT_SUBSYSTEM_CONDVAR 0x0500
#define KZT_CONDVAR_NAME "condvar"
diff --git a/src/splat/splat-ctl.c b/src/splat/splat-ctl.c
index 5292b0e60..9bff58a65 100644
--- a/src/splat/splat-ctl.c
+++ b/src/splat/splat-ctl.c
@@ -19,13 +19,7 @@
* Author: Brian Behlendorf
*/
-#include <sys/zfs_context.h>
-#include <sys/splat-ctl.h>
-
-#include <linux/version.h>
-#include <linux/vmalloc.h>
-#include <linux/module.h>
-#include <linux/device.h>
+#include <splat-ctl.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
#include <linux/devfs_fs_kernel.h>
@@ -233,7 +227,7 @@ kzt_test_count(kzt_cfg_t *kcfg, unsigned long arg)
{
kzt_subsystem_t *sub;
kzt_test_t *test;
- int rc, i = 0;
+ int i = 0;
/* Subsystem ID passed as arg1 */
sub = kzt_subsystem_find(kcfg->cfg_arg1);
@@ -259,7 +253,7 @@ kzt_test_list(kzt_cfg_t *kcfg, unsigned long arg)
kzt_subsystem_t *sub;
kzt_test_t *test;
kzt_cfg_t *tmp;
- int size, rc, i = 0;
+ int size, i = 0;
/* Subsystem ID passed as arg1 */
sub = kzt_subsystem_find(kcfg->cfg_arg1);
@@ -309,7 +303,6 @@ static int
kzt_validate(struct file *file, kzt_subsystem_t *sub, int cmd, void *arg)
{
kzt_test_t *test;
- int rc = 0;
spin_lock(&(sub->test_lock));
list_for_each_entry(test, &(sub->test_list), test_list) {
@@ -432,7 +425,8 @@ static int
kzt_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
- int minor, rc = 0;
+ unsigned int minor = iminor(file->f_dentry->d_inode);
+ int rc = 0;
/* Ignore tty ioctls */
if ((cmd & 0xffffff00) == ((int)'T') << 8)
@@ -588,7 +582,7 @@ static int __init
kzt_init(void)
{
dev_t dev;
- int i, rc;
+ int rc;
spin_lock_init(&kzt_module_lock);
INIT_LIST_HEAD(&kzt_module_list);
@@ -603,7 +597,7 @@ kzt_init(void)
KZT_SUBSYSTEM_INIT(time);
dev = MKDEV(KZT_MAJOR, 0);
- if (rc = register_chrdev_region(dev, KZT_MINORS, "kztctl"))
+ if ((rc = register_chrdev_region(dev, KZT_MINORS, "kztctl")))
goto error;
/* Support for registering a character driver */
@@ -648,7 +642,6 @@ static void
kzt_fini(void)
{
dev_t dev = MKDEV(KZT_MAJOR, 0);
- int i;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
class_simple_device_remove(dev);
diff --git a/src/splat/splat-kmem.c b/src/splat/splat-kmem.c
index fb40819b5..d0af3fc52 100644
--- a/src/splat/splat-kmem.c
+++ b/src/splat/splat-kmem.c
@@ -1,5 +1,4 @@
-#include <sys/zfs_context.h>
-#include <sys/splat-ctl.h>
+#include <splat-ctl.h>
#define KZT_SUBSYSTEM_KMEM 0x0100
#define KZT_KMEM_NAME "kmem"
@@ -229,7 +228,7 @@ kzt_kmem_test3(struct file *file, void *arg)
out_free:
if (kcd)
kmem_cache_free(cache, kcd);
-out_destroy:
+
kmem_cache_destroy(cache);
return rc;
}
@@ -279,7 +278,7 @@ kzt_kmem_test4(struct file *file, void *arg)
kcp.kcp_cache = cache;
for (i = 0; i < KZT_KMEM_OBJ_COUNT; i++) {
- /* All allocations need not succeed */
+ /* All allocations need not succeed */
kcp.kcp_kcd[i] = kmem_cache_alloc(cache, 0);
if (!kcp.kcp_kcd[i]) {
kzt_vprint(file, KZT_KMEM_TEST4_NAME,
diff --git a/src/splat/splat-mutex.c b/src/splat/splat-mutex.c
index 254a40de2..47a36308e 100644
--- a/src/splat/splat-mutex.c
+++ b/src/splat/splat-mutex.c
@@ -1,5 +1,4 @@
-#include <sys/zfs_context.h>
-#include <sys/splat-ctl.h>
+#include <splat-ctl.h>
#define KZT_SUBSYSTEM_MUTEX 0x0400
#define KZT_MUTEX_NAME "mutex"
diff --git a/src/splat/splat-random.c b/src/splat/splat-random.c
index abb654063..412c1d62a 100644
--- a/src/splat/splat-random.c
+++ b/src/splat/splat-random.c
@@ -1,5 +1,4 @@
-#include <sys/zfs_context.h>
-#include <sys/splat-ctl.h>
+#include <splat-ctl.h>
#define KZT_SUBSYSTEM_KRNG 0x0300
#define KZT_KRNG_NAME "krng"
diff --git a/src/splat/splat-rwlock.c b/src/splat/splat-rwlock.c
index 9820937c3..df4585ea3 100644
--- a/src/splat/splat-rwlock.c
+++ b/src/splat/splat-rwlock.c
@@ -1,5 +1,4 @@
-#include <sys/zfs_context.h>
-#include <sys/splat-ctl.h>
+#include <splat-ctl.h>
#define KZT_SUBSYSTEM_RWLOCK 0x0700
#define KZT_RWLOCK_NAME "rwlock"
diff --git a/src/splat/splat-taskq.c b/src/splat/splat-taskq.c
index 614e7136c..3d5c075f4 100644
--- a/src/splat/splat-taskq.c
+++ b/src/splat/splat-taskq.c
@@ -1,5 +1,4 @@
-#include <sys/zfs_context.h>
-#include <sys/splat-ctl.h>
+#include <splat-ctl.h>
#define KZT_SUBSYSTEM_TASKQ 0x0200
#define KZT_TASKQ_NAME "taskq"
diff --git a/src/splat/splat-thread.c b/src/splat/splat-thread.c
index 0741db1fa..34260c2d6 100644
--- a/src/splat/splat-thread.c
+++ b/src/splat/splat-thread.c
@@ -1,5 +1,4 @@
-#include <sys/zfs_context.h>
-#include <sys/splat-ctl.h>
+#include <splat-ctl.h>
#define KZT_SUBSYSTEM_THREAD 0x0600
#define KZT_THREAD_NAME "thread"
diff --git a/src/splat/splat-time.c b/src/splat/splat-time.c
index b7d4ce86e..3e8007a37 100644
--- a/src/splat/splat-time.c
+++ b/src/splat/splat-time.c
@@ -1,5 +1,4 @@
-#include <sys/zfs_context.h>
-#include <sys/splat-ctl.h>
+#include <splat-ctl.h>
#define KZT_SUBSYSTEM_TIME 0x0800
#define KZT_TIME_NAME "time"