static void ipt_destroy_target(struct xt_entry_target *t) { struct xt_tgdtor_param par = { .target = t->u.kernel.target, .targinfo = t->data, }; if (par.target->destroy != NULL) par.target->destroy(&par); module_put(par.target->me); } static int tcf_ipt_release(struct tcf_ipt *ipt, int bind) { int ret = 0; if (ipt) { if (bind) ipt->tcf_bindcnt--; ipt->tcf_refcnt--; if (ipt->tcf_bindcnt <= 0 && ipt->tcf_refcnt <= 0) { ipt_destroy_target(ipt->tcfi_t); kfree(ipt->tcfi_tname); kfree(ipt->tcfi_t); tcf_hash_destroy(&ipt->common, &ipt_hash_info); ret = ACT_P_DELETED; } } return ret; }
static inline int tcf_mirred_release(struct tcf_mirred *m, int bind) { if (m) { if (bind) m->tcf_bindcnt--; m->tcf_refcnt--; if(!m->tcf_bindcnt && m->tcf_refcnt <= 0) { dev_put(m->tcfm_dev); tcf_hash_destroy(&m->common, &mirred_hash_info); return 1; } } return 0; }
static int tcf_simp_release(struct tcf_defact *d, int bind) { int ret = 0; if (d) { if (bind) d->tcf_bindcnt--; d->tcf_refcnt--; if (d->tcf_bindcnt <= 0 && d->tcf_refcnt <= 0) { kfree(d->tcfd_defdata); tcf_hash_destroy(&d->common, &simp_hash_info); ret = 1; } } return ret; }
static inline int tcf_mirred_release(struct tcf_mirred *p, int bind) { if (p) { if (bind) p->bindcnt--; p->refcnt--; if(!p->bindcnt && p->refcnt <= 0) { dev_put(p->dev); tcf_hash_destroy(p); return 1; } } return 0; }
int tcf_hash_release(struct tcf_common *p, int bind, struct tcf_hashinfo *hinfo) { int ret = 0; if (p) { if (bind) p->tcfc_bindcnt--; p->tcfc_refcnt--; if (p->tcfc_bindcnt <= 0 && p->tcfc_refcnt <= 0) { tcf_hash_destroy(p, hinfo); ret = 1; } } return ret; }
static int tcf_ipt_release(struct tcf_ipt *ipt, int bind) { int ret = 0; if (ipt) { if (bind) ipt->tcf_bindcnt--; ipt->tcf_refcnt--; if (ipt->tcf_bindcnt <= 0 && ipt->tcf_refcnt <= 0) { ipt_destroy_target(ipt->tcfi_t); kfree(ipt->tcfi_tname); kfree(ipt->tcfi_t); tcf_hash_destroy(&ipt->common, &ipt_hash_info); ret = ACT_P_DELETED; } } return ret; }
static int tcf_ipt_release(struct tcf_ipt *p, int bind) { int ret = 0; if (p) { if (bind) p->bindcnt--; p->refcnt--; if (p->bindcnt <= 0 && p->refcnt <= 0) { ipt_destroy_target(p->t); kfree(p->tname); kfree(p->t); tcf_hash_destroy(p); ret = ACT_P_DELETED; } } return ret; }
int tcf_hash_release(struct tc_action *a, int bind) { struct tcf_common *p = a->priv; int ret = 0; if (p) { if (bind) p->tcfc_bindcnt--; else if (p->tcfc_bindcnt > 0) return -EPERM; p->tcfc_refcnt--; if (p->tcfc_bindcnt <= 0 && p->tcfc_refcnt <= 0) { if (a->ops->cleanup) a->ops->cleanup(a, bind); tcf_hash_destroy(a); ret = 1; } } return ret; }
int __tcf_hash_release(struct tc_action *p, bool bind, bool strict) { int ret = 0; if (p) { if (bind) p->tcfa_bindcnt--; else if (strict && p->tcfa_bindcnt > 0) return -EPERM; p->tcfa_refcnt--; if (p->tcfa_bindcnt <= 0 && p->tcfa_refcnt <= 0) { if (p->ops->cleanup) p->ops->cleanup(p, bind); tcf_hash_destroy(p->hinfo, p); ret = ACT_P_DELETED; } } return ret; }
int __tcf_hash_release(struct tc_action *a, bool bind, bool strict) { struct tcf_common *p = a->priv; int ret = 0; if (p) { if (bind) p->tcfc_bindcnt--; else if (strict && p->tcfc_bindcnt > 0) return -EPERM; p->tcfc_refcnt--; if (p->tcfc_bindcnt <= 0 && p->tcfc_refcnt <= 0) { if (a->ops->cleanup) a->ops->cleanup(a, bind); tcf_hash_destroy(a->hinfo, a); ret = ACT_P_DELETED; } } return ret; }