summaryrefslogtreecommitdiffstats
path: root/module/spl
diff options
context:
space:
mode:
authorTim Chase <[email protected]>2014-03-26 08:29:24 -0500
committerBrian Behlendorf <[email protected]>2014-04-08 12:44:42 -0700
commit17a527cb0f44cef6582583e502621541061d8817 (patch)
tree5619e8f29e0272ef6206ffa788061bdccc47d971 /module/spl
parente19101e08f25708b03e5ff98a4da5756cfd709f7 (diff)
Support post-3.13 kthread_create() semantics.
Provide spl_kthread_create() as a wrapper to the kernel's kthread_create() to provide pre-3.13 semantics. Re-try if the call is interrupted or if it would have returned -ENOMEM. Otherwise return NULL. Signed-off-by: Chunwei Chen <[email protected]> Signed-off-by: Tim Chase <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #339
Diffstat (limited to 'module/spl')
-rw-r--r--module/spl/spl-debug.c3
-rw-r--r--module/spl/spl-taskq.c2
-rw-r--r--module/spl/spl-thread.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/module/spl/spl-debug.c b/module/spl/spl-debug.c
index d450368b1..93c3f31b8 100644
--- a/module/spl/spl-debug.c
+++ b/module/spl/spl-debug.c
@@ -38,6 +38,7 @@
#include <linux/file_compat.h>
#include <linux/swap.h>
#include <sys/sysmacros.h>
+#include <sys/thread.h>
#include <spl-debug.h>
#include <spl-trace.h>
#include <spl-ctl.h>
@@ -415,7 +416,7 @@ spl_debug_dumplog(int flags)
spl_debug_dumplog_internal(&dp);
} else {
- tsk = kthread_create(spl_debug_dumplog_thread,(void *)&dp,"spl_debug");
+ tsk = spl_kthread_create(spl_debug_dumplog_thread,(void *)&dp,"spl_debug");
if (tsk == NULL)
return -ENOMEM;
diff --git a/module/spl/spl-taskq.c b/module/spl/spl-taskq.c
index 3605a0f3b..48feb1d22 100644
--- a/module/spl/spl-taskq.c
+++ b/module/spl/spl-taskq.c
@@ -839,7 +839,7 @@ taskq_create(const char *name, int nthreads, pri_t pri,
tqt->tqt_tq = tq;
tqt->tqt_id = 0;
- tqt->tqt_thread = kthread_create(taskq_thread, tqt,
+ tqt->tqt_thread = spl_kthread_create(taskq_thread, tqt,
"%s/%d", name, i);
if (tqt->tqt_thread) {
list_add(&tqt->tqt_thread_list, &tq->tq_thread_list);
diff --git a/module/spl/spl-thread.c b/module/spl/spl-thread.c
index 6b3bec509..b0fa4d795 100644
--- a/module/spl/spl-thread.c
+++ b/module/spl/spl-thread.c
@@ -126,7 +126,7 @@ __thread_create(caddr_t stk, size_t stksize, thread_func_t func,
tp->tp_state = state;
tp->tp_pri = pri;
- tsk = kthread_create(thread_generic_wrapper, (void *)tp,
+ tsk = spl_kthread_create(thread_generic_wrapper, (void *)tp,
"%s", tp->tp_name);
if (IS_ERR(tsk)) {
SERROR("Failed to create thread: %ld\n", PTR_ERR(tsk));