diff options
author | Ryan Moeller <[email protected]> | 2020-08-17 14:01:19 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2020-08-17 11:01:19 -0700 |
commit | 3c3d7c8a57b278063952fc671fc2cf1589e45a6a (patch) | |
tree | fe19eeb939c88e9bd47281d13064504c61c0dbfb /include/os | |
parent | fc34dfba8e8238683e90e3fa83d16be3343886f6 (diff) |
FreeBSD: Create taskq threads in appropriate proc
Stepping stone toward re-enabling spa_thread on FreeBSD.
Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes #10715
Diffstat (limited to 'include/os')
-rw-r--r-- | include/os/freebsd/spl/sys/proc.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/os/freebsd/spl/sys/proc.h b/include/os/freebsd/spl/sys/proc.h index e52d37593..a455cfbab 100644 --- a/include/os/freebsd/spl/sys/proc.h +++ b/include/os/freebsd/spl/sys/proc.h @@ -61,13 +61,14 @@ typedef struct thread kthread_t; typedef struct thread *kthread_id_t; typedef struct proc proc_t; -extern struct proc *zfsproc; +extern proc_t *system_proc; static __inline kthread_t * do_thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg, size_t len, proc_t *pp, int state, pri_t pri, const char *name) { kthread_t *td = NULL; + proc_t **ppp; int error; /* @@ -77,8 +78,12 @@ do_thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg, ASSERT(len == 0); ASSERT(state == TS_RUN); - error = kproc_kthread_add(proc, arg, &zfsproc, &td, - RFSTOPPED, stksize / PAGE_SIZE, "zfskern", "%s", name); + if (pp == &p0) + ppp = &system_proc; + else + ppp = &pp; + error = kproc_kthread_add(proc, arg, ppp, &td, RFSTOPPED, + stksize / PAGE_SIZE, "zfskern", "%s", name); if (error == 0) { thread_lock(td); sched_prio(td, pri); |