Lines Matching refs:enr

255 static struct hlist_head *lc_hash_slot(struct lru_cache *lc, unsigned int enr)  in lc_hash_slot()  argument
257 return lc->lc_slot + (enr % lc->nr_elements); in lc_hash_slot()
261 static struct lc_element *__lc_find(struct lru_cache *lc, unsigned int enr, in __lc_find() argument
268 hlist_for_each_entry(e, lc_hash_slot(lc, enr), colision) { in __lc_find()
272 if (e->lc_new_number != enr) in __lc_find()
292 struct lc_element *lc_find(struct lru_cache *lc, unsigned int enr) in lc_find() argument
294 return __lc_find(lc, enr, 0); in lc_find()
307 bool lc_is_used(struct lru_cache *lc, unsigned int enr) in lc_is_used() argument
309 struct lc_element *e = __lc_find(lc, enr, 1); in lc_is_used()
373 static struct lc_element *__lc_get(struct lru_cache *lc, unsigned int enr, unsigned int flags) in __lc_get() argument
383 e = __lc_find(lc, enr, 1); in __lc_get()
441 e = lc_prepare_for_change(lc, enr); in __lc_get()
492 struct lc_element *lc_get(struct lru_cache *lc, unsigned int enr) in lc_get() argument
494 return __lc_get(lc, enr, LC_GET_MAY_CHANGE); in lc_get()
512 struct lc_element *lc_get_cumulative(struct lru_cache *lc, unsigned int enr) in lc_get_cumulative() argument
514 return __lc_get(lc, enr, LC_GET_MAY_CHANGE|LC_GET_MAY_USE_UNCOMMITTED); in lc_get_cumulative()
533 struct lc_element *lc_try_get(struct lru_cache *lc, unsigned int enr) in lc_try_get() argument
535 return __lc_get(lc, enr, 0); in lc_try_get()
618 void lc_set(struct lru_cache *lc, unsigned int enr, int index) in lc_set() argument
630 e->lc_number = e->lc_new_number = enr; in lc_set()
632 if (enr == LC_FREE) in lc_set()
635 hlist_add_head(&e->colision, lc_hash_slot(lc, enr)); in lc_set()