Lines Matching refs:bucket
1444 static void rt6_remove_exception(struct rt6_exception_bucket *bucket,
1450 if (!bucket || !rt6_ex)
1466 WARN_ON_ONCE(!bucket->depth);
1467 bucket->depth--;
1470 /* Remove oldest rt6_ex in bucket and free the memory
1473 static void rt6_exception_remove_oldest(struct rt6_exception_bucket *bucket)
1477 if (!bucket)
1480 hlist_for_each_entry(rt6_ex, &bucket->chain, hlist) {
1484 rt6_remove_exception(bucket, oldest);
1511 * and update bucket pointer to point to the bucket for this
1516 __rt6_find_exception_spinlock(struct rt6_exception_bucket **bucket,
1523 if (!(*bucket) || !daddr)
1527 *bucket += hval;
1529 hlist_for_each_entry(rt6_ex, &(*bucket)->chain, hlist) {
1544 * and update bucket pointer to point to the bucket for this
1549 __rt6_find_exception_rcu(struct rt6_exception_bucket **bucket,
1558 if (!(*bucket) || !daddr)
1562 *bucket += hval;
1564 hlist_for_each_entry_rcu(rt6_ex, &(*bucket)->chain, hlist) {
1602 /* used when the flushed bit is not relevant, only access to the bucket
1603 * (ie., all bucket users except rt6_insert_exception);
1611 struct rt6_exception_bucket *bucket;
1614 bucket = rcu_dereference_protected(nh->rt6i_exception_bucket,
1617 bucket = rcu_dereference(nh->rt6i_exception_bucket);
1619 /* remove bucket flushed bit if set */
1620 if (bucket) {
1621 unsigned long p = (unsigned long)bucket;
1624 bucket = (struct rt6_exception_bucket *)p;
1627 return bucket;
1630 static bool fib6_nh_excptn_bucket_flushed(struct rt6_exception_bucket *bucket)
1632 unsigned long p = (unsigned long)bucket;
1641 struct rt6_exception_bucket *bucket;
1644 bucket = rcu_dereference_protected(nh->rt6i_exception_bucket,
1647 p = (unsigned long)bucket;
1649 bucket = (struct rt6_exception_bucket *)p;
1650 rcu_assign_pointer(nh->rt6i_exception_bucket, bucket);
1657 struct rt6_exception_bucket *bucket;
1667 bucket = rcu_dereference_protected(nh->rt6i_exception_bucket,
1669 if (!bucket) {
1670 bucket = kcalloc(FIB6_EXCEPTION_BUCKET_SIZE, sizeof(*bucket),
1672 if (!bucket) {
1676 rcu_assign_pointer(nh->rt6i_exception_bucket, bucket);
1677 } else if (fib6_nh_excptn_bucket_flushed(bucket)) {
1701 rt6_ex = __rt6_find_exception_spinlock(&bucket, &nrt->rt6i_dst.addr,
1704 rt6_remove_exception(bucket, rt6_ex);
1713 hlist_add_head_rcu(&rt6_ex->hlist, &bucket->chain);
1714 bucket->depth++;
1719 while (bucket->depth > max_depth)
1720 rt6_exception_remove_oldest(bucket);
1738 struct rt6_exception_bucket *bucket;
1745 bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
1746 if (!bucket)
1749 /* Prevent rt6_insert_exception() to recreate the bucket list */
1754 hlist_for_each_entry_safe(rt6_ex, tmp, &bucket->chain, hlist) {
1757 rt6_remove_exception(bucket, rt6_ex);
1759 WARN_ON_ONCE(!from && bucket->depth);
1760 bucket++;
1792 struct rt6_exception_bucket *bucket;
1812 bucket = fib6_nh_get_excptn_bucket(res->nh, NULL);
1813 rt6_ex = __rt6_find_exception_rcu(&bucket, daddr, src_key);
1834 struct rt6_exception_bucket *bucket;
1842 bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
1854 rt6_ex = __rt6_find_exception_spinlock(&bucket,
1858 rt6_remove_exception(bucket, rt6_ex);
1918 struct rt6_exception_bucket *bucket;
1921 bucket = fib6_nh_get_excptn_bucket(nh, NULL);
1932 rt6_ex = __rt6_find_exception_rcu(&bucket, &rt->rt6i_dst.addr, src_key);
2015 struct rt6_exception_bucket *bucket;
2019 bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
2020 if (!bucket)
2024 hlist_for_each_entry(rt6_ex, &bucket->chain, hlist) {
2035 bucket++;
2044 struct rt6_exception_bucket *bucket;
2053 bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
2054 if (bucket) {
2057 &bucket->chain, hlist) {
2064 rt6_remove_exception(bucket, rt6_ex);
2067 bucket++;
2074 static void rt6_age_examine_exception(struct rt6_exception_bucket *bucket,
2090 rt6_remove_exception(bucket, rt6_ex);
2095 rt6_remove_exception(bucket, rt6_ex);
2110 rt6_remove_exception(bucket, rt6_ex);
2122 struct rt6_exception_bucket *bucket;
2132 bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
2133 if (bucket) {
2136 &bucket->chain, hlist) {
2137 rt6_age_examine_exception(bucket, rt6_ex,
2140 bucket++;
3540 struct rt6_exception_bucket *bucket;
3545 bucket = fib6_nh_get_excptn_bucket(fib6_nh, NULL);
3546 if (bucket) {
3548 kfree(bucket);
5728 struct rt6_exception_bucket *bucket;
5732 bucket = fib6_nh_get_excptn_bucket(nh, NULL);
5733 if (!bucket)
5737 hlist_for_each_entry(rt6_ex, &bucket->chain, hlist) {
5769 bucket++;