Lines Matching refs:tbl

9  *                                   *lock(tbl->lock) ==> *lock(&tbl->lock)
10 * Wensong Zhang : fixed the uninitialized tbl->lock bug
168 ip_vs_lblc_hash(struct ip_vs_lblc_table *tbl, struct ip_vs_lblc_entry *en)
172 hlist_add_head_rcu(&en->list, &tbl->bucket[hash]);
173 atomic_inc(&tbl->entries);
179 ip_vs_lblc_get(int af, struct ip_vs_lblc_table *tbl,
185 hlist_for_each_entry_rcu(en, &tbl->bucket[hash], list)
198 ip_vs_lblc_new(struct ip_vs_lblc_table *tbl, const union nf_inet_addr *daddr,
203 en = ip_vs_lblc_get(af, tbl, daddr);
220 ip_vs_lblc_hash(tbl, en);
231 struct ip_vs_lblc_table *tbl = svc->sched_data;
237 tbl->dead = true;
239 hlist_for_each_entry_safe(en, next, &tbl->bucket[i], list) {
241 atomic_dec(&tbl->entries);
258 struct ip_vs_lblc_table *tbl = svc->sched_data;
264 for (i = 0, j = tbl->rover; i < IP_VS_LBLC_TAB_SIZE; i++) {
268 hlist_for_each_entry_safe(en, next, &tbl->bucket[j], list) {
275 atomic_dec(&tbl->entries);
279 tbl->rover = j;
296 struct ip_vs_lblc_table *tbl = from_timer(tbl, t, periodic_timer);
297 struct ip_vs_service *svc = tbl->svc;
304 if ((tbl->counter % COUNT_FOR_FULL_EXPIRATION) == 0) {
307 tbl->counter = 1;
311 if (atomic_read(&tbl->entries) <= tbl->max_size) {
312 tbl->counter++;
316 goal = (atomic_read(&tbl->entries) - tbl->max_size)*4/3;
317 if (goal > tbl->max_size/2)
318 goal = tbl->max_size/2;
320 for (i = 0, j = tbl->rover; i < IP_VS_LBLC_TAB_SIZE; i++) {
324 hlist_for_each_entry_safe(en, next, &tbl->bucket[j], list) {
329 atomic_dec(&tbl->entries);
336 tbl->rover = j;
339 mod_timer(&tbl->periodic_timer, jiffies + CHECK_EXPIRE_INTERVAL);
346 struct ip_vs_lblc_table *tbl;
351 tbl = kmalloc(sizeof(*tbl), GFP_KERNEL);
352 if (tbl == NULL)
355 svc->sched_data = tbl;
357 "current service\n", sizeof(*tbl));
363 INIT_HLIST_HEAD(&tbl->bucket[i]);
365 tbl->max_size = IP_VS_LBLC_TAB_SIZE*16;
366 tbl->rover = 0;
367 tbl->counter = 1;
368 tbl->dead = false;
369 tbl->svc = svc;
370 atomic_set(&tbl->entries, 0);
375 timer_setup(&tbl->periodic_timer, ip_vs_lblc_check_expire, 0);
376 mod_timer(&tbl->periodic_timer, jiffies + CHECK_EXPIRE_INTERVAL);
384 struct ip_vs_lblc_table *tbl = svc->sched_data;
387 timer_shutdown_sync(&tbl->periodic_timer);
393 kfree_rcu(tbl, rcu_head);
395 sizeof(*tbl));
484 struct ip_vs_lblc_table *tbl = svc->sched_data;
491 en = ip_vs_lblc_get(svc->af, tbl, &iph->daddr);
520 if (!tbl->dead)
521 ip_vs_lblc_new(tbl, &iph->daddr, svc->af, dest);