Lines Matching refs:ea
678 static void init_allocator(struct entry_alloc *ea, struct entry_space *es, in init_allocator() argument
683 ea->es = es; in init_allocator()
684 ea->nr_allocated = 0u; in init_allocator()
685 ea->begin = begin; in init_allocator()
687 l_init(&ea->free); in init_allocator()
689 l_add_tail(ea->es, &ea->free, __get_entry(ea->es, i)); in init_allocator()
705 static struct entry *alloc_entry(struct entry_alloc *ea) in alloc_entry() argument
709 if (l_empty(&ea->free)) in alloc_entry()
712 e = l_pop_tail(ea->es, &ea->free); in alloc_entry()
714 ea->nr_allocated++; in alloc_entry()
722 static struct entry *alloc_particular_entry(struct entry_alloc *ea, unsigned i) in alloc_particular_entry() argument
724 struct entry *e = __get_entry(ea->es, ea->begin + i); in alloc_particular_entry()
728 l_del(ea->es, &ea->free, e); in alloc_particular_entry()
730 ea->nr_allocated++; in alloc_particular_entry()
735 static void free_entry(struct entry_alloc *ea, struct entry *e) in free_entry() argument
737 BUG_ON(!ea->nr_allocated); in free_entry()
740 ea->nr_allocated--; in free_entry()
742 l_add_tail(ea->es, &ea->free, e); in free_entry()
745 static bool allocator_empty(struct entry_alloc *ea) in allocator_empty() argument
747 return l_empty(&ea->free); in allocator_empty()
750 static unsigned get_index(struct entry_alloc *ea, struct entry *e) in get_index() argument
752 return to_index(ea->es, e) - ea->begin; in get_index()
755 static struct entry *get_entry(struct entry_alloc *ea, unsigned index) in get_entry() argument
757 return __get_entry(ea->es, ea->begin + index); in get_entry()
835 static struct entry *get_sentinel(struct entry_alloc *ea, unsigned level, bool which) in get_sentinel() argument
837 return get_entry(ea, which ? level : NR_CACHE_LEVELS + level); in get_sentinel()