Lines Matching refs:enr

244 static struct hlist_head *lc_hash_slot(struct lru_cache *lc, unsigned int enr)  in lc_hash_slot()  argument
246 return lc->lc_slot + (enr % lc->nr_elements); in lc_hash_slot()
250 static struct lc_element *__lc_find(struct lru_cache *lc, unsigned int enr, in __lc_find() argument
257 hlist_for_each_entry(e, lc_hash_slot(lc, enr), colision) { in __lc_find()
261 if (e->lc_new_number != enr) in __lc_find()
281 struct lc_element *lc_find(struct lru_cache *lc, unsigned int enr) in lc_find() argument
283 return __lc_find(lc, enr, 0); in lc_find()
296 bool lc_is_used(struct lru_cache *lc, unsigned int enr) in lc_is_used() argument
298 struct lc_element *e = __lc_find(lc, enr, 1); in lc_is_used()
362 static struct lc_element *__lc_get(struct lru_cache *lc, unsigned int enr, unsigned int flags) in __lc_get() argument
372 e = __lc_find(lc, enr, 1); in __lc_get()
430 e = lc_prepare_for_change(lc, enr); in __lc_get()
481 struct lc_element *lc_get(struct lru_cache *lc, unsigned int enr) in lc_get() argument
483 return __lc_get(lc, enr, LC_GET_MAY_CHANGE); in lc_get()
501 struct lc_element *lc_get_cumulative(struct lru_cache *lc, unsigned int enr) in lc_get_cumulative() argument
503 return __lc_get(lc, enr, LC_GET_MAY_CHANGE|LC_GET_MAY_USE_UNCOMMITTED); in lc_get_cumulative()
522 struct lc_element *lc_try_get(struct lru_cache *lc, unsigned int enr) in lc_try_get() argument
524 return __lc_get(lc, enr, 0); in lc_try_get()
607 void lc_set(struct lru_cache *lc, unsigned int enr, int index) in lc_set() argument
619 e->lc_number = e->lc_new_number = enr; in lc_set()
621 if (enr == LC_FREE) in lc_set()
624 hlist_add_head(&e->colision, lc_hash_slot(lc, enr)); in lc_set()