Lines Matching refs:head
23 static struct btrfs_lru_cache_entry *match_entry(struct list_head *head, u64 key, in match_entry() argument
28 list_for_each_entry(entry, head, list) { in match_entry()
48 struct list_head *head; in btrfs_lru_cache_lookup() local
51 head = mtree_load(&cache->entries, key); in btrfs_lru_cache_lookup()
52 if (!head) in btrfs_lru_cache_lookup()
55 entry = match_entry(head, key, gen); in btrfs_lru_cache_lookup()
82 struct list_head *head; in btrfs_lru_cache_remove() local
89 head = mtree_erase(&cache->entries, entry->key); in btrfs_lru_cache_remove()
90 ASSERT(head == prev); in btrfs_lru_cache_remove()
91 kfree(head); in btrfs_lru_cache_remove()
111 struct list_head *head; in btrfs_lru_cache_store() local
114 head = kmalloc_obj(*head, gfp); in btrfs_lru_cache_store()
115 if (!head) in btrfs_lru_cache_store()
118 ret = mtree_insert(&cache->entries, key, head, gfp); in btrfs_lru_cache_store()
120 INIT_LIST_HEAD(head); in btrfs_lru_cache_store()
121 list_add_tail(&new_entry->list, head); in btrfs_lru_cache_store()
123 kfree(head); in btrfs_lru_cache_store()
124 head = mtree_load(&cache->entries, key); in btrfs_lru_cache_store()
125 ASSERT(head != NULL); in btrfs_lru_cache_store()
126 if (match_entry(head, key, new_entry->gen) != NULL) in btrfs_lru_cache_store()
128 list_add_tail(&new_entry->list, head); in btrfs_lru_cache_store()
130 kfree(head); in btrfs_lru_cache_store()