Lines Matching refs:entry
132 static void cipso_v4_cache_entry_free(struct cipso_v4_map_cache_entry *entry) in cipso_v4_cache_entry_free() argument
134 if (entry->lsm_data) in cipso_v4_cache_entry_free()
135 netlbl_secattr_cache_free(entry->lsm_data); in cipso_v4_cache_entry_free()
136 kfree(entry->key); in cipso_v4_cache_entry_free()
137 kfree(entry); in cipso_v4_cache_entry_free()
195 struct cipso_v4_map_cache_entry *entry, *tmp_entry; in cipso_v4_cache_invalidate() local
200 list_for_each_entry_safe(entry, in cipso_v4_cache_invalidate()
203 list_del(&entry->list); in cipso_v4_cache_invalidate()
204 cipso_v4_cache_entry_free(entry); in cipso_v4_cache_invalidate()
238 struct cipso_v4_map_cache_entry *entry; in cipso_v4_cache_check() local
248 list_for_each_entry(entry, &cipso_v4_cache[bkt].list, list) { in cipso_v4_cache_check()
249 if (entry->hash == hash && in cipso_v4_cache_check()
250 entry->key_len == key_len && in cipso_v4_cache_check()
251 memcmp(entry->key, key, key_len) == 0) { in cipso_v4_cache_check()
252 entry->activity += 1; in cipso_v4_cache_check()
253 refcount_inc(&entry->lsm_data->refcount); in cipso_v4_cache_check()
254 secattr->cache = entry->lsm_data; in cipso_v4_cache_check()
264 if (entry->activity > prev_entry->activity && in cipso_v4_cache_check()
265 entry->activity - prev_entry->activity > in cipso_v4_cache_check()
267 __list_del(entry->list.prev, entry->list.next); in cipso_v4_cache_check()
268 __list_add(&entry->list, in cipso_v4_cache_check()
276 prev_entry = entry; in cipso_v4_cache_check()
302 struct cipso_v4_map_cache_entry *entry = NULL; in cipso_v4_cache_add() local
311 entry = kzalloc(sizeof(*entry), GFP_ATOMIC); in cipso_v4_cache_add()
312 if (!entry) in cipso_v4_cache_add()
314 entry->key = kmemdup(cipso_ptr, cipso_ptr_len, GFP_ATOMIC); in cipso_v4_cache_add()
315 if (!entry->key) { in cipso_v4_cache_add()
319 entry->key_len = cipso_ptr_len; in cipso_v4_cache_add()
320 entry->hash = cipso_v4_map_cache_hash(cipso_ptr, cipso_ptr_len); in cipso_v4_cache_add()
322 entry->lsm_data = secattr->cache; in cipso_v4_cache_add()
324 bkt = entry->hash & (CIPSO_V4_CACHE_BUCKETS - 1); in cipso_v4_cache_add()
327 list_add(&entry->list, &cipso_v4_cache[bkt].list); in cipso_v4_cache_add()
333 list_add(&entry->list, &cipso_v4_cache[bkt].list); in cipso_v4_cache_add()
341 if (entry) in cipso_v4_cache_add()
342 cipso_v4_cache_entry_free(entry); in cipso_v4_cache_add()
491 static void cipso_v4_doi_free_rcu(struct rcu_head *entry) in cipso_v4_doi_free_rcu() argument
495 doi_def = container_of(entry, struct cipso_v4_doi, rcu); in cipso_v4_doi_free_rcu()