]> git.proxmox.com Git - mirror_spl-debian.git/blobdiff - module/splat/splat-thread.c
New upstream version 0.7.2
[mirror_spl-debian.git] / module / splat / splat-thread.c
index a1e70db4759eef866be721d0fdedbc33c839d0a2..e99d691013c3caa053cb441fe96f9b034462c949 100644 (file)
 
 #include <sys/thread.h>
 #include <sys/random.h>
+#include <linux/delay.h>
+#include <linux/mm_compat.h>
+#include <linux/wait_compat.h>
+#include <linux/slab.h>
 #include "splat-internal.h"
 
 #define SPLAT_THREAD_NAME              "thread"
@@ -51,7 +55,7 @@ typedef struct thread_priv {
         unsigned long tp_magic;
         struct file *tp_file;
         spinlock_t tp_lock;
-        wait_queue_head_t tp_waitq;
+        spl_wait_queue_head_t tp_waitq;
        uint_t tp_keys[SPLAT_THREAD_TEST_KEYS];
        int tp_rc;
        int tp_count;
@@ -109,7 +113,7 @@ splat_thread_test1(struct file *file, void *arg)
        tp.tp_rc = 0;
 
        thr = (kthread_t *)thread_create(NULL, 0, splat_thread_work1, &tp, 0,
-                                        &p0, TS_RUN, minclsyspri);
+                                        &p0, TS_RUN, defclsyspri);
        /* Must never fail under Solaris, but we check anyway since this
         * can happen in the linux SPL, we may want to change this behavior */
        if (thr == NULL)
@@ -158,7 +162,7 @@ splat_thread_test2(struct file *file, void *arg)
        tp.tp_rc = 0;
 
        thr = (kthread_t *)thread_create(NULL, 0, splat_thread_work2, &tp, 0,
-                                        &p0, TS_RUN, minclsyspri);
+                                        &p0, TS_RUN, defclsyspri);
        /* Must never fail under Solaris, but we check anyway since this
         * can happen in the linux SPL, we may want to change this behavior */
        if (thr == NULL)
@@ -275,7 +279,7 @@ splat_thread_test3(struct file *file, void *arg)
        /* Start tsd wait threads */
        for (i = 0; i < SPLAT_THREAD_TEST_THREADS; i++) {
                if (thread_create(NULL, 0, splat_thread_work3_wait,
-                                 &tp, 0, &p0, TS_RUN, minclsyspri))
+                                 &tp, 0, &p0, TS_RUN, defclsyspri))
                        wait_count++;
        }
 
@@ -292,7 +296,7 @@ splat_thread_test3(struct file *file, void *arg)
        /* Start tsd exit threads */
        for (i = 0; i < SPLAT_THREAD_TEST_THREADS; i++) {
                if (thread_create(NULL, 0, splat_thread_work3_exit,
-                                 &tp, 0, &p0, TS_RUN, minclsyspri))
+                                 &tp, 0, &p0, TS_RUN, defclsyspri))
                        exit_count++;
        }
 
@@ -359,11 +363,11 @@ splat_thread_init(void)
         spin_lock_init(&sub->test_lock);
         sub->desc.id = SPLAT_SUBSYSTEM_THREAD;
 
-        SPLAT_TEST_INIT(sub, SPLAT_THREAD_TEST1_NAME, SPLAT_THREAD_TEST1_DESC,
+        splat_test_init(sub, SPLAT_THREAD_TEST1_NAME, SPLAT_THREAD_TEST1_DESC,
                       SPLAT_THREAD_TEST1_ID, splat_thread_test1);
-        SPLAT_TEST_INIT(sub, SPLAT_THREAD_TEST2_NAME, SPLAT_THREAD_TEST2_DESC,
+        splat_test_init(sub, SPLAT_THREAD_TEST2_NAME, SPLAT_THREAD_TEST2_DESC,
                       SPLAT_THREAD_TEST2_ID, splat_thread_test2);
-        SPLAT_TEST_INIT(sub, SPLAT_THREAD_TEST3_NAME, SPLAT_THREAD_TEST3_DESC,
+        splat_test_init(sub, SPLAT_THREAD_TEST3_NAME, SPLAT_THREAD_TEST3_DESC,
                       SPLAT_THREAD_TEST3_ID, splat_thread_test3);
 
         return sub;
@@ -373,9 +377,9 @@ void
 splat_thread_fini(splat_subsystem_t *sub)
 {
         ASSERT(sub);
-        SPLAT_TEST_FINI(sub, SPLAT_THREAD_TEST3_ID);
-        SPLAT_TEST_FINI(sub, SPLAT_THREAD_TEST2_ID);
-        SPLAT_TEST_FINI(sub, SPLAT_THREAD_TEST1_ID);
+        splat_test_fini(sub, SPLAT_THREAD_TEST3_ID);
+        splat_test_fini(sub, SPLAT_THREAD_TEST2_ID);
+        splat_test_fini(sub, SPLAT_THREAD_TEST1_ID);
 
         kfree(sub);
 }