Lines Matching refs:enr
243 static struct hlist_head *lc_hash_slot(struct lru_cache *lc, unsigned int enr)
245 return lc->lc_slot + (enr % lc->nr_elements);
249 static struct lc_element *__lc_find(struct lru_cache *lc, unsigned int enr,
256 hlist_for_each_entry(e, lc_hash_slot(lc, enr), colision) {
260 if (e->lc_new_number != enr)
272 * @enr: element number
280 struct lc_element *lc_find(struct lru_cache *lc, unsigned int enr)
282 return __lc_find(lc, enr, 0);
288 * @enr: element number
295 bool lc_is_used(struct lru_cache *lc, unsigned int enr)
297 struct lc_element *e = __lc_find(lc, enr, 1);
307 * sets @e->enr to %LC_FREE.
361 static struct lc_element *__lc_get(struct lru_cache *lc, unsigned int enr, unsigned int flags)
371 e = __lc_find(lc, enr, 1);
373 * this enr is currently being pulled in already,
429 e = lc_prepare_for_change(lc, enr);
443 * @enr: the label to look up
480 struct lc_element *lc_get(struct lru_cache *lc, unsigned int enr)
482 return __lc_get(lc, enr, LC_GET_MAY_CHANGE);
488 * @enr: the label to look up
490 * Unlike lc_get this also returns the element for @enr, if it is belonging to
500 struct lc_element *lc_get_cumulative(struct lru_cache *lc, unsigned int enr)
502 return __lc_get(lc, enr, LC_GET_MAY_CHANGE|LC_GET_MAY_USE_UNCOMMITTED);
508 * @enr: the label to look up
521 struct lc_element *lc_try_get(struct lru_cache *lc, unsigned int enr)
523 return __lc_get(lc, enr, 0);
601 * @enr: the label to set
606 void lc_set(struct lru_cache *lc, unsigned int enr, int index)
618 e->lc_number = e->lc_new_number = enr;
620 if (enr == LC_FREE)
623 hlist_add_head(&e->colision, lc_hash_slot(lc, enr));