Lines Matching refs:e
39 #define PARANOIA_LC_ELEMENT(lc, e) do { \ argument
41 struct lc_element *e_ = (e); \
84 struct lc_element *e; in lc_create() local
128 e = p + e_off; in lc_create()
129 e->lc_index = i; in lc_create()
130 e->lc_number = LC_FREE; in lc_create()
131 e->lc_new_number = LC_FREE; in lc_create()
132 list_add(&e->list, &lc->free); in lc_create()
133 element[i] = e; in lc_create()
202 struct lc_element *e = lc->lc_element[i]; in lc_reset() local
203 void *p = e; in lc_reset()
207 e->lc_index = i; in lc_reset()
208 e->lc_number = LC_FREE; in lc_reset()
209 e->lc_new_number = LC_FREE; in lc_reset()
210 list_add(&e->list, &lc->free); in lc_reset()
242 struct lc_element *e; in __lc_find() local
246 hlist_for_each_entry(e, lc_hash_slot(lc, enr), colision) { in __lc_find()
250 if (e->lc_new_number != enr) in __lc_find()
252 if (e->lc_new_number == e->lc_number || include_changing) in __lc_find()
253 return e; in __lc_find()
287 struct lc_element *e = __lc_find(lc, enr, 1); in lc_is_used() local
288 return e && e->refcnt; in lc_is_used()
299 void lc_del(struct lru_cache *lc, struct lc_element *e) in lc_del() argument
302 PARANOIA_LC_ELEMENT(lc, e); in lc_del()
303 BUG_ON(e->refcnt); in lc_del()
305 e->lc_number = e->lc_new_number = LC_FREE; in lc_del()
306 hlist_del_init(&e->colision); in lc_del()
307 list_move(&e->list, &lc->free); in lc_del()
314 struct lc_element *e; in lc_prepare_for_change() local
323 e = list_entry(n, struct lc_element, list); in lc_prepare_for_change()
324 PARANOIA_LC_ELEMENT(lc, e); in lc_prepare_for_change()
326 e->lc_new_number = new_number; in lc_prepare_for_change()
327 if (!hlist_unhashed(&e->colision)) in lc_prepare_for_change()
328 __hlist_del(&e->colision); in lc_prepare_for_change()
329 hlist_add_head(&e->colision, lc_hash_slot(lc, new_number)); in lc_prepare_for_change()
330 list_move(&e->list, &lc->to_be_changed); in lc_prepare_for_change()
332 return e; in lc_prepare_for_change()
353 struct lc_element *e; in __lc_get() local
361 e = __lc_find(lc, enr, 1); in __lc_get()
366 if (e) { in __lc_get()
367 if (e->lc_new_number != e->lc_number) { in __lc_get()
376 ++e->refcnt; in __lc_get()
378 RETURN(e); in __lc_get()
382 if (e->refcnt++ == 0) in __lc_get()
384 list_move(&e->list, &lc->in_use); /* Not evictable... */ in __lc_get()
385 RETURN(e); in __lc_get()
419 e = lc_prepare_for_change(lc, enr); in __lc_get()
420 BUG_ON(!e); in __lc_get()
423 BUG_ON(++e->refcnt != 1); in __lc_get()
427 RETURN(e); in __lc_get()
526 struct lc_element *e, *tmp; in lc_committed() local
529 list_for_each_entry_safe(e, tmp, &lc->to_be_changed, list) { in lc_committed()
532 e->lc_number = e->lc_new_number; in lc_committed()
533 list_move(&e->list, &lc->in_use); in lc_committed()
549 unsigned int lc_put(struct lru_cache *lc, struct lc_element *e) in lc_put() argument
552 PARANOIA_LC_ELEMENT(lc, e); in lc_put()
553 BUG_ON(e->refcnt == 0); in lc_put()
554 BUG_ON(e->lc_number != e->lc_new_number); in lc_put()
555 if (--e->refcnt == 0) { in lc_put()
557 list_move(&e->list, &lc->lru); in lc_put()
561 RETURN(e->refcnt); in lc_put()
590 struct lc_element *e; in lc_seq_dump_details() local
595 e = lc_element_by_index(lc, i); in lc_seq_dump_details()
596 if (e->lc_number != e->lc_new_number) in lc_seq_dump_details()
598 i, e->lc_number, e->lc_new_number, e->refcnt); in lc_seq_dump_details()
601 i, e->lc_number, "-\"-", e->refcnt); in lc_seq_dump_details()
603 detail(seq, e); in lc_seq_dump_details()