Lines Matching refs:entry
93 * calipso_cache_entry_free - Frees a cache entry
94 * @entry: the entry to free
97 * This function frees the memory associated with a cache entry including the
101 static void calipso_cache_entry_free(struct calipso_map_cache_entry *entry)
103 if (entry->lsm_data)
104 netlbl_secattr_cache_free(entry->lsm_data);
105 kfree(entry->key);
106 kfree(entry);
161 struct calipso_map_cache_entry *entry, *tmp_entry;
166 list_for_each_entry_safe(entry,
169 list_del(&entry->list);
170 calipso_cache_entry_free(entry);
187 * cache is adjusted in the following manner if the entry is not already the
190 * 1. The cache entry's activity counter is incremented
191 * 2. The previous (higher ranking) entry's activity counter is decremented
204 struct calipso_map_cache_entry *entry;
214 list_for_each_entry(entry, &calipso_cache[bkt].list, list) {
215 if (entry->hash == hash &&
216 entry->key_len == key_len &&
217 memcmp(entry->key, key, key_len) == 0) {
218 entry->activity += 1;
219 refcount_inc(&entry->lsm_data->refcount);
220 secattr->cache = entry->lsm_data;
230 if (entry->activity > prev_entry->activity &&
231 entry->activity - prev_entry->activity >
233 __list_del(entry->list.prev, entry->list.next);
234 __list_add(&entry->list,
242 prev_entry = entry;
250 * calipso_cache_add - Add an entry to the CALIPSO cache
255 * Add a new entry into the CALIPSO label mapping cache. Add the new entry to
257 * the last entry in the list first. It is important to note that there is
269 struct calipso_map_cache_entry *entry = NULL;
278 entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
279 if (!entry)
281 entry->key = kmemdup(calipso_ptr + 2, calipso_ptr_len, GFP_ATOMIC);
282 if (!entry->key) {
286 entry->key_len = calipso_ptr_len;
287 entry->hash = calipso_map_cache_hash(calipso_ptr, calipso_ptr_len);
289 entry->lsm_data = secattr->cache;
291 bkt = entry->hash & (CALIPSO_CACHE_BUCKETS - 1);
294 list_add(&entry->list, &calipso_cache[bkt].list);
300 list_add(&entry->list, &calipso_cache[bkt].list);
308 if (entry)
309 calipso_cache_entry_free(entry);
410 * @entry: the entry's RCU field
418 static void calipso_doi_free_rcu(struct rcu_head *entry)
422 doi_def = container_of(entry, struct calipso_doi, rcu);
522 * For each entry call @callback, if @callback returns a negative value stop