/* * Caller must hold hashbucket lock for this tb with local BH disabled */ void inet_bind_bucket_destroy(struct kmem_cache *cachep, struct inet_bind_bucket *tb) { if (hlist_empty(&tb->owners)) { __hlist_del(&tb->node); release_net(tb->ib_net); kmem_cache_free(cachep, tb); } }
static void fl_free(struct ip6_flowlabel *fl) { if (fl) { release_net(fl->fl_net); kfree(fl->opt); } kfree(fl); }
static void fl_free(struct ip6_flowlabel *fl) { if (fl) { if (fl->share == IPV6_FL_S_PROCESS) put_pid(fl->owner.pid); release_net(fl->fl_net); kfree(fl->opt); kfree_rcu(fl, rcu); } }
static void destroy_dp_rcu(struct rcu_head *rcu) { struct datapath *dp = container_of(rcu, struct datapath, rcu); ovs_flow_tbl_destroy((__force struct flow_table *)dp->table); free_percpu(dp->stats_percpu); release_net(ovs_dp_get_net(dp)); kfree(dp->ports); kfree(dp); }
/* Release a nexthop info record */ static void free_fib_info_rcu(struct rcu_head *head) { struct fib_info *fi = container_of(head, struct fib_info, rcu); change_nexthops(fi) { if (nexthop_nh->nh_dev) dev_put(nexthop_nh->nh_dev); } endfor_nexthops(fi); release_net(fi->fib_net); kfree(fi); }
void free_fib_info(struct fib_info *fi) { if (fi->fib_dead == 0) { printk(KERN_WARNING "Freeing alive fib_info %p\n", fi); return; } change_nexthops(fi) { if (nh->nh_dev) dev_put(nh->nh_dev); nh->nh_dev = NULL; } endfor_nexthops(fi); fib_info_cnt--; release_net(fi->fib_net); kfree(fi); }
void free_fib_info(struct fib_info *fi) { if (fi->fib_dead == 0) { pr_warning("Freeing alive fib_info %p\n", fi); return; } change_nexthops(fi) { if (nexthop_nh->nh_dev) dev_put(nexthop_nh->nh_dev); nexthop_nh->nh_dev = NULL; } endfor_nexthops(fi); fib_info_cnt--; release_net(fi->fib_net); call_rcu(&fi->rcu, free_fib_info_rcu); }
/* Release a nexthop info record */ static void free_fib_info_rcu(struct rcu_head *head) { struct fib_info *fi = container_of(head, struct fib_info, rcu); change_nexthops(fi) { if (nexthop_nh->nh_dev) dev_put(nexthop_nh->nh_dev); if (nexthop_nh->nh_exceptions) free_nh_exceptions(nexthop_nh); if (nexthop_nh->nh_rth_output) dst_release(&nexthop_nh->nh_rth_output->dst); if (nexthop_nh->nh_rth_input) dst_release(&nexthop_nh->nh_rth_input->dst); } endfor_nexthops(fi); release_net(fi->fib_net); if (fi->fib_metrics != (u32 *) dst_default_metrics) kfree(fi->fib_metrics); kfree(fi); }
static inline void ipmr_cache_free(struct mfc_cache *c) { release_net(mfc_net(c)); kmem_cache_free(mrt_cachep, c); }