Lines Matching defs:bucket

1492 static void rt6_remove_exception(struct rt6_exception_bucket *bucket,
1497 if (!bucket || !rt6_ex)
1511 WARN_ON_ONCE(!bucket->depth);
1512 bucket->depth--;
1515 /* Remove oldest rt6_ex in bucket and free the memory
1518 static void rt6_exception_remove_oldest(struct rt6_exception_bucket *bucket)
1522 if (!bucket)
1525 hlist_for_each_entry(rt6_ex, &bucket->chain, hlist) {
1529 rt6_remove_exception(bucket, oldest);
1556 * and update bucket pointer to point to the bucket for this
1561 __rt6_find_exception_spinlock(struct rt6_exception_bucket **bucket,
1568 if (!(*bucket) || !daddr)
1572 *bucket += hval;
1574 hlist_for_each_entry(rt6_ex, &(*bucket)->chain, hlist) {
1589 * and update bucket pointer to point to the bucket for this
1594 __rt6_find_exception_rcu(struct rt6_exception_bucket **bucket,
1603 if (!(*bucket) || !daddr)
1607 *bucket += hval;
1609 hlist_for_each_entry_rcu(rt6_ex, &(*bucket)->chain, hlist) {
1647 /* used when the flushed bit is not relevant, only access to the bucket
1648 * (ie., all bucket users except rt6_insert_exception);
1656 struct rt6_exception_bucket *bucket;
1659 bucket = rcu_dereference_protected(nh->rt6i_exception_bucket,
1662 bucket = rcu_dereference(nh->rt6i_exception_bucket);
1664 /* remove bucket flushed bit if set */
1665 if (bucket) {
1666 unsigned long p = (unsigned long)bucket;
1669 bucket = (struct rt6_exception_bucket *)p;
1672 return bucket;
1675 static bool fib6_nh_excptn_bucket_flushed(struct rt6_exception_bucket *bucket)
1677 unsigned long p = (unsigned long)bucket;
1686 struct rt6_exception_bucket *bucket;
1689 bucket = rcu_dereference_protected(nh->rt6i_exception_bucket,
1692 p = (unsigned long)bucket;
1694 bucket = (struct rt6_exception_bucket *)p;
1695 rcu_assign_pointer(nh->rt6i_exception_bucket, bucket);
1702 struct rt6_exception_bucket *bucket;
1712 bucket = rcu_dereference_protected(nh->rt6i_exception_bucket,
1714 if (!bucket) {
1715 bucket = kcalloc(FIB6_EXCEPTION_BUCKET_SIZE, sizeof(*bucket),
1717 if (!bucket) {
1721 rcu_assign_pointer(nh->rt6i_exception_bucket, bucket);
1722 } else if (fib6_nh_excptn_bucket_flushed(bucket)) {
1746 rt6_ex = __rt6_find_exception_spinlock(&bucket, &nrt->rt6i_dst.addr,
1749 rt6_remove_exception(bucket, rt6_ex);
1758 hlist_add_head_rcu(&rt6_ex->hlist, &bucket->chain);
1759 bucket->depth++;
1764 while (bucket->depth > max_depth)
1765 rt6_exception_remove_oldest(bucket);
1784 struct rt6_exception_bucket *bucket;
1791 bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
1792 if (!bucket)
1795 /* Prevent rt6_insert_exception() to recreate the bucket list */
1800 hlist_for_each_entry_safe(rt6_ex, tmp, &bucket->chain, hlist) {
1803 rt6_remove_exception(bucket, rt6_ex);
1805 WARN_ON_ONCE(!from && bucket->depth);
1806 bucket++;
1840 struct rt6_exception_bucket *bucket;
1860 bucket = fib6_nh_get_excptn_bucket(res->nh, NULL);
1861 rt6_ex = __rt6_find_exception_rcu(&bucket, daddr, src_key);
1882 struct rt6_exception_bucket *bucket;
1890 bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
1902 rt6_ex = __rt6_find_exception_spinlock(&bucket,
1906 rt6_remove_exception(bucket, rt6_ex);
1966 struct rt6_exception_bucket *bucket;
1969 bucket = fib6_nh_get_excptn_bucket(nh, NULL);
1980 rt6_ex = __rt6_find_exception_rcu(&bucket, &rt->rt6i_dst.addr, src_key);
2063 struct rt6_exception_bucket *bucket;
2067 bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
2068 if (!bucket)
2072 hlist_for_each_entry(rt6_ex, &bucket->chain, hlist) {
2083 bucket++;
2092 struct rt6_exception_bucket *bucket;
2101 bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
2102 if (bucket) {
2105 &bucket->chain, hlist) {
2112 rt6_remove_exception(bucket, rt6_ex);
2115 bucket++;
2122 static void rt6_age_examine_exception(struct rt6_exception_bucket *bucket,
2139 rt6_remove_exception(bucket, rt6_ex);
2144 rt6_remove_exception(bucket, rt6_ex);
2156 rt6_remove_exception(bucket, rt6_ex);
2168 struct rt6_exception_bucket *bucket;
2178 bucket = fib6_nh_get_excptn_bucket(nh, &rt6_exception_lock);
2179 if (bucket) {
2182 &bucket->chain, hlist) {
2183 rt6_age_examine_exception(bucket, rt6_ex,
2186 bucket++;
3700 struct rt6_exception_bucket *bucket;
3705 bucket = fib6_nh_get_excptn_bucket(fib6_nh, NULL);
3706 if (bucket) {
3708 kfree(bucket);
5993 struct rt6_exception_bucket *bucket;
5997 bucket = fib6_nh_get_excptn_bucket(nh, NULL);
5998 if (!bucket)
6002 hlist_for_each_entry(rt6_ex, &bucket->chain, hlist) {
6034 bucket++;