Changeset View
Changeset View
Standalone View
Standalone View
head/sys/net/route/route_ctl.c
Show First 20 Lines • Show All 841 Lines • ▼ Show 20 Lines | |||||
destroy_subscription_epoch(epoch_context_t ctx) | destroy_subscription_epoch(epoch_context_t ctx) | ||||
{ | { | ||||
struct rib_subscription *rs; | struct rib_subscription *rs; | ||||
rs = __containerof(ctx, struct rib_subscription, epoch_ctx); | rs = __containerof(ctx, struct rib_subscription, epoch_ctx); | ||||
free(rs, M_RTABLE); | free(rs, M_RTABLE); | ||||
} | } | ||||
void | |||||
rib_init_subscriptions(struct rib_head *rnh) | |||||
{ | |||||
CK_STAILQ_INIT(&rnh->rnh_subscribers); | |||||
} | |||||
void | |||||
rib_destroy_subscriptions(struct rib_head *rnh) | |||||
{ | |||||
struct rib_subscription *rs; | |||||
struct epoch_tracker et; | |||||
NET_EPOCH_ENTER(et); | |||||
RIB_WLOCK(rnh); | |||||
while ((rs = CK_STAILQ_FIRST(&rnh->rnh_subscribers)) != NULL) { | |||||
CK_STAILQ_REMOVE_HEAD(&rnh->rnh_subscribers, next); | |||||
epoch_call(net_epoch_preempt, destroy_subscription_epoch, | |||||
&rs->epoch_ctx); | |||||
} | |||||
RIB_WUNLOCK(rnh); | |||||
NET_EPOCH_EXIT(et); | |||||
} | |||||