Lines Matching refs:enr
243 static struct hlist_head *lc_hash_slot(struct lru_cache *lc, unsigned int enr) in lc_hash_slot() argument
245 return lc->lc_slot + (enr % lc->nr_elements); in lc_hash_slot()
249 static struct lc_element *__lc_find(struct lru_cache *lc, unsigned int enr, in __lc_find() argument
256 hlist_for_each_entry(e, lc_hash_slot(lc, enr), colision) { in __lc_find()
260 if (e->lc_new_number != enr) in __lc_find()
280 struct lc_element *lc_find(struct lru_cache *lc, unsigned int enr) in lc_find() argument
282 return __lc_find(lc, enr, 0); in lc_find()
295 bool lc_is_used(struct lru_cache *lc, unsigned int enr) in lc_is_used() argument
297 struct lc_element *e = __lc_find(lc, enr, 1); in lc_is_used()
361 static struct lc_element *__lc_get(struct lru_cache *lc, unsigned int enr, unsigned int flags) in __lc_get() argument
371 e = __lc_find(lc, enr, 1); in __lc_get()
429 e = lc_prepare_for_change(lc, enr); in __lc_get()
480 struct lc_element *lc_get(struct lru_cache *lc, unsigned int enr) in lc_get() argument
482 return __lc_get(lc, enr, LC_GET_MAY_CHANGE); in lc_get()
500 struct lc_element *lc_get_cumulative(struct lru_cache *lc, unsigned int enr) in lc_get_cumulative() argument
502 return __lc_get(lc, enr, LC_GET_MAY_CHANGE|LC_GET_MAY_USE_UNCOMMITTED); in lc_get_cumulative()
521 struct lc_element *lc_try_get(struct lru_cache *lc, unsigned int enr) in lc_try_get() argument
523 return __lc_get(lc, enr, 0); in lc_try_get()
606 void lc_set(struct lru_cache *lc, unsigned int enr, int index) in lc_set() argument
618 e->lc_number = e->lc_new_number = enr; in lc_set()
620 if (enr == LC_FREE) in lc_set()
623 hlist_add_head(&e->colision, lc_hash_slot(lc, enr)); in lc_set()