Lines Matching refs:hinfo
42 struct tcf_hashinfo *hinfo = a->ops->hinfo; in tcf_hash_destroy() local
44 spin_lock_bh(&hinfo->lock); in tcf_hash_destroy()
46 spin_unlock_bh(&hinfo->lock); in tcf_hash_destroy()
83 struct tcf_hashinfo *hinfo = a->ops->hinfo; in tcf_dump_walker() local
89 spin_lock_bh(&hinfo->lock); in tcf_dump_walker()
93 for (i = 0; i < (hinfo->hmask + 1); i++) { in tcf_dump_walker()
94 head = &hinfo->htab[tcf_hash(i, hinfo->hmask)]; in tcf_dump_walker()
119 spin_unlock_bh(&hinfo->lock); in tcf_dump_walker()
131 struct tcf_hashinfo *hinfo = a->ops->hinfo; in tcf_del_walker() local
144 for (i = 0; i < (hinfo->hmask + 1); i++) { in tcf_del_walker()
145 head = &hinfo->htab[tcf_hash(i, hinfo->hmask)]; in tcf_del_walker()
179 static struct tcf_common *tcf_hash_lookup(u32 index, struct tcf_hashinfo *hinfo) in tcf_hash_lookup() argument
184 spin_lock_bh(&hinfo->lock); in tcf_hash_lookup()
185 head = &hinfo->htab[tcf_hash(index, hinfo->hmask)]; in tcf_hash_lookup()
189 spin_unlock_bh(&hinfo->lock); in tcf_hash_lookup()
194 u32 tcf_hash_new_index(struct tcf_hashinfo *hinfo) in tcf_hash_new_index() argument
196 u32 val = hinfo->index; in tcf_hash_new_index()
201 } while (tcf_hash_lookup(val, hinfo)); in tcf_hash_new_index()
203 hinfo->index = val; in tcf_hash_new_index()
210 struct tcf_hashinfo *hinfo = a->ops->hinfo; in tcf_hash_search() local
211 struct tcf_common *p = tcf_hash_lookup(index, hinfo); in tcf_hash_search()
223 struct tcf_hashinfo *hinfo = a->ops->hinfo; in tcf_hash_check() local
225 if (index && (p = tcf_hash_lookup(index, hinfo)) != NULL) { in tcf_hash_check()
249 struct tcf_hashinfo *hinfo = a->ops->hinfo; in tcf_hash_create() local
275 p->tcfc_index = index ? index : tcf_hash_new_index(hinfo); in tcf_hash_create()
296 struct tcf_hashinfo *hinfo = a->ops->hinfo; in tcf_hash_insert() local
297 unsigned int h = tcf_hash(p->tcfc_index, hinfo->hmask); in tcf_hash_insert()
299 spin_lock_bh(&hinfo->lock); in tcf_hash_insert()
300 hlist_add_head(&p->tcfc_head, &hinfo->htab[h]); in tcf_hash_insert()
301 spin_unlock_bh(&hinfo->lock); in tcf_hash_insert()
323 act->hinfo = kmalloc(sizeof(struct tcf_hashinfo), GFP_KERNEL); in tcf_register_action()
324 if (!act->hinfo) in tcf_register_action()
326 err = tcf_hashinfo_init(act->hinfo, mask); in tcf_register_action()
328 kfree(act->hinfo); in tcf_register_action()
336 tcf_hashinfo_destroy(act->hinfo); in tcf_register_action()
337 kfree(act->hinfo); in tcf_register_action()
356 tcf_hashinfo_destroy(act->hinfo); in tcf_unregister_action()
357 kfree(act->hinfo); in tcf_unregister_action()