Lines Matching refs:enr
233 static struct hlist_head *lc_hash_slot(struct lru_cache *lc, unsigned int enr)
235 return lc->lc_slot + (enr % lc->nr_elements);
239 static struct lc_element *__lc_find(struct lru_cache *lc, unsigned int enr,
246 hlist_for_each_entry(e, lc_hash_slot(lc, enr), colision) {
250 if (e->lc_new_number != enr)
262 * @enr: element number
270 struct lc_element *lc_find(struct lru_cache *lc, unsigned int enr)
272 return __lc_find(lc, enr, 0);
278 * @enr: element number
285 bool lc_is_used(struct lru_cache *lc, unsigned int enr)
287 struct lc_element *e = __lc_find(lc, enr, 1);
297 * sets @e->enr to %LC_FREE.
351 static struct lc_element *__lc_get(struct lru_cache *lc, unsigned int enr, unsigned int flags)
361 e = __lc_find(lc, enr, 1);
363 * this enr is currently being pulled in already,
419 e = lc_prepare_for_change(lc, enr);
433 * @enr: the label to look up
470 struct lc_element *lc_get(struct lru_cache *lc, unsigned int enr)
472 return __lc_get(lc, enr, LC_GET_MAY_CHANGE);
478 * @enr: the label to look up
480 * Unlike lc_get this also returns the element for @enr, if it is belonging to
490 struct lc_element *lc_get_cumulative(struct lru_cache *lc, unsigned int enr)
492 return __lc_get(lc, enr, LC_GET_MAY_CHANGE|LC_GET_MAY_USE_UNCOMMITTED);
498 * @enr: the label to look up
511 struct lc_element *lc_try_get(struct lru_cache *lc, unsigned int enr)
513 return __lc_get(lc, enr, 0);