Lines Matching refs:bucket

1443 static void rt6_remove_exception(struct rt6_exception_bucket *bucket,
1449 if (!bucket || !rt6_ex)
1465 WARN_ON_ONCE(!bucket->depth);
1466 bucket->depth--;
1469 /* Remove oldest rt6_ex in bucket and free the memory
1472 static void rt6_exception_remove_oldest(struct rt6_exception_bucket *bucket)
1476 if (!bucket)
1479 hlist_for_each_entry(rt6_ex, &bucket->chain, hlist) {
1483 rt6_remove_exception(bucket, oldest);
1510 * and update bucket pointer to point to the bucket for this
1515 __rt6_find_exception_spinlock(struct rt6_exception_bucket **bucket,
1522 if (!(*bucket) || !daddr)
1526 *bucket += hval;
1528 hlist_for_each_entry(rt6_ex, &(*bucket)->chain, hlist) {
1543 * and update bucket pointer to point to the bucket for this
1548 __rt6_find_exception_rcu(struct rt6_exception_bucket **bucket,
1557 if (!(*bucket) || !daddr)
1561 *bucket += hval;
1563 hlist_for_each_entry_rcu(rt6_ex, &(*bucket)->chain, hlist) {
1601 /* used when the flushed bit is not relevant, only access to the bucket
1602 * (ie., all bucket users except rt6_insert_exception);
1610 struct rt6_exception_bucket *bucket;
1613 bucket = rcu_dereference_protected(nh->rt6i_exception_bucket,
1616 bucket = rcu_dereference(nh->rt6i_exception_bucket);
1618 /* remove bucket flushed bit if set */
1619 if (bucket) {
1620 unsigned long p = (unsigned long)bucket;
1623 bucket = (struct rt6_exception_bucket *)p;
1626 return bucket;
1629 static bool fib6_nh_excptn_bucket_flushed(struct rt6_exception_bucket *bucket)
1631 unsigned long p = (unsigned long)bucket;
1640 struct rt6_exception_bucket *bucket;
1643 bucket = rcu_dereference_protected(nh->rt6i_exception_bucket,
1646 p = (unsigned long)bucket;
1648 bucket = (struct rt6_exception_bucket *)p;
1649 rcu_assign_pointer(nh->rt6i_exception_bucket, bucket);
1656 struct rt6_exception_bucket *bucket;
1666 bucket = rcu_dereference_protected(nh->rt6i_exception_bucket,
1668 if (!bucket) {
1669 bucket = kcalloc(FIB6_EXCEPTION_BUCKET_SIZE, sizeof(*bucket),
1671 if (!bucket) {
1675 rcu_assign_pointer(nh->rt6i_exception_bucket, bucket);
1676 } else if (fib6_nh_excptn_bucket_flushed(bucket)) {
1700 rt6_ex = __rt6_find_exception_spinlock(&bucket, &nrt->rt6i_dst.addr,
1703 rt6_remove_exception(bucket, rt6_ex);
1712 hlist_add_head_rcu(&rt6_ex->hlist, &bucket->chain);
1713 bucket->depth++;
1718 while (bucket->depth > max_depth)
1719 rt6_exception_remove_oldest(bucket);
1737 struct rt6_exception_bucket *bucket;
1744 bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
1745 if (!bucket)
1748 /* Prevent rt6_insert_exception() to recreate the bucket list */
1753 hlist_for_each_entry_safe(rt6_ex, tmp, &bucket->chain, hlist) {
1756 rt6_remove_exception(bucket, rt6_ex);
1758 WARN_ON_ONCE(!from && bucket->depth);
1759 bucket++;
1791 struct rt6_exception_bucket *bucket;
1811 bucket = fib6_nh_get_excptn_bucket(res->nh, NULL);
1812 rt6_ex = __rt6_find_exception_rcu(&bucket, daddr, src_key);
1833 struct rt6_exception_bucket *bucket;
1841 bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
1853 rt6_ex = __rt6_find_exception_spinlock(&bucket,
1857 rt6_remove_exception(bucket, rt6_ex);
1917 struct rt6_exception_bucket *bucket;
1920 bucket = fib6_nh_get_excptn_bucket(nh, NULL);
1931 rt6_ex = __rt6_find_exception_rcu(&bucket, &rt->rt6i_dst.addr, src_key);
2014 struct rt6_exception_bucket *bucket;
2018 bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
2019 if (!bucket)
2023 hlist_for_each_entry(rt6_ex, &bucket->chain, hlist) {
2034 bucket++;
2043 struct rt6_exception_bucket *bucket;
2052 bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
2053 if (bucket) {
2056 &bucket->chain, hlist) {
2063 rt6_remove_exception(bucket, rt6_ex);
2066 bucket++;
2073 static void rt6_age_examine_exception(struct rt6_exception_bucket *bucket,
2089 rt6_remove_exception(bucket, rt6_ex);
2094 rt6_remove_exception(bucket, rt6_ex);
2106 rt6_remove_exception(bucket, rt6_ex);
2118 struct rt6_exception_bucket *bucket;
2128 bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
2129 if (bucket) {
2132 &bucket->chain, hlist) {
2133 rt6_age_examine_exception(bucket, rt6_ex,
2136 bucket++;
3640 struct rt6_exception_bucket *bucket;
3645 bucket = fib6_nh_get_excptn_bucket(fib6_nh, NULL);
3646 if (bucket) {
3648 kfree(bucket);
5827 struct rt6_exception_bucket *bucket;
5831 bucket = fib6_nh_get_excptn_bucket(nh, NULL);
5832 if (!bucket)
5836 hlist_for_each_entry(rt6_ex, &bucket->chain, hlist) {
5868 bucket++;