Lines Matching refs:entry

61 	struct sidtab_entry *entry;
65 hash_for_each_possible_rcu(s->context_to_sid, entry, list, hash) {
66 if (entry->hash != hash)
68 if (context_cmp(&entry->context, context)) {
69 sid = entry->sid;
88 rc = context_cpy(&isid->entry.context, context);
93 isid->entry.cache = NULL;
106 isid->entry.sid = sid;
107 isid->entry.hash = hash;
108 hash_add(s->context_to_sid, &isid->entry.list, hash);
122 struct sidtab_entry *entry;
125 hash_for_each_rcu(sidtab->context_to_sid, i, entry, list) {
184 union sidtab_entry_inner *entry;
196 entry = &s->roots[level];
201 entry = &entry->ptr_inner->entries[leaf_index >> capacity_shift];
204 if (!entry->ptr_inner) {
206 entry->ptr_inner = kzalloc(SIDTAB_NODE_ALLOC_SIZE,
208 if (!entry->ptr_inner)
212 if (!entry->ptr_leaf) {
214 entry->ptr_leaf = kzalloc(SIDTAB_NODE_ALLOC_SIZE,
216 if (!entry->ptr_leaf)
219 return &entry->ptr_leaf->entries[index % SIDTAB_LEAF_ENTRIES];
235 return s->isids[sid - 1].set ? &s->isids[sid - 1].entry : NULL;
242 struct sidtab_entry *entry;
245 entry = sidtab_lookup(s, sid_to_index(sid));
247 entry = sidtab_lookup_initial(s, sid);
248 if (entry && (!entry->context.len || force))
249 return entry;
302 /* insert context into new entry */
363 struct sidtab_entry *entry;
367 entry = sidtab_do_lookup(s, i, 0);
368 entry->sid = index_to_sid(i);
369 entry->hash = context_compute_hash(&entry->context);
371 hash_add_rcu(s->context_to_sid, &entry->list, entry->hash);
503 static void sidtab_destroy_entry(struct sidtab_entry *entry)
505 context_destroy(&entry->context);
507 kfree(rcu_dereference_raw(entry->cache));
511 static void sidtab_destroy_tree(union sidtab_entry_inner entry, u32 level)
516 struct sidtab_node_inner *node = entry.ptr_inner;
525 struct sidtab_node_leaf *node = entry.ptr_leaf;
542 sidtab_destroy_entry(&s->isids[i].entry);
558 void sidtab_sid2str_put(struct sidtab *s, struct sidtab_entry *entry,
565 if (entry->context.len)
570 cache = rcu_dereference_protected(entry->cache,
573 /* entry in cache - just bump to the head of LRU list */
583 /* pop a cache entry from the tail and free it */
591 cache->parent = entry;
596 rcu_assign_pointer(entry->cache, cache);
603 int sidtab_sid2str_get(struct sidtab *s, struct sidtab_entry *entry,
609 if (entry->context.len)
614 cache = rcu_dereference(entry->cache);
629 sidtab_sid2str_put(s, entry, *out, *out_len);