Lines Matching defs:entry
48 static void entry_uninit(struct ratelimiter_entry *entry)
50 hlist_del_rcu(&entry->hash);
51 call_rcu(&entry->rcu, entry_free);
58 struct ratelimiter_entry *entry;
64 hlist_for_each_entry_safe(entry, temp, &table_v4[i], hash) {
66 now - entry->last_time_ns > NSEC_PER_SEC)
67 entry_uninit(entry);
70 hlist_for_each_entry_safe(entry, temp, &table_v6[i], hash) {
72 now - entry->last_time_ns > NSEC_PER_SEC)
73 entry_uninit(entry);
91 struct ratelimiter_entry *entry;
111 hlist_for_each_entry_rcu(entry, bucket, hash) {
112 if (entry->net == net && entry->ip == ip) {
120 spin_lock(&entry->lock);
123 entry->tokens + now -
124 entry->last_time_ns);
125 entry->last_time_ns = now;
127 entry->tokens = ret ? tokens - PACKET_COST : tokens;
128 spin_unlock(&entry->lock);
138 entry = kmem_cache_alloc(entry_cache, GFP_KERNEL);
139 if (unlikely(!entry))
142 entry->net = net;
143 entry->ip = ip;
144 INIT_HLIST_NODE(&entry->hash);
145 spin_lock_init(&entry->lock);
146 entry->last_time_ns = ktime_get_coarse_boottime_ns();
147 entry->tokens = TOKEN_MAX - PACKET_COST;
149 hlist_add_head_rcu(&entry->hash, bucket);