static void mlx4_ib_mcg_timeout_handler(struct work_struct *work) { struct delayed_work *delay = to_delayed_work(work); struct mcast_group *group; struct mcast_req *req = NULL; group = container_of(delay, typeof(*group), timeout_work); mutex_lock(&group->lock); if (group->state == MCAST_JOIN_SENT) { if (!list_empty(&group->pending_list)) { req = list_first_entry(&group->pending_list, struct mcast_req, group_list); list_del(&req->group_list); list_del(&req->func_list); --group->func[req->func].num_pend_reqs; mutex_unlock(&group->lock); kfree(req); if (memcmp(&group->rec.mgid, &mgid0, sizeof mgid0)) { if (release_group(group, 1)) return; } else { kfree(group); return; } mutex_lock(&group->lock); } else
void pim_router::shutdown() { if (should_log(DEBUG)) log().writeline("Shutdown"); g_mrd->register_source_sink(this, false); #ifndef PIM_NO_BSR bsr().leaving(); #endif mrd::group_list::const_iterator j; for (j = g_mrd->group_table().begin(); j != g_mrd->group_table().end(); ++j) { group_node *node = j->second->node_owned_by(this); if (node) { release_group((pim_group_node *)node); } } const mrd::interface_list &intflist = g_mrd->intflist(); for (mrd::interface_list::const_iterator i = intflist.begin(); i != intflist.end(); ++i) { pim_interface *intf = (pim_interface *)i->second->node_owned_by(this); if (intf) { intf->shutdown(); delete intf; } } #ifndef PIM_NO_BSR bsr().shutdown(); #endif pim_sock.unregister(); router::shutdown(); }
void pim_router::released_group(group *grp) { release_group((pim_group_node *)grp->node_owned_by(this)); }