Lines Matching refs:entry
26 struct btrfs_lru_cache_entry *entry;
28 list_for_each_entry(entry, head, list) {
29 if (entry->key == key && entry->gen == gen)
30 return entry;
37 * Lookup for an entry in the cache.
40 * @key: The key of the entry we are looking for.
43 * Returns the entry associated with the key or NULL if none found.
49 struct btrfs_lru_cache_entry *entry;
55 entry = match_entry(head, key, gen);
56 if (entry)
57 list_move_tail(&entry->lru_list, &cache->lru_list);
59 return entry;
63 * Remove an entry from the cache.
66 * @entry: The entry to remove from the cache.
68 * Note: this also frees the memory used by the entry.
71 struct btrfs_lru_cache_entry *entry)
73 struct list_head *prev = entry->list.prev;
78 list_del(&entry->list);
79 list_del(&entry->lru_list);
85 * If previous element in the list entry->list is now empty, it
86 * means it's a head entry not pointing to any cached entries,
89 head = mtree_erase(&cache->entries, entry->key);
94 kfree(entry);
99 * Store an entry in the cache.
102 * @entry: The entry to store.
158 struct btrfs_lru_cache_entry *entry;
161 list_for_each_entry_safe(entry, tmp, &cache->lru_list, lru_list)
162 btrfs_lru_cache_remove(cache, entry);