Lines Matching refs:entry
60 struct sidtab_entry *entry;
64 hash_for_each_possible_rcu(s->context_to_sid, entry, list, hash) {
65 if (entry->hash != hash)
67 if (context_cmp(&entry->context, context)) {
68 sid = entry->sid;
87 rc = context_cpy(&isid->entry.context, context);
92 isid->entry.cache = NULL;
105 isid->entry.sid = sid;
106 isid->entry.hash = hash;
107 hash_add(s->context_to_sid, &isid->entry.list, hash);
121 struct sidtab_entry *entry;
124 hash_for_each_rcu(sidtab->context_to_sid, i, entry, list) {
183 union sidtab_entry_inner *entry;
195 entry = &s->roots[level];
200 entry = &entry->ptr_inner->entries[leaf_index >> capacity_shift];
203 if (!entry->ptr_inner) {
205 entry->ptr_inner = kzalloc(SIDTAB_NODE_ALLOC_SIZE,
207 if (!entry->ptr_inner)
211 if (!entry->ptr_leaf) {
213 entry->ptr_leaf = kzalloc(SIDTAB_NODE_ALLOC_SIZE,
215 if (!entry->ptr_leaf)
218 return &entry->ptr_leaf->entries[index % SIDTAB_LEAF_ENTRIES];
234 return s->isids[sid - 1].set ? &s->isids[sid - 1].entry : NULL;
241 struct sidtab_entry *entry;
244 entry = sidtab_lookup(s, sid_to_index(sid));
246 entry = sidtab_lookup_initial(s, sid);
247 if (entry && (!entry->context.len || force))
248 return entry;
302 /* insert context into new entry */
359 struct sidtab_entry *entry;
363 entry = sidtab_do_lookup(s, i, 0);
364 entry->sid = index_to_sid(i);
365 entry->hash = context_compute_hash(&entry->context);
367 hash_add_rcu(s->context_to_sid, &entry->list, entry->hash);
498 static void sidtab_destroy_entry(struct sidtab_entry *entry)
500 context_destroy(&entry->context);
502 kfree(rcu_dereference_raw(entry->cache));
506 static void sidtab_destroy_tree(union sidtab_entry_inner entry, u32 level)
511 struct sidtab_node_inner *node = entry.ptr_inner;
520 struct sidtab_node_leaf *node = entry.ptr_leaf;
537 sidtab_destroy_entry(&s->isids[i].entry);
553 void sidtab_sid2str_put(struct sidtab *s, struct sidtab_entry *entry,
560 if (entry->context.len)
565 cache = rcu_dereference_protected(entry->cache,
568 /* entry in cache - just bump to the head of LRU list */
578 /* pop a cache entry from the tail and free it */
586 cache->parent = entry;
591 rcu_assign_pointer(entry->cache, cache);
598 int sidtab_sid2str_get(struct sidtab *s, struct sidtab_entry *entry,
604 if (entry->context.len)
609 cache = rcu_dereference(entry->cache);
624 sidtab_sid2str_put(s, entry, *out, *out_len);