Changeset View
Changeset View
Standalone View
Standalone View
sys/net/vnet.c
Show First 20 Lines • Show All 571 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
struct vnet_sysinit *vs; | struct vnet_sysinit *vs; | ||||
VNET_SYSINIT_RLOCK(); | VNET_SYSINIT_RLOCK(); | ||||
TAILQ_FOREACH(vs, &vnet_constructors, link) { | TAILQ_FOREACH(vs, &vnet_constructors, link) { | ||||
curvnet->vnet_state = vs->subsystem; | curvnet->vnet_state = vs->subsystem; | ||||
vs->func(vs->arg); | vs->func(vs->arg); | ||||
} | } | ||||
curvnet->vnet_state = SI_SUB_LAST; | |||||
VNET_SYSINIT_RUNLOCK(); | VNET_SYSINIT_RUNLOCK(); | ||||
} | } | ||||
/* | /* | ||||
* Invoke all registered vnet destructors on the current vnet. Used during | * Invoke all registered vnet destructors on the current vnet. Used during | ||||
* vnet destruction. The caller is responsible for ensuring the dying vnet | * vnet destruction. The caller is responsible for ensuring the dying vnet | ||||
* the current vnet and that the vnet_sysinit_sxlock lock is locked. | * the current vnet and that the vnet_sysinit_sxlock lock is locked. | ||||
*/ | */ | ||||
void | void | ||||
vnet_sysuninit(void) | vnet_sysuninit(void) | ||||
{ | { | ||||
struct vnet_sysinit *vs; | struct vnet_sysinit *vs; | ||||
VNET_SYSINIT_RLOCK(); | VNET_SYSINIT_RLOCK(); | ||||
TAILQ_FOREACH_REVERSE(vs, &vnet_destructors, vnet_sysuninit_head, | TAILQ_FOREACH_REVERSE(vs, &vnet_destructors, vnet_sysuninit_head, | ||||
link) { | link) { | ||||
curvnet->vnet_state = vs->subsystem; | curvnet->vnet_state = vs->subsystem; | ||||
vs->func(vs->arg); | vs->func(vs->arg); | ||||
} | } | ||||
curvnet->vnet_state = 0; | |||||
VNET_SYSINIT_RUNLOCK(); | VNET_SYSINIT_RUNLOCK(); | ||||
bz: Why do you need these two?
The above should always end up on SI_SUB_VNET_DONE (see… | |||||
hselaskyAuthorUnsubmitted Done Inline ActionsAfter your explanation I see these chunks are not needed. I'll remove. hselasky: After your explanation I see these chunks are not needed. I'll remove. | |||||
} | } | ||||
/* | /* | ||||
* EVENTHANDLER(9) extensions. | * EVENTHANDLER(9) extensions. | ||||
*/ | */ | ||||
/* | /* | ||||
* Invoke the eventhandler function originally registered with the possibly | * Invoke the eventhandler function originally registered with the possibly | ||||
* registered argument for all virtual network stack instances. | * registered argument for all virtual network stack instances. | ||||
▲ Show 20 Lines • Show All 198 Lines • Show Last 20 Lines |
Why do you need these two?
The above should always end up on SI_SUB_VNET_DONE (see vnet_sysinit_done()) and when you get to the end of the sysuninit loop, the only thing left should be the state tied to the jail.