Rename the kthread_xxx (e.g. kthread_create()) calls
to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first. I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls.
This commit is contained in:
parent
2b3e7485f6
commit
3745c395ec
@ -1562,7 +1562,7 @@ xpt_init(void *dummy)
|
||||
}
|
||||
|
||||
/* fire up rescan thread */
|
||||
if (kthread_create(xpt_scanner_thread, NULL, NULL, 0, 0, "xpt_thrd")) {
|
||||
if (kproc_create(xpt_scanner_thread, NULL, NULL, 0, 0, "xpt_thrd")) {
|
||||
printf("xpt_init: failed to create rescan thread\n");
|
||||
}
|
||||
/* Install our software interrupt handlers */
|
||||
|
@ -77,12 +77,12 @@ thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg,
|
||||
ASSERT(len == 0);
|
||||
ASSERT(state == TS_RUN);
|
||||
|
||||
error = kthread_create(proc, arg, &p, 0, ZFS_KSTACK_PAGES,
|
||||
error = kproc_create(proc, arg, &p, 0, ZFS_KSTACK_PAGES,
|
||||
"solthread %p", proc);
|
||||
return (error == 0 ? FIRST_THREAD_IN_PROC(p) : NULL);
|
||||
}
|
||||
|
||||
#define thread_exit() kthread_exit(0)
|
||||
#define thread_exit() kproc_exit(0)
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
|
@ -207,7 +207,7 @@ vdev_geom_worker(void *arg)
|
||||
ctx->gc_state = 2;
|
||||
wakeup_one(&ctx->gc_state);
|
||||
mtx_unlock(&ctx->gc_queue_mtx);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
msleep(&ctx->gc_queue, &ctx->gc_queue_mtx,
|
||||
PRIBIO | PDROP, "vgeom:io", 0);
|
||||
@ -440,7 +440,7 @@ vdev_geom_open(vdev_t *vd, uint64_t *psize, uint64_t *ashift)
|
||||
|
||||
vd->vdev_tsd = ctx;
|
||||
|
||||
kthread_create(vdev_geom_worker, ctx, NULL, 0, 0, "vdev:worker %s",
|
||||
kproc_create(vdev_geom_worker, ctx, NULL, 0, 0, "vdev:worker %s",
|
||||
pp->name);
|
||||
|
||||
return (0);
|
||||
|
@ -359,7 +359,7 @@ zvol_worker(void *arg)
|
||||
zv->zv_state = 2;
|
||||
wakeup(&zv->zv_state);
|
||||
mtx_unlock(&zv->zv_queue_mtx);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
msleep(&zv->zv_queue, &zv->zv_queue_mtx, PRIBIO | PDROP,
|
||||
"zvol:io", 0);
|
||||
@ -543,7 +543,7 @@ zvol_create_minor(const char *name, dev_t dev)
|
||||
bioq_init(&zv->zv_queue);
|
||||
mtx_init(&zv->zv_queue_mtx, "zvol", NULL, MTX_DEF);
|
||||
zv->zv_state = 0;
|
||||
kthread_create(zvol_worker, zv, NULL, 0, 0, "zvol:worker %s", pp->name);
|
||||
kproc_create(zvol_worker, zv, NULL, 0, 0, "zvol:worker %s", pp->name);
|
||||
|
||||
zvol_minors++;
|
||||
end:
|
||||
|
@ -316,7 +316,7 @@ ntoskrnl_libinit()
|
||||
kq = kq_queues + i;
|
||||
kq->kq_cpu = i;
|
||||
sprintf(name, "Windows DPC %d", i);
|
||||
error = kthread_create(ntoskrnl_dpc_thread, kq, &p,
|
||||
error = kproc_create(ntoskrnl_dpc_thread, kq, &p,
|
||||
RFHIGHPID, NDIS_KSTACK_PAGES, name);
|
||||
if (error)
|
||||
panic("failed to launch DPC thread");
|
||||
@ -329,7 +329,7 @@ ntoskrnl_libinit()
|
||||
for (i = 0; i < WORKITEM_THREADS; i++) {
|
||||
kq = wq_queues + i;
|
||||
sprintf(name, "Windows Workitem %d", i);
|
||||
error = kthread_create(ntoskrnl_workitem_thread, kq, &p,
|
||||
error = kproc_create(ntoskrnl_workitem_thread, kq, &p,
|
||||
RFHIGHPID, NDIS_KSTACK_PAGES, name);
|
||||
if (error)
|
||||
panic("failed to launch workitem thread");
|
||||
@ -2801,7 +2801,7 @@ ntoskrnl_workitem_thread(arg)
|
||||
#if __FreeBSD_version < 502113
|
||||
mtx_lock(&Giant);
|
||||
#endif
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
return; /* notreached */
|
||||
}
|
||||
|
||||
@ -3519,7 +3519,7 @@ PsCreateSystemThread(handle, reqaccess, objattrs, phandle,
|
||||
tc->tc_thrfunc = thrfunc;
|
||||
|
||||
sprintf(tname, "windows kthread %d", ntoskrnl_kth);
|
||||
error = kthread_create(ntoskrnl_thrfunc, tc, &p,
|
||||
error = kproc_create(ntoskrnl_thrfunc, tc, &p,
|
||||
RFHIGHPID, NDIS_KSTACK_PAGES, tname);
|
||||
|
||||
if (error) {
|
||||
@ -3562,7 +3562,7 @@ PsTerminateSystemThread(status)
|
||||
#if __FreeBSD_version < 502113
|
||||
mtx_lock(&Giant);
|
||||
#endif
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
return(0); /* notreached */
|
||||
}
|
||||
|
||||
@ -3871,7 +3871,7 @@ ntoskrnl_dpc_thread(arg)
|
||||
#if __FreeBSD_version < 502113
|
||||
mtx_lock(&Giant);
|
||||
#endif
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
return; /* notreached */
|
||||
}
|
||||
|
||||
|
@ -77,12 +77,12 @@ thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg,
|
||||
ASSERT(len == 0);
|
||||
ASSERT(state == TS_RUN);
|
||||
|
||||
error = kthread_create(proc, arg, &p, 0, ZFS_KSTACK_PAGES,
|
||||
error = kproc_create(proc, arg, &p, 0, ZFS_KSTACK_PAGES,
|
||||
"solthread %p", proc);
|
||||
return (error == 0 ? FIRST_THREAD_IN_PROC(p) : NULL);
|
||||
}
|
||||
|
||||
#define thread_exit() kthread_exit(0)
|
||||
#define thread_exit() kproc_exit(0)
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
|
@ -207,7 +207,7 @@ vdev_geom_worker(void *arg)
|
||||
ctx->gc_state = 2;
|
||||
wakeup_one(&ctx->gc_state);
|
||||
mtx_unlock(&ctx->gc_queue_mtx);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
msleep(&ctx->gc_queue, &ctx->gc_queue_mtx,
|
||||
PRIBIO | PDROP, "vgeom:io", 0);
|
||||
@ -440,7 +440,7 @@ vdev_geom_open(vdev_t *vd, uint64_t *psize, uint64_t *ashift)
|
||||
|
||||
vd->vdev_tsd = ctx;
|
||||
|
||||
kthread_create(vdev_geom_worker, ctx, NULL, 0, 0, "vdev:worker %s",
|
||||
kproc_create(vdev_geom_worker, ctx, NULL, 0, 0, "vdev:worker %s",
|
||||
pp->name);
|
||||
|
||||
return (0);
|
||||
|
@ -359,7 +359,7 @@ zvol_worker(void *arg)
|
||||
zv->zv_state = 2;
|
||||
wakeup(&zv->zv_state);
|
||||
mtx_unlock(&zv->zv_queue_mtx);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
msleep(&zv->zv_queue, &zv->zv_queue_mtx, PRIBIO | PDROP,
|
||||
"zvol:io", 0);
|
||||
@ -543,7 +543,7 @@ zvol_create_minor(const char *name, dev_t dev)
|
||||
bioq_init(&zv->zv_queue);
|
||||
mtx_init(&zv->zv_queue_mtx, "zvol", NULL, MTX_DEF);
|
||||
zv->zv_state = 0;
|
||||
kthread_create(zvol_worker, zv, NULL, 0, 0, "zvol:worker %s", pp->name);
|
||||
kproc_create(zvol_worker, zv, NULL, 0, 0, "zvol:worker %s", pp->name);
|
||||
|
||||
zvol_minors++;
|
||||
end:
|
||||
|
@ -988,7 +988,7 @@ pf_purge_thread(void *v)
|
||||
sx_sunlock(&pf_consistency_lock);
|
||||
PF_UNLOCK();
|
||||
wakeup(pf_purge_thread);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
#endif
|
||||
s = splsoftnet();
|
||||
|
@ -386,7 +386,7 @@ pfattach(void)
|
||||
/* XXX do our best to avoid a conflict */
|
||||
pf_status.hostid = arc4random();
|
||||
|
||||
if (kthread_create(pf_purge_thread, NULL, NULL, 0, 0, "pfpurge"))
|
||||
if (kproc_create(pf_purge_thread, NULL, NULL, 0, 0, "pfpurge"))
|
||||
return (ENXIO);
|
||||
|
||||
return (error);
|
||||
@ -464,13 +464,13 @@ pfattach(int num)
|
||||
pf_status.hostid = arc4random();
|
||||
|
||||
/* require process context to purge states, so perform in a thread */
|
||||
kthread_create_deferred(pf_thread_create, NULL);
|
||||
kproc_create_deferred(pf_thread_create, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
pf_thread_create(void *v)
|
||||
{
|
||||
if (kthread_create(pf_purge_thread, NULL, NULL, "pfpurge"))
|
||||
if (kproc_create(pf_purge_thread, NULL, NULL, "pfpurge"))
|
||||
panic("pfpurge thread");
|
||||
}
|
||||
|
||||
|
@ -354,7 +354,7 @@ aac_attach(struct aac_softc *sc)
|
||||
sc->aac_dev_t->si_drv1 = sc;
|
||||
|
||||
/* Create the AIF thread */
|
||||
if (kthread_create((void(*)(void *))aac_command_thread, sc,
|
||||
if (kproc_create((void(*)(void *))aac_command_thread, sc,
|
||||
&sc->aifthread, 0, 0, "aac%daif", unit))
|
||||
panic("Could not create AIF thread\n");
|
||||
|
||||
@ -990,7 +990,7 @@ aac_command_thread(struct aac_softc *sc)
|
||||
mtx_unlock(&sc->aac_io_lock);
|
||||
wakeup(sc->aac_dev);
|
||||
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -301,7 +301,7 @@ acpi_tz_attach(device_t dev)
|
||||
sc->tz_event = EVENTHANDLER_REGISTER(power_profile_change,
|
||||
acpi_tz_power_profile, sc, 0);
|
||||
if (acpi_tz_proc == NULL) {
|
||||
error = kthread_create(acpi_tz_thread, NULL, &acpi_tz_proc,
|
||||
error = kproc_create(acpi_tz_thread, NULL, &acpi_tz_proc,
|
||||
RFHIGHPID, 0, "acpi_thermal");
|
||||
if (error != 0) {
|
||||
device_printf(sc->tz_dev, "could not create thread - %d", error);
|
||||
@ -1088,7 +1088,7 @@ acpi_tz_cooling_thread(void *arg)
|
||||
ACPI_LOCK(thermal);
|
||||
sc->tz_cooling_proc_running = FALSE;
|
||||
ACPI_UNLOCK(thermal);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1121,7 +1121,7 @@ acpi_tz_cooling_thread_start(struct acpi_tz_softc *sc)
|
||||
if (sc->tz_cooling_proc == NULL) {
|
||||
snprintf(name, sizeof(name), "acpi_cooling%d",
|
||||
device_get_unit(sc->tz_dev));
|
||||
error = kthread_create(acpi_tz_cooling_thread, sc,
|
||||
error = kproc_create(acpi_tz_cooling_thread, sc,
|
||||
&sc->tz_cooling_proc, RFHIGHPID, 0, name);
|
||||
if (error != 0) {
|
||||
device_printf(sc->tz_dev, "could not create thread - %d", error);
|
||||
|
@ -125,7 +125,7 @@ aic_recovery_thread(void *arg)
|
||||
aic->platform_data->recovery_thread = NULL;
|
||||
wakeup(aic->platform_data);
|
||||
aic_unlock(aic);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -127,10 +127,10 @@ aic_wakeup_recovery_thread(struct aic_softc *aic)
|
||||
/****************************** Kernel Threads ********************************/
|
||||
#if __FreeBSD_version > 500005
|
||||
#define aic_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \
|
||||
kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg)
|
||||
kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg)
|
||||
#else
|
||||
#define aic_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \
|
||||
kthread_create(func, farg, proc_ptr, fmtstr, arg)
|
||||
kproc_create(func, farg, proc_ptr, fmtstr, arg)
|
||||
#endif
|
||||
|
||||
/******************************* Bus Space/DMA ********************************/
|
||||
|
@ -899,7 +899,7 @@ static void msp3400c_thread(void *data)
|
||||
wakeup(&msp->kthread);
|
||||
mtx_unlock(&Giant);
|
||||
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
@ -1126,7 +1126,7 @@ static void msp3410d_thread(void *data)
|
||||
wakeup(&msp->kthread);
|
||||
mtx_unlock(&Giant);
|
||||
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
int msp_attach(bktr_ptr_t bktr)
|
||||
@ -1197,11 +1197,11 @@ int msp_attach(bktr_ptr_t bktr)
|
||||
}
|
||||
|
||||
/* startup control thread */
|
||||
err = kthread_create(msp->simple ? msp3410d_thread : msp3400c_thread,
|
||||
err = kproc_create(msp->simple ? msp3410d_thread : msp3400c_thread,
|
||||
bktr, &msp->kthread, (RFFDG | RFPROC), 0,
|
||||
msp->threaddesc);
|
||||
if (err) {
|
||||
printf("%s: Error returned by kthread_create: %d", bktr_name(bktr), err);
|
||||
printf("%s: Error returned by kproc_create: %d", bktr_name(bktr), err);
|
||||
free(msp->threaddesc, M_DEVBUF);
|
||||
free(msp, M_DEVBUF);
|
||||
bktr->msp3400c_info = NULL;
|
||||
|
@ -3807,7 +3807,7 @@ ciss_notify_thread(void *arg)
|
||||
#if __FreeBSD_version >= 500000
|
||||
mtx_unlock(&sc->ciss_mtx);
|
||||
#endif
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
@ -3818,11 +3818,11 @@ ciss_spawn_notify_thread(struct ciss_softc *sc)
|
||||
{
|
||||
|
||||
#if __FreeBSD_version > 500005
|
||||
if (kthread_create((void(*)(void *))ciss_notify_thread, sc,
|
||||
if (kproc_create((void(*)(void *))ciss_notify_thread, sc,
|
||||
&sc->ciss_notify_thread, 0, 0, "ciss_notify%d",
|
||||
device_get_unit(sc->ciss_dev)))
|
||||
#else
|
||||
if (kthread_create((void(*)(void *))ciss_notify_thread, sc,
|
||||
if (kproc_create((void(*)(void *))ciss_notify_thread, sc,
|
||||
&sc->ciss_notify_thread, "ciss_notify%d",
|
||||
device_get_unit(sc->ciss_dev)))
|
||||
#endif
|
||||
|
@ -1207,7 +1207,7 @@ fdc_thread(void *arg)
|
||||
fdc->flags &= ~(FDC_KTHREAD_EXIT | FDC_KTHREAD_ALIVE);
|
||||
mtx_unlock(&fdc->fdc_mtx);
|
||||
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1795,7 +1795,7 @@ fdc_attach(device_t dev)
|
||||
fdout_wr(fdc, fdc->fdout = 0);
|
||||
bioq_init(&fdc->head);
|
||||
|
||||
kthread_create(fdc_thread, fdc, &fdc->fdc_thread, 0, 0,
|
||||
kproc_create(fdc_thread, fdc, &fdc->fdc_thread, 0, 0,
|
||||
"fdc%d", device_get_unit(dev));
|
||||
|
||||
settle = hz / 8;
|
||||
|
@ -440,7 +440,7 @@ firewire_attach(device_t dev)
|
||||
(void *)firewire_watchdog, (void *)sc->fc);
|
||||
|
||||
/* create thread */
|
||||
kthread_create(fw_bus_probe_thread, (void *)fc, &fc->probe_thread,
|
||||
kproc_create(fw_bus_probe_thread, (void *)fc, &fc->probe_thread,
|
||||
0, 0, "fw%d_probe", unit);
|
||||
|
||||
/* Locate our children */
|
||||
@ -1661,7 +1661,7 @@ fw_bus_probe_thread(void *arg)
|
||||
msleep((void *)fc, &fc->wait_lock, PWAIT|PCATCH, "-", 0);
|
||||
}
|
||||
mtx_unlock(&fc->wait_lock);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -181,7 +181,7 @@ at45d_delayed_attach(void *xsc)
|
||||
sc->disk->d_unit = device_get_unit(sc->dev);
|
||||
disk_create(sc->disk, DISK_VERSION);
|
||||
bioq_init(&sc->bio_queue);
|
||||
kthread_create(&at45d_task, sc, &sc->p, 0, 0, "task: at45d flash");
|
||||
kproc_create(&at45d_task, sc, &sc->p, 0, 0, "task: at45d flash");
|
||||
|
||||
config_intrhook_disestablish(&sc->config_intrhook);
|
||||
}
|
||||
|
@ -2396,7 +2396,7 @@ static void hpt_worker_thread(void)
|
||||
#endif
|
||||
*/
|
||||
#if (__FreeBSD_version >= 500043)
|
||||
kthread_suspend_check(curproc);
|
||||
kproc_suspend_check(curproc);
|
||||
#else
|
||||
kproc_suspend_loop(curproc);
|
||||
#endif
|
||||
|
@ -362,7 +362,7 @@ pmclog_loop(void *arg)
|
||||
|
||||
crfree(ownercred);
|
||||
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -566,7 +566,7 @@ pmclog_configure_log(struct pmc_owner *po, int logfd)
|
||||
|
||||
/* mark process as owning a log file */
|
||||
po->po_flags |= PMC_PO_OWNS_LOGFILE;
|
||||
error = kthread_create(pmclog_loop, po, &po->po_kthread,
|
||||
error = kproc_create(pmclog_loop, po, &po->po_kthread,
|
||||
RFHIGHPID, 0, "hwpmc: proc(%d)", p->p_pid);
|
||||
if (error)
|
||||
goto error;
|
||||
|
@ -741,7 +741,7 @@ ndis_attach(dev)
|
||||
#else
|
||||
sc->ndis_tq = taskqueue_create("ndis_taskq", M_NOWAIT | M_ZERO,
|
||||
taskqueue_thread_enqueue, &sc->ndis_tq, &sc->sc_tqproc);
|
||||
kthread_create(taskqueue_thread_loop, &sc->ndis_tq, &sc->sc_tqproc,
|
||||
kproc_create(taskqueue_thread_loop, &sc->ndis_tq, &sc->sc_tqproc,
|
||||
0, 0, "%s taskq", device_get_nameunit(dev));
|
||||
#endif
|
||||
TASK_INIT(&sc->ndis_scantask, 0, ndis_scan, sc);
|
||||
|
@ -466,14 +466,14 @@ kcs_loop(void *arg)
|
||||
ipmi_complete_request(sc, req);
|
||||
}
|
||||
IPMI_UNLOCK(sc);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
static int
|
||||
kcs_startup(struct ipmi_softc *sc)
|
||||
{
|
||||
|
||||
return (kthread_create(kcs_loop, sc, &sc->ipmi_kthread, 0, 0, "%s: kcs",
|
||||
return (kproc_create(kcs_loop, sc, &sc->ipmi_kthread, 0, 0, "%s: kcs",
|
||||
device_get_nameunit(sc->ipmi_dev)));
|
||||
}
|
||||
|
||||
|
@ -372,14 +372,14 @@ smic_loop(void *arg)
|
||||
ipmi_complete_request(sc, req);
|
||||
}
|
||||
IPMI_UNLOCK(sc);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
static int
|
||||
smic_startup(struct ipmi_softc *sc)
|
||||
{
|
||||
|
||||
return (kthread_create(smic_loop, sc, &sc->ipmi_kthread, 0, 0,
|
||||
return (kproc_create(smic_loop, sc, &sc->ipmi_kthread, 0, 0,
|
||||
"%s: smic", device_get_nameunit(sc->ipmi_dev)));
|
||||
}
|
||||
|
||||
|
@ -348,14 +348,14 @@ ssif_loop(void *arg)
|
||||
IPMI_LOCK(sc);
|
||||
}
|
||||
IPMI_UNLOCK(sc);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
static int
|
||||
ssif_startup(struct ipmi_softc *sc)
|
||||
{
|
||||
|
||||
return (kthread_create(ssif_loop, sc, &sc->ipmi_kthread, 0, 0,
|
||||
return (kproc_create(ssif_loop, sc, &sc->ipmi_kthread, 0, 0,
|
||||
"%s: ssif", device_get_nameunit(sc->ipmi_dev)));
|
||||
}
|
||||
|
||||
|
@ -587,7 +587,7 @@ ism_proc(void *vp)
|
||||
sdebug(3, "terminated");
|
||||
|
||||
wakeup(sp);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
#if 0
|
||||
@ -782,5 +782,5 @@ ism_start(isc_session_t *sp)
|
||||
|
||||
sp->flags |= ISC_SM_RUN;
|
||||
|
||||
return kthread_create(ism_proc, sp, &sp->stp, 0, 0, "ism_%d", sp->sid);
|
||||
return kproc_create(ism_proc, sp, &sp->stp, 0, 0, "ism_%d", sp->sid);
|
||||
}
|
||||
|
@ -539,7 +539,7 @@ isc_soc(void *vp)
|
||||
|
||||
mtx_unlock(&sp->io_mtx);
|
||||
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
void
|
||||
@ -572,5 +572,5 @@ isc_start_receiver(isc_session_t *sp)
|
||||
debug_called(8);
|
||||
|
||||
sp->flags |= ISC_CON_RUN;
|
||||
kthread_create(isc_soc, sp, &sp->soc_proc, 0, 0, "iscsi%d", sp->sid);
|
||||
kproc_create(isc_soc, sp, &sp->soc_proc, 0, 0, "iscsi%d", sp->sid);
|
||||
}
|
||||
|
@ -251,11 +251,11 @@ isp_attach(ispsoftc_t *isp)
|
||||
isp_callout_init(&isp->isp_osinfo.gdt);
|
||||
ISP_UNLOCK(isp);
|
||||
#if __FreeBSD_version >= 500000
|
||||
if (kthread_create(isp_kthread, isp, &isp->isp_osinfo.kproc,
|
||||
if (kproc_create(isp_kthread, isp, &isp->isp_osinfo.kproc,
|
||||
RFHIGHPID, 0, "%s: fc_thrd",
|
||||
device_get_nameunit(isp->isp_dev)))
|
||||
#else
|
||||
if (kthread_create(isp_kthread, isp, &isp->isp_osinfo.kproc,
|
||||
if (kproc_create(isp_kthread, isp, &isp->isp_osinfo.kproc,
|
||||
"%s: fc_thrd", device_get_nameunit(isp->isp_dev)))
|
||||
#endif
|
||||
{
|
||||
|
@ -279,11 +279,11 @@ iwi_attach(device_t dev)
|
||||
#else
|
||||
sc->sc_tq = taskqueue_create("iwi_taskq", M_NOWAIT | M_ZERO,
|
||||
taskqueue_thread_enqueue, &sc->sc_tq, &sc->sc_tqproc);
|
||||
kthread_create(taskqueue_thread_loop, &sc->sc_tq, &sc->sc_tqproc,
|
||||
kproc_create(taskqueue_thread_loop, &sc->sc_tq, &sc->sc_tqproc,
|
||||
0, 0, "%s taskq", device_get_nameunit(dev));
|
||||
sc->sc_tq2 = taskqueue_create("iwi_taskq2", M_NOWAIT | M_ZERO,
|
||||
taskqueue_thread_enqueue, &sc->sc_tq2, &sc->sc_tqproc);
|
||||
kthread_create(taskqueue_thread_loop, &sc->sc_tq2, &sc->sc_tqproc,
|
||||
kproc_create(taskqueue_thread_loop, &sc->sc_tq2, &sc->sc_tqproc,
|
||||
0, 0, "%s taskq2", device_get_nameunit(dev));
|
||||
#endif
|
||||
TASK_INIT(&sc->sc_radiontask, 0, iwi_radio_on, sc);
|
||||
|
@ -701,7 +701,7 @@ md_kthread(void *arg)
|
||||
if (sc->flags & MD_SHUTDOWN) {
|
||||
sc->flags |= MD_EXITING;
|
||||
mtx_unlock(&sc->queue_mtx);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
bp = bioq_takefirst(&sc->bio_queue);
|
||||
if (!bp) {
|
||||
@ -765,7 +765,7 @@ mdnew(int unit, int *errp, enum md_types type)
|
||||
sc->unit = unit;
|
||||
sprintf(sc->name, "md%d", unit);
|
||||
LIST_INSERT_HEAD(&md_softc_list, sc, list);
|
||||
error = kthread_create(md_kthread, sc, &sc->procp, 0, 0,"%s", sc->name);
|
||||
error = kproc_create(md_kthread, sc, &sc->procp, 0, 0,"%s", sc->name);
|
||||
if (error == 0)
|
||||
return (sc);
|
||||
LIST_REMOVE(sc, list);
|
||||
|
@ -134,7 +134,7 @@ mmcsd_attach(device_t dev)
|
||||
bioq_init(&sc->bio_queue);
|
||||
|
||||
sc->running = 1;
|
||||
kthread_create(&mmcsd_task, sc, &sc->p, 0, 0, "task: mmc/sd card");
|
||||
kproc_create(&mmcsd_task, sc, &sc->p, 0, 0, "task: mmc/sd card");
|
||||
|
||||
return (0);
|
||||
}
|
||||
@ -284,7 +284,7 @@ mmcsd_task(void *arg)
|
||||
wakeup(sc);
|
||||
MMCSD_UNLOCK(sc);
|
||||
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
static device_method_t mmcsd_methods[] = {
|
||||
|
@ -273,10 +273,10 @@ void mpt_map_rquest(void *, bus_dma_segment_t *, int, int);
|
||||
/**************************** Kernel Thread Support ***************************/
|
||||
#if __FreeBSD_version > 500005
|
||||
#define mpt_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \
|
||||
kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg)
|
||||
kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg)
|
||||
#else
|
||||
#define mpt_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \
|
||||
kthread_create(func, farg, proc_ptr, fmtstr, arg)
|
||||
kproc_create(func, farg, proc_ptr, fmtstr, arg)
|
||||
#endif
|
||||
|
||||
/****************************** Timer Facilities ******************************/
|
||||
|
@ -3988,7 +3988,7 @@ mpt_recovery_thread(void *arg)
|
||||
mpt->recovery_thread = NULL;
|
||||
wakeup(&mpt->recovery_thread);
|
||||
MPT_UNLOCK(mpt);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -722,7 +722,7 @@ mpt_raid_thread(void *arg)
|
||||
mpt->raid_thread = NULL;
|
||||
wakeup(&mpt->raid_thread);
|
||||
MPT_UNLOCK(mpt);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
@ -169,7 +169,7 @@ g_ofwd_init(struct g_class *mp __unused)
|
||||
sc->ofwd_sectorsize = OFWD_BLOCKSIZE;
|
||||
sc->ofwd_fwsectors = 0;
|
||||
sc->ofwd_fwheads = 0;
|
||||
error = kthread_create(ofwd_kthread, sc, &sc->ofwd_procp, 0, 0,
|
||||
error = kproc_create(ofwd_kthread, sc, &sc->ofwd_procp, 0, 0,
|
||||
"ofwd0");
|
||||
if (error != 0) {
|
||||
free(sc, M_DEVBUF);
|
||||
|
@ -332,11 +332,11 @@ cbb_detach(device_t brdev)
|
||||
cbb_set(sc, CBB_SOCKET_EVENT, 0xffffffff);
|
||||
|
||||
/*
|
||||
* Wait for the thread to die. kthread_exit will do a wakeup
|
||||
* Wait for the thread to die. kproc_exit will do a wakeup
|
||||
* on the event thread's struct thread * so that we know it is
|
||||
* safe to proceed. IF the thread is running, set the please
|
||||
* die flag and wait for it to comply. Since the wakeup on
|
||||
* the event thread happens only in kthread_exit, we don't
|
||||
* the event thread happens only in kproc_exit, we don't
|
||||
* need to loop here.
|
||||
*/
|
||||
bus_teardown_intr(brdev, sc->irq_res, sc->intrhand);
|
||||
@ -529,7 +529,7 @@ cbb_event_thread(void *arg)
|
||||
DEVPRINTF((sc->dev, "Thread terminating\n"));
|
||||
sc->flags &= ~CBB_KTHREAD_RUNNING;
|
||||
mtx_unlock(&sc->mtx);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
@ -434,7 +434,7 @@ cbb_pci_attach(device_t brdev)
|
||||
cbb_print_config(brdev);
|
||||
|
||||
/* Start the thread */
|
||||
if (kthread_create(cbb_event_thread, sc, &sc->event_thread, 0, 0,
|
||||
if (kproc_create(cbb_event_thread, sc, &sc->event_thread, 0, 0,
|
||||
"%s event thread", device_get_nameunit(brdev))) {
|
||||
device_printf(brdev, "unable to create event thread.\n");
|
||||
panic("cbb_create_event_thread");
|
||||
|
@ -120,7 +120,7 @@ read_random_phony(void *buf, int count)
|
||||
return (count);
|
||||
}
|
||||
|
||||
/* Helper routine to enable kthread_exit() to work while the module is
|
||||
/* Helper routine to enable kproc_exit() to work while the module is
|
||||
* being (or has been) unloaded.
|
||||
* This routine is in this file because it is always linked into the kernel,
|
||||
* and will thus never be unloaded. This is critical for unloadable modules
|
||||
@ -130,6 +130,6 @@ void
|
||||
random_set_wakeup_exit(void *control)
|
||||
{
|
||||
wakeup(control);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ random_yarrow_init(void)
|
||||
mtx_init(&harvest_mtx, "entropy harvest mutex", NULL, MTX_SPIN);
|
||||
|
||||
/* Start the hash/reseed thread */
|
||||
error = kthread_create(random_kthread, NULL,
|
||||
error = kproc_create(random_kthread, NULL,
|
||||
&random_kthread_proc, RFHIGHPID, 0, "yarrow");
|
||||
if (error != 0)
|
||||
panic("Cannot create entropy maintenance thread.");
|
||||
|
@ -461,7 +461,7 @@ seq_eventthread(void *arg)
|
||||
mtx_unlock(&scp->seq_lock);
|
||||
mtx_lock(&Giant);
|
||||
SEQ_DEBUG(2, printf("seq_eventthread finished\n"));
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -576,7 +576,7 @@ seq_addunit(void)
|
||||
* TODO: Add to list of sequencers this module provides
|
||||
*/
|
||||
|
||||
ret = kthread_create(seq_eventthread, scp, NULL, RFHIGHPID, 0,
|
||||
ret = kproc_create(seq_eventthread, scp, NULL, RFHIGHPID, 0,
|
||||
"sequencer %02d", scp->unit);
|
||||
|
||||
if (ret)
|
||||
|
@ -338,7 +338,7 @@ usb_create_event_thread(void *arg)
|
||||
struct usb_taskq *taskq;
|
||||
int i;
|
||||
|
||||
if (kthread_create(usb_event_thread, sc, &sc->sc_event_thread,
|
||||
if (kproc_create(usb_event_thread, sc, &sc->sc_event_thread,
|
||||
RFHIGHPID, 0, device_get_nameunit(sc->sc_dev))) {
|
||||
printf("%s: unable to create event thread for\n",
|
||||
device_get_nameunit(sc->sc_dev));
|
||||
@ -351,7 +351,7 @@ usb_create_event_thread(void *arg)
|
||||
taskq->taskcreated = 1;
|
||||
taskq->name = taskq_names[i];
|
||||
TAILQ_INIT(&taskq->tasks);
|
||||
if (kthread_create(usb_task_thread, taskq,
|
||||
if (kproc_create(usb_task_thread, taskq,
|
||||
&taskq->task_thread_proc, RFHIGHPID, 0,
|
||||
taskq->name)) {
|
||||
printf("unable to create task thread\n");
|
||||
@ -453,7 +453,7 @@ usb_event_thread(void *arg)
|
||||
wakeup(sc);
|
||||
|
||||
DPRINTF(("usb_event_thread: exit\n"));
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
void
|
||||
@ -490,7 +490,7 @@ usb_task_thread(void *arg)
|
||||
wakeup(&taskq->taskcreated);
|
||||
|
||||
DPRINTF(("usb_event_thread: exit\n"));
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -83,10 +83,10 @@ typedef struct thread *usb_proc_ptr;
|
||||
#define uio_procp uio_td
|
||||
|
||||
#define usb_kthread_create1(f, s, p, a0, a1) \
|
||||
kthread_create((f), (s), (p), RFHIGHPID, 0, (a0), (a1))
|
||||
kproc_create((f), (s), (p), RFHIGHPID, 0, (a0), (a1))
|
||||
#define usb_kthread_create2(f, s, p, a0) \
|
||||
kthread_create((f), (s), (p), RFHIGHPID, 0, (a0))
|
||||
#define usb_kthread_create kthread_create
|
||||
kproc_create((f), (s), (p), RFHIGHPID, 0, (a0))
|
||||
#define usb_kthread_create kproc_create
|
||||
|
||||
#define config_pending_incr()
|
||||
#define config_pending_decr()
|
||||
|
@ -623,7 +623,7 @@ utopia_daemon(void *arg __unused)
|
||||
}
|
||||
wakeup_one(&utopia_list);
|
||||
UTP_RUNLOCK_LIST();
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -639,7 +639,7 @@ utopia_mod_init(module_t mod, int what, void *arg)
|
||||
|
||||
case MOD_LOAD:
|
||||
mtx_init(&utopia_list_mtx, "utopia list mutex", NULL, MTX_DEF);
|
||||
err = kthread_create(utopia_daemon, NULL, &utopia_kproc,
|
||||
err = kproc_create(utopia_daemon, NULL, &utopia_kproc,
|
||||
RFHIGHPID, 0, "utopia");
|
||||
if (err != 0) {
|
||||
printf("cannot created utopia thread %d\n", err);
|
||||
|
@ -183,7 +183,7 @@ g_bde_create_geom(struct gctl_req *req, struct g_class *mp, struct g_provider *p
|
||||
TAILQ_INIT(&sc->worklist);
|
||||
mtx_init(&sc->worklist_mutex, "g_bde_worklist", NULL, MTX_DEF);
|
||||
/* XXX: error check */
|
||||
kthread_create(g_bde_worker, gp, &sc->thread, 0, 0,
|
||||
kproc_create(g_bde_worker, gp, &sc->thread, 0, 0,
|
||||
"g_bde %s", gp->name);
|
||||
pp = g_new_providerf(gp, gp->name);
|
||||
#if 0
|
||||
|
@ -664,7 +664,7 @@ g_bde_worker(void *arg)
|
||||
mtx_unlock(&sc->worklist_mutex);
|
||||
sc->dead = 2;
|
||||
wakeup(sc);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -352,7 +352,7 @@ g_eli_worker(void *arg)
|
||||
curthread->td_proc->p_comm);
|
||||
wakeup(&sc->sc_workers);
|
||||
mtx_unlock(&sc->sc_queue_mtx);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
msleep(sc, &sc->sc_queue_mtx, PRIBIO | PDROP,
|
||||
"geli:w", 0);
|
||||
@ -682,7 +682,7 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, struct g_provider *bpp,
|
||||
goto failed;
|
||||
}
|
||||
|
||||
error = kthread_create(g_eli_worker, wr, &wr->w_proc, 0, 0,
|
||||
error = kproc_create(g_eli_worker, wr, &wr->w_proc, 0, 0,
|
||||
"g_eli[%u] %s", i, bpp->name);
|
||||
if (error != 0) {
|
||||
crypto_freesession(wr->w_sid);
|
||||
|
@ -2146,7 +2146,7 @@ g_journal_worker(void *arg)
|
||||
sc->sc_worker = NULL;
|
||||
wakeup(&sc->sc_worker);
|
||||
mtx_unlock(&sc->sc_mtx);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
sleep:
|
||||
g_journal_wait(sc, last_write);
|
||||
@ -2381,7 +2381,7 @@ g_journal_create(struct g_class *mp, struct g_provider *pp,
|
||||
callout_drain(&sc->sc_callout);
|
||||
}
|
||||
|
||||
error = kthread_create(g_journal_worker, sc, &sc->sc_worker, 0, 0,
|
||||
error = kproc_create(g_journal_worker, sc, &sc->sc_worker, 0, 0,
|
||||
"g_journal %s", sc->sc_name);
|
||||
if (error != 0) {
|
||||
GJ_DEBUG(0, "Cannot create worker thread for %s.journal.",
|
||||
@ -2766,7 +2766,7 @@ g_journal_init(struct g_class *mp)
|
||||
g_journal_lowmem, mp, EVENTHANDLER_PRI_FIRST);
|
||||
if (g_journal_event_lowmem == NULL)
|
||||
GJ_DEBUG(0, "Warning! Cannot register lowmem event.");
|
||||
error = kthread_create(g_journal_switcher, mp, NULL, 0, 0,
|
||||
error = kproc_create(g_journal_switcher, mp, NULL, 0, 0,
|
||||
"g_journal switcher");
|
||||
KASSERT(error == 0, ("Cannot create switcher thread."));
|
||||
}
|
||||
@ -3025,7 +3025,7 @@ g_journal_switcher(void *arg)
|
||||
g_journal_switcher_state = GJ_SWITCHER_DIED;
|
||||
GJ_DEBUG(1, "Switcher exiting.");
|
||||
wakeup(&g_journal_switcher_state);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
if (error == 0 && g_journal_sync_requested == 0) {
|
||||
GJ_DEBUG(1, "Out of cache, force switch (used=%u "
|
||||
|
@ -1815,7 +1815,7 @@ g_mirror_worker(void *arg)
|
||||
if (g_mirror_try_destroy(sc)) {
|
||||
curthread->td_pflags &= ~TDP_GEOM;
|
||||
G_MIRROR_DEBUG(1, "Thread exiting.");
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
}
|
||||
G_MIRROR_DEBUG(5, "%s: I'm here 1.", __func__);
|
||||
@ -1839,7 +1839,7 @@ g_mirror_worker(void *arg)
|
||||
if (g_mirror_try_destroy(sc)) {
|
||||
curthread->td_pflags &= ~TDP_GEOM;
|
||||
G_MIRROR_DEBUG(1, "Thread exiting.");
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
mtx_lock(&sc->sc_queue_mtx);
|
||||
}
|
||||
@ -2890,7 +2890,7 @@ g_mirror_create(struct g_class *mp, const struct g_mirror_metadata *md)
|
||||
gp->orphan = g_mirror_orphan;
|
||||
sc->sc_sync.ds_geom = gp;
|
||||
sc->sc_sync.ds_ndisks = 0;
|
||||
error = kthread_create(g_mirror_worker, sc, &sc->sc_worker, 0, 0,
|
||||
error = kproc_create(g_mirror_worker, sc, &sc->sc_worker, 0, 0,
|
||||
"g_mirror %s", md->md_name);
|
||||
if (error != 0) {
|
||||
G_MIRROR_DEBUG(1, "Cannot create kernel thread for %s.",
|
||||
|
@ -239,7 +239,7 @@ g_multipath_kt(void *arg)
|
||||
}
|
||||
mtx_unlock(&gmtbq_mtx);
|
||||
wakeup(&g_multipath_kt_state);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
|
||||
@ -421,7 +421,7 @@ g_multipath_init(struct g_class *mp)
|
||||
{
|
||||
bioq_init(&gmtbq);
|
||||
mtx_init(&gmtbq_mtx, "gmtbq", NULL, MTX_DEF);
|
||||
if (kthread_create(g_multipath_kt, mp, NULL, 0, 0, "g_mp_kt") == 0) {
|
||||
if (kproc_create(g_multipath_kt, mp, NULL, 0, 0, "g_mp_kt") == 0) {
|
||||
g_multipath_kt_state = GKT_RUN;
|
||||
}
|
||||
}
|
||||
|
@ -2064,7 +2064,7 @@ g_raid3_worker(void *arg)
|
||||
if (g_raid3_try_destroy(sc)) {
|
||||
curthread->td_pflags &= ~TDP_GEOM;
|
||||
G_RAID3_DEBUG(1, "Thread exiting.");
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
}
|
||||
G_RAID3_DEBUG(5, "%s: I'm here 1.", __func__);
|
||||
@ -2088,7 +2088,7 @@ g_raid3_worker(void *arg)
|
||||
if (g_raid3_try_destroy(sc)) {
|
||||
curthread->td_pflags &= ~TDP_GEOM;
|
||||
G_RAID3_DEBUG(1, "Thread exiting.");
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
mtx_lock(&sc->sc_queue_mtx);
|
||||
}
|
||||
@ -3170,7 +3170,7 @@ g_raid3_create(struct g_class *mp, const struct g_raid3_metadata *md)
|
||||
sc->sc_zones[G_RAID3_ZONE_4K].sz_failed = 0;
|
||||
}
|
||||
|
||||
error = kthread_create(g_raid3_worker, sc, &sc->sc_worker, 0, 0,
|
||||
error = kproc_create(g_raid3_worker, sc, &sc->sc_worker, 0, 0,
|
||||
"g_raid3 %s", md->md_name);
|
||||
if (error != 0) {
|
||||
G_RAID3_DEBUG(1, "Cannot create kernel thread for %s.",
|
||||
|
@ -80,7 +80,7 @@ gv_config_new_drive(struct gv_drive *d)
|
||||
d->bqueue = g_malloc(sizeof(struct bio_queue_head), M_WAITOK | M_ZERO);
|
||||
bioq_init(d->bqueue);
|
||||
mtx_init(&d->bqueue_mtx, "gv_drive", NULL, MTX_DEF);
|
||||
kthread_create(gv_drive_worker, d, NULL, 0, 0, "gv_d %s", d->name);
|
||||
kproc_create(gv_drive_worker, d, NULL, 0, 0, "gv_d %s", d->name);
|
||||
d->flags |= GV_DRIVE_THREAD_ACTIVE;
|
||||
}
|
||||
|
||||
@ -373,7 +373,7 @@ gv_drive_worker(void *arg)
|
||||
mtx_unlock(&d->bqueue_mtx);
|
||||
d->flags |= GV_DRIVE_THREAD_DEAD;
|
||||
|
||||
kthread_exit(ENXIO);
|
||||
kproc_exit(ENXIO);
|
||||
}
|
||||
|
||||
|
||||
@ -509,7 +509,7 @@ gv_drive_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
|
||||
mtx_init(&d->bqueue_mtx, "gv_drive", NULL, MTX_DEF);
|
||||
|
||||
if (!(d->flags & GV_DRIVE_THREAD_ACTIVE)) {
|
||||
kthread_create(gv_drive_worker, d, NULL, 0, 0,
|
||||
kproc_create(gv_drive_worker, d, NULL, 0, 0,
|
||||
"gv_d %s", d->name);
|
||||
d->flags |= GV_DRIVE_THREAD_ACTIVE;
|
||||
}
|
||||
|
@ -348,7 +348,7 @@ gv_sync(struct gv_volume *v)
|
||||
sync->from = up;
|
||||
sync->to = p;
|
||||
sync->syncsize = GV_DFLT_SYNCSIZE;
|
||||
kthread_create(gv_sync_td, sync, NULL, 0, 0, "gv_sync '%s'",
|
||||
kproc_create(gv_sync_td, sync, NULL, 0, 0, "gv_sync '%s'",
|
||||
p->name);
|
||||
}
|
||||
|
||||
@ -371,7 +371,7 @@ gv_rebuild_plex(struct gv_plex *p)
|
||||
sync->to = p;
|
||||
sync->syncsize = GV_DFLT_SYNCSIZE;
|
||||
|
||||
kthread_create(gv_rebuild_td, sync, NULL, 0, 0, "gv_rebuild %s",
|
||||
kproc_create(gv_rebuild_td, sync, NULL, 0, 0, "gv_rebuild %s",
|
||||
p->name);
|
||||
|
||||
return (0);
|
||||
@ -389,7 +389,7 @@ gv_init_plex(struct gv_plex *p)
|
||||
return (EINPROGRESS);
|
||||
gv_set_sd_state(s, GV_SD_INITIALIZING, GV_SETSTATE_FORCE);
|
||||
s->init_size = GV_DFLT_SYNCSIZE;
|
||||
kthread_create(gv_init_td, s, NULL, 0, 0, "gv_init %s",
|
||||
kproc_create(gv_init_td, s, NULL, 0, 0, "gv_init %s",
|
||||
s->name);
|
||||
}
|
||||
|
||||
@ -422,7 +422,7 @@ gv_rebuild_td(void *arg)
|
||||
g_topology_unlock();
|
||||
printf("GEOM_VINUM: rebuild of %s failed to access consumer: "
|
||||
"%d\n", p->name, error);
|
||||
kthread_exit(error);
|
||||
kproc_exit(error);
|
||||
}
|
||||
g_topology_unlock();
|
||||
|
||||
@ -480,7 +480,7 @@ gv_rebuild_td(void *arg)
|
||||
printf("GEOM_VINUM: rebuild of %s finished\n", p->name);
|
||||
|
||||
g_free(sync);
|
||||
kthread_exit(error);
|
||||
kproc_exit(error);
|
||||
}
|
||||
|
||||
void
|
||||
@ -511,7 +511,7 @@ gv_sync_td(void *arg)
|
||||
printf("GEOM_VINUM: sync from '%s' failed to access "
|
||||
"consumer: %d\n", sync->from->name, error);
|
||||
g_free(sync);
|
||||
kthread_exit(error);
|
||||
kproc_exit(error);
|
||||
}
|
||||
error = g_access(to, 0, 1, 0);
|
||||
if (error) {
|
||||
@ -520,7 +520,7 @@ gv_sync_td(void *arg)
|
||||
printf("GEOM_VINUM: sync to '%s' failed to access "
|
||||
"consumer: %d\n", p->name, error);
|
||||
g_free(sync);
|
||||
kthread_exit(error);
|
||||
kproc_exit(error);
|
||||
}
|
||||
g_topology_unlock();
|
||||
|
||||
@ -593,7 +593,7 @@ gv_sync_td(void *arg)
|
||||
p->synced = 0;
|
||||
|
||||
g_free(sync);
|
||||
kthread_exit(error);
|
||||
kproc_exit(error);
|
||||
}
|
||||
|
||||
void
|
||||
@ -632,7 +632,7 @@ gv_init_td(void *arg)
|
||||
g_topology_unlock();
|
||||
printf("GEOM_VINUM: subdisk '%s' init: failed to access "
|
||||
"consumer; error: %d\n", s->name, error);
|
||||
kthread_exit(error);
|
||||
kproc_exit(error);
|
||||
}
|
||||
g_topology_unlock();
|
||||
|
||||
@ -667,5 +667,5 @@ gv_init_td(void *arg)
|
||||
printf("GEOM_VINUM: subdisk '%s' init: finished successfully\n",
|
||||
s->name);
|
||||
}
|
||||
kthread_exit(error);
|
||||
kproc_exit(error);
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ gv_plex_worker(void *arg)
|
||||
p->flags |= GV_PLEX_THREAD_DEAD;
|
||||
wakeup(p);
|
||||
|
||||
kthread_exit(ENXIO);
|
||||
kproc_exit(ENXIO);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -783,7 +783,7 @@ gv_plex_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
|
||||
if (mtx_initialized(&p->bqueue_mtx) == 0)
|
||||
mtx_init(&p->bqueue_mtx, "gv_plex", NULL, MTX_DEF);
|
||||
if (!(p->flags & GV_PLEX_THREAD_ACTIVE)) {
|
||||
kthread_create(gv_plex_worker, p, NULL, 0, 0, "gv_p %s",
|
||||
kproc_create(gv_plex_worker, p, NULL, 0, 0, "gv_p %s",
|
||||
p->name);
|
||||
p->flags |= GV_PLEX_THREAD_ACTIVE;
|
||||
}
|
||||
@ -807,7 +807,7 @@ gv_plex_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
|
||||
M_WAITOK | M_ZERO);
|
||||
bioq_init(p->wqueue);
|
||||
mtx_init(&p->bqueue_mtx, "gv_plex", NULL, MTX_DEF);
|
||||
kthread_create(gv_plex_worker, p, NULL, 0, 0, "gv_p %s",
|
||||
kproc_create(gv_plex_worker, p, NULL, 0, 0, "gv_p %s",
|
||||
p->name);
|
||||
p->flags |= GV_PLEX_THREAD_ACTIVE;
|
||||
|
||||
|
@ -149,7 +149,7 @@ gv_vol_worker(void *arg)
|
||||
v->flags |= GV_VOL_THREAD_DEAD;
|
||||
wakeup(v);
|
||||
|
||||
kthread_exit(ENXIO);
|
||||
kproc_exit(ENXIO);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -369,7 +369,7 @@ gv_volume_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
|
||||
mtx_init(&v->bqueue_mtx, "gv_plex", NULL, MTX_DEF);
|
||||
|
||||
if (!(v->flags & GV_VOL_THREAD_ACTIVE)) {
|
||||
kthread_create(gv_vol_worker, v, NULL, 0, 0, "gv_v %s",
|
||||
kproc_create(gv_vol_worker, v, NULL, 0, 0, "gv_v %s",
|
||||
v->name);
|
||||
v->flags |= GV_VOL_THREAD_ACTIVE;
|
||||
}
|
||||
|
@ -754,7 +754,7 @@ apm_event_thread(void *arg)
|
||||
mtx_unlock(&sc->mtx);
|
||||
}
|
||||
sc->running = 0;
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
/* enable APM BIOS */
|
||||
@ -770,7 +770,7 @@ apm_event_enable(void)
|
||||
|
||||
/* Start the thread */
|
||||
sc->active = 1;
|
||||
if (kthread_create(apm_event_thread, sc, &sc->event_thread, 0, 0,
|
||||
if (kproc_create(apm_event_thread, sc, &sc->event_thread, 0, 0,
|
||||
"apm worker"))
|
||||
panic("Cannot create apm worker thread");
|
||||
|
||||
|
@ -691,7 +691,7 @@ start_init(void *dummy)
|
||||
}
|
||||
|
||||
/*
|
||||
* Like kthread_create(), but runs in it's own address space.
|
||||
* Like kproc_create(), but runs in it's own address space.
|
||||
* We do this early to reserve pid 1.
|
||||
*
|
||||
* Note special case - do not make it runnable yet. Other work
|
||||
|
@ -283,7 +283,7 @@ acct(struct thread *td, struct acct_args *uap)
|
||||
* than one, but if so the extras will commit suicide as
|
||||
* soon as they start up.
|
||||
*/
|
||||
error = kthread_create(acct_thread, NULL, NULL, 0, 0,
|
||||
error = kproc_create(acct_thread, NULL, NULL, 0, 0,
|
||||
"accounting");
|
||||
if (error) {
|
||||
vfslocked = VFS_LOCK_GIANT(acct_vp->v_mount);
|
||||
@ -625,7 +625,7 @@ acct_thread(void *dummy)
|
||||
sx_xlock(&acct_sx);
|
||||
if (acct_state & ACCT_RUNNING) {
|
||||
sx_xunlock(&acct_sx);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
acct_state |= ACCT_RUNNING;
|
||||
|
||||
@ -652,5 +652,5 @@ acct_thread(void *dummy)
|
||||
*/
|
||||
acct_state = 0;
|
||||
sx_xunlock(&acct_sx);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
@ -802,7 +802,7 @@ fork_exit(callout, arg, frame)
|
||||
if (p->p_flag & P_KTHREAD) {
|
||||
printf("Kernel thread \"%s\" (pid %d) exited prematurely.\n",
|
||||
p->p_comm, p->p_pid);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
mtx_assert(&Giant, MA_NOTOWNED);
|
||||
|
||||
|
@ -60,16 +60,16 @@ idle_setup(void *dummy)
|
||||
|
||||
#ifdef SMP
|
||||
SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
|
||||
error = kthread_create(sched_idletd, NULL, &p,
|
||||
error = kproc_create(sched_idletd, NULL, &p,
|
||||
RFSTOPPED | RFHIGHPID, 0, "idle: cpu%d", pc->pc_cpuid);
|
||||
pc->pc_idlethread = FIRST_THREAD_IN_PROC(p);
|
||||
#else
|
||||
error = kthread_create(sched_idletd, NULL, &p,
|
||||
error = kproc_create(sched_idletd, NULL, &p,
|
||||
RFSTOPPED | RFHIGHPID, 0, "idle");
|
||||
PCPU_SET(idlethread, FIRST_THREAD_IN_PROC(p));
|
||||
#endif
|
||||
if (error)
|
||||
panic("idle_setup: kthread_create error %d\n", error);
|
||||
panic("idle_setup: kproc_create error %d\n", error);
|
||||
|
||||
PROC_LOCK(p);
|
||||
p->p_flag |= P_NOLOAD;
|
||||
|
@ -337,10 +337,10 @@ ithread_create(const char *name)
|
||||
|
||||
ithd = malloc(sizeof(struct intr_thread), M_ITHREAD, M_WAITOK | M_ZERO);
|
||||
|
||||
error = kthread_create(ithread_loop, ithd, &p, RFSTOPPED | RFHIGHPID,
|
||||
error = kproc_create(ithread_loop, ithd, &p, RFSTOPPED | RFHIGHPID,
|
||||
0, "%s", name);
|
||||
if (error)
|
||||
panic("kthread_create() failed with %d", error);
|
||||
panic("kproc_create() failed with %d", error);
|
||||
td = FIRST_THREAD_IN_PROC(p); /* XXXKSE */
|
||||
thread_lock(td);
|
||||
sched_class(td, PRI_ITHD);
|
||||
@ -362,10 +362,10 @@ ithread_create(const char *name, struct intr_handler *ih)
|
||||
|
||||
ithd = malloc(sizeof(struct intr_thread), M_ITHREAD, M_WAITOK | M_ZERO);
|
||||
|
||||
error = kthread_create(ithread_loop, ih, &p, RFSTOPPED | RFHIGHPID,
|
||||
error = kproc_create(ithread_loop, ih, &p, RFSTOPPED | RFHIGHPID,
|
||||
0, "%s", name);
|
||||
if (error)
|
||||
panic("kthread_create() failed with %d", error);
|
||||
panic("kproc_create() failed with %d", error);
|
||||
td = FIRST_THREAD_IN_PROC(p); /* XXXKSE */
|
||||
thread_lock(td);
|
||||
sched_class(td, PRI_ITHD);
|
||||
@ -1102,7 +1102,7 @@ ithread_loop(void *arg)
|
||||
CTR3(KTR_INTR, "%s: pid %d (%s) exiting", __func__,
|
||||
p->p_pid, p->p_comm);
|
||||
free(ithd, M_ITHREAD);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1173,7 +1173,7 @@ ithread_loop(void *arg)
|
||||
CTR3(KTR_INTR, "%s: pid %d (%s) exiting", __func__,
|
||||
p->p_pid, p->p_comm);
|
||||
free(ithd, M_ITHREAD);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -56,7 +56,7 @@ kproc_start(udata)
|
||||
const struct kproc_desc *kp = udata;
|
||||
int error;
|
||||
|
||||
error = kthread_create((void (*)(void *))kp->func, NULL,
|
||||
error = kproc_create((void (*)(void *))kp->func, NULL,
|
||||
kp->global_procpp, 0, 0, "%s", kp->arg0);
|
||||
if (error)
|
||||
panic("kproc_start: %s: error %d", kp->arg0, error);
|
||||
@ -73,7 +73,7 @@ kproc_start(udata)
|
||||
* fmt and following will be *printf'd into (*newpp)->p_comm (for ps, etc.).
|
||||
*/
|
||||
int
|
||||
kthread_create(void (*func)(void *), void *arg,
|
||||
kproc_create(void (*func)(void *), void *arg,
|
||||
struct proc **newpp, int flags, int pages, const char *fmt, ...)
|
||||
{
|
||||
int error;
|
||||
@ -82,7 +82,7 @@ kthread_create(void (*func)(void *), void *arg,
|
||||
struct proc *p2;
|
||||
|
||||
if (!proc0.p_stats)
|
||||
panic("kthread_create called too soon");
|
||||
panic("kproc_create called too soon");
|
||||
|
||||
error = fork1(&thread0, RFMEM | RFFDG | RFPROC | RFSTOPPED | flags,
|
||||
pages, &p2);
|
||||
@ -122,7 +122,7 @@ kthread_create(void (*func)(void *), void *arg,
|
||||
}
|
||||
|
||||
void
|
||||
kthread_exit(int ecode)
|
||||
kproc_exit(int ecode)
|
||||
{
|
||||
struct thread *td;
|
||||
struct proc *p;
|
||||
@ -154,7 +154,7 @@ kthread_exit(int ecode)
|
||||
* Participation is voluntary.
|
||||
*/
|
||||
int
|
||||
kthread_suspend(struct proc *p, int timo)
|
||||
kproc_suspend(struct proc *p, int timo)
|
||||
{
|
||||
/*
|
||||
* Make sure this is indeed a system process and we can safely
|
||||
@ -171,7 +171,7 @@ kthread_suspend(struct proc *p, int timo)
|
||||
}
|
||||
|
||||
int
|
||||
kthread_resume(struct proc *p)
|
||||
kproc_resume(struct proc *p)
|
||||
{
|
||||
/*
|
||||
* Make sure this is indeed a system process and we can safely
|
||||
@ -189,7 +189,7 @@ kthread_resume(struct proc *p)
|
||||
}
|
||||
|
||||
void
|
||||
kthread_suspend_check(struct proc *p)
|
||||
kproc_suspend_check(struct proc *p)
|
||||
{
|
||||
PROC_LOCK(p);
|
||||
while (SIGISMEMBER(p->p_siglist, SIGSTOP)) {
|
||||
|
@ -608,7 +608,7 @@ kproc_shutdown(void *arg, int howto)
|
||||
strlcpy(procname, p->p_comm, sizeof(procname));
|
||||
printf("Waiting (max %d seconds) for system process `%s' to stop...",
|
||||
kproc_shutdown_wait, procname);
|
||||
error = kthread_suspend(p, kproc_shutdown_wait * hz);
|
||||
error = kproc_suspend(p, kproc_shutdown_wait * hz);
|
||||
|
||||
if (error == EWOULDBLOCK)
|
||||
printf("timed out\n");
|
||||
|
@ -336,14 +336,14 @@ taskqueue_start_threads(struct taskqueue **tqp, int count, int pri,
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
if (count == 1)
|
||||
error = kthread_create(taskqueue_thread_loop, tqp,
|
||||
error = kproc_create(taskqueue_thread_loop, tqp,
|
||||
&tq->tq_pproc[i], RFSTOPPED, 0, ktname);
|
||||
else
|
||||
error = kthread_create(taskqueue_thread_loop, tqp,
|
||||
error = kproc_create(taskqueue_thread_loop, tqp,
|
||||
&tq->tq_pproc[i], RFSTOPPED, 0, "%s_%d", ktname, i);
|
||||
if (error) {
|
||||
/* should be ok to continue, taskqueue_free will dtrt */
|
||||
printf("%s: kthread_create(%s): error %d",
|
||||
printf("%s: kproc_create(%s): error %d",
|
||||
__func__, ktname, error);
|
||||
tq->tq_pproc[i] = NULL; /* paranoid */
|
||||
} else
|
||||
@ -379,7 +379,7 @@ taskqueue_thread_loop(void *arg)
|
||||
tq->tq_pcount--;
|
||||
wakeup_one(tq->tq_pproc);
|
||||
TQ_UNLOCK(tq);
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1122,7 +1122,7 @@ aio_daemon(void *_id)
|
||||
mycp->p_vmspace->vm_refcnt);
|
||||
}
|
||||
#endif
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1143,7 +1143,7 @@ aio_newproc(int *start)
|
||||
int id;
|
||||
|
||||
id = alloc_unr(aiod_unr);
|
||||
error = kthread_create(aio_daemon, (void *)(intptr_t)id, &p,
|
||||
error = kproc_create(aio_daemon, (void *)(intptr_t)id, &p,
|
||||
RFNOWAIT, 0, "aiod%d", id);
|
||||
if (error == 0) {
|
||||
/*
|
||||
|
@ -2058,7 +2058,7 @@ buf_daemon()
|
||||
bd_request = 0;
|
||||
mtx_unlock(&bdlock);
|
||||
|
||||
kthread_suspend_check(bufdaemonproc);
|
||||
kproc_suspend_check(bufdaemonproc);
|
||||
|
||||
/*
|
||||
* Do the flush. Limit the amount of in-transit I/O we
|
||||
|
@ -726,7 +726,7 @@ vnlru_proc(void)
|
||||
SHUTDOWN_PRI_FIRST);
|
||||
|
||||
for (;;) {
|
||||
kthread_suspend_check(p);
|
||||
kproc_suspend_check(p);
|
||||
mtx_lock(&vnode_free_list_mtx);
|
||||
if (freevnodes > wantfreevnodes)
|
||||
vnlru_free(freevnodes - wantfreevnodes);
|
||||
@ -1688,7 +1688,7 @@ sched_sync(void)
|
||||
if (syncer_state == SYNCER_FINAL_DELAY &&
|
||||
syncer_final_iter == 0) {
|
||||
mtx_unlock(&sync_mtx);
|
||||
kthread_suspend_check(td->td_proc);
|
||||
kproc_suspend_check(td->td_proc);
|
||||
mtx_lock(&sync_mtx);
|
||||
}
|
||||
net_worklist_len = syncer_worklist_len - sync_vnode_count;
|
||||
|
@ -106,7 +106,7 @@ sctp_startup_iterator(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = kthread_create(sctp_iterator_thread,
|
||||
ret = kproc_create(sctp_iterator_thread,
|
||||
(void *)NULL,
|
||||
&sctppcbinfo.thread_proc,
|
||||
RFPROC,
|
||||
|
@ -668,7 +668,7 @@ smb_iod_thread(void *arg)
|
||||
tsleep(&iod->iod_flags, PWAIT, "90idle", iod->iod_sleeptimo);
|
||||
}
|
||||
/* mtx_lock(&Giant, MTX_DEF);*/
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
int
|
||||
@ -689,7 +689,7 @@ smb_iod_create(struct smb_vc *vcp)
|
||||
TAILQ_INIT(&iod->iod_rqlist);
|
||||
smb_sl_init(&iod->iod_evlock, "90evl");
|
||||
STAILQ_INIT(&iod->iod_evlist);
|
||||
error = kthread_create(smb_iod_thread, iod, &iod->iod_p,
|
||||
error = kproc_create(smb_iod_thread, iod, &iod->iod_p,
|
||||
RFNOWAIT, 0, "smbiod%d", iod->iod_id);
|
||||
if (error) {
|
||||
SMBERROR("can't start smbiod: %d", error);
|
||||
|
@ -526,7 +526,7 @@ nfs4_daemon(void *arg)
|
||||
nfs4_daemonproc = NULL;
|
||||
mtx_unlock(&Giant);
|
||||
/*printf("nfsv4 renewd exiting\n");*/
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
tsleep(&nfs4_daemonproc, PVFS, "nfs4", 2 * hz);
|
||||
}
|
||||
@ -644,7 +644,7 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam,
|
||||
|
||||
/* Start renewd if it isn't already running */
|
||||
if (nfs4_daemonproc == NULL)
|
||||
kthread_create(nfs4_daemon, crdup(cred), &nfs4_daemonproc,
|
||||
kproc_create(nfs4_daemon, crdup(cred), &nfs4_daemonproc,
|
||||
(RFPROC|RFMEM), 0, "nfs4rd");
|
||||
|
||||
return (0);
|
||||
|
@ -177,7 +177,7 @@ nfs_nfsiodnew(void)
|
||||
if (newiod == -1)
|
||||
return (-1);
|
||||
mtx_unlock(&nfs_iod_mtx);
|
||||
error = kthread_create(nfssvc_iod, nfs_asyncdaemon + i, NULL, RFHIGHPID,
|
||||
error = kproc_create(nfssvc_iod, nfs_asyncdaemon + i, NULL, RFHIGHPID,
|
||||
0, "nfsiod %d", newiod);
|
||||
mtx_lock(&nfs_iod_mtx);
|
||||
if (error)
|
||||
@ -309,7 +309,7 @@ nfssvc_iod(void *instance)
|
||||
wakeup(&nfs_numasync);
|
||||
mtx_unlock(&nfs_iod_mtx);
|
||||
if ((error == 0) || (error == EWOULDBLOCK))
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
/* Abnormal termination */
|
||||
kthread_exit(1);
|
||||
kproc_exit(1);
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ crypto_init(void)
|
||||
goto bad;
|
||||
}
|
||||
|
||||
error = kthread_create((void (*)(void *)) crypto_proc, NULL,
|
||||
error = kproc_create((void (*)(void *)) crypto_proc, NULL,
|
||||
&cryptoproc, 0, 0, "crypto");
|
||||
if (error) {
|
||||
printf("crypto_init: cannot start crypto thread; error %d",
|
||||
@ -224,7 +224,7 @@ crypto_init(void)
|
||||
goto bad;
|
||||
}
|
||||
|
||||
error = kthread_create((void (*)(void *)) crypto_ret_proc, NULL,
|
||||
error = kproc_create((void (*)(void *)) crypto_ret_proc, NULL,
|
||||
&cryptoretproc, 0, 0, "crypto returns");
|
||||
if (error) {
|
||||
printf("crypto_init: cannot start cryptoret thread; error %d",
|
||||
@ -1222,7 +1222,7 @@ crypto_finis(void *chan)
|
||||
CRYPTO_DRIVER_LOCK();
|
||||
wakeup_one(chan);
|
||||
CRYPTO_DRIVER_UNLOCK();
|
||||
kthread_exit(0);
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -544,8 +544,8 @@ audit_worker_init(void)
|
||||
int error;
|
||||
|
||||
cv_init(&audit_replacement_cv, "audit_replacement_cv");
|
||||
error = kthread_create(audit_worker, NULL, &audit_thread, RFHIGHPID,
|
||||
error = kproc_create(audit_worker, NULL, &audit_thread, RFHIGHPID,
|
||||
0, "audit");
|
||||
if (error)
|
||||
panic("audit_worker_init: kthread_create returned %d", error);
|
||||
panic("audit_worker_init: kproc_create returned %d", error);
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ g_hvd_init(struct g_class *mp __unused)
|
||||
sc->hvd_sectorsize = HVD_BLOCKSIZE;
|
||||
sc->hvd_fwsectors = 0;
|
||||
sc->hvd_fwheads = 0;
|
||||
error = kthread_create(hvd_kthread, sc, &sc->hvd_procp, 0, 0,
|
||||
error = kproc_create(hvd_kthread, sc, &sc->hvd_procp, 0, 0,
|
||||
"hvd0");
|
||||
if (error != 0) {
|
||||
free(sc, M_DEVBUF);
|
||||
|
@ -44,11 +44,11 @@ struct kproc_desc {
|
||||
|
||||
void kproc_shutdown(void *, int);
|
||||
void kproc_start(const void *);
|
||||
int kthread_create(void (*)(void *), void *, struct proc **,
|
||||
int kproc_create(void (*)(void *), void *, struct proc **,
|
||||
int flags, int pages, const char *, ...) __printflike(6, 7);
|
||||
void kthread_exit(int) __dead2;
|
||||
int kthread_resume(struct proc *); /* XXXKSE */
|
||||
int kthread_suspend(struct proc *, int); /* XXXKSE */
|
||||
void kthread_suspend_check(struct proc *); /* XXXKSE */
|
||||
void kproc_exit(int) __dead2;
|
||||
int kproc_resume(struct proc *); /* XXXKSE */
|
||||
int kproc_suspend(struct proc *, int); /* XXXKSE */
|
||||
void kproc_suspend_check(struct proc *); /* XXXKSE */
|
||||
|
||||
#endif /* !_SYS_KTHREAD_H_ */
|
||||
|
@ -728,7 +728,7 @@ softdep_flush(void)
|
||||
td->td_pflags |= TDP_NORUNNINGBUF;
|
||||
|
||||
for (;;) {
|
||||
kthread_suspend_check(softdepproc);
|
||||
kproc_suspend_check(softdepproc);
|
||||
vfslocked = VFS_LOCK_GIANT((struct mount *)NULL);
|
||||
ACQUIRE_LOCK(&lk);
|
||||
/*
|
||||
|
@ -147,7 +147,7 @@ pagezero_start(void __unused *arg)
|
||||
int error;
|
||||
struct thread *td;
|
||||
|
||||
error = kthread_create(vm_pagezero, NULL, &pagezero_proc, RFSTOPPED, 0,
|
||||
error = kproc_create(vm_pagezero, NULL, &pagezero_proc, RFSTOPPED, 0,
|
||||
"pagezero");
|
||||
if (error)
|
||||
panic("pagezero_start: error %d\n", error);
|
||||
|
Loading…
Reference in New Issue
Block a user