mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
De-inline spl_kthread_create().
The function was defined as a static inline with variable arguments which causes gcc to generate errors on some distros. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tim Chase <tim@chase2k.com> Closes #346
This commit is contained in:
committed by
Brian Behlendorf
parent
17a527cb0f
commit
ed650dee76
@@ -137,3 +137,31 @@ __thread_create(caddr_t stk, size_t stksize, thread_func_t func,
|
||||
SRETURN((kthread_t *)tsk);
|
||||
}
|
||||
EXPORT_SYMBOL(__thread_create);
|
||||
|
||||
/*
|
||||
* spl_kthread_create - Wrapper providing pre-3.13 semantics for
|
||||
* kthread_create() in which it is not killable and less likely
|
||||
* to return -ENOMEM.
|
||||
*/
|
||||
struct task_struct *
|
||||
spl_kthread_create(int (*func)(void *), void *data, const char namefmt[], ...)
|
||||
{
|
||||
struct task_struct *tsk;
|
||||
va_list args;
|
||||
|
||||
va_start(args, namefmt);
|
||||
do {
|
||||
tsk = kthread_create(func, data, namefmt, args);
|
||||
if (IS_ERR(tsk)) {
|
||||
if (signal_pending(current)) {
|
||||
clear_thread_flag(TIF_SIGPENDING);
|
||||
continue;
|
||||
}
|
||||
if (PTR_ERR(tsk) == -ENOMEM)
|
||||
continue;
|
||||
return (NULL);
|
||||
} else
|
||||
return (tsk);
|
||||
} while (1);
|
||||
}
|
||||
EXPORT_SYMBOL(spl_kthread_create);
|
||||
|
||||
Reference in New Issue
Block a user