From 3163b3457981e8969541ceba91f93e7735698ea7 Mon Sep 17 00:00:00 2001 From: Marek Vavrusa <marek@vavrusa.com> Date: Tue, 9 Aug 2016 20:30:59 -0700 Subject: [PATCH] lib/generic: fixed typo in lru code this caused a bug in pseudo-lru table that negated stickiness of values to table slots --- lib/generic/lru.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/generic/lru.h b/lib/generic/lru.h index 11abe016b..8622c96f7 100644 --- a/lib/generic/lru.h +++ b/lib/generic/lru.h @@ -166,7 +166,7 @@ static inline void *lru_slot_set(struct lru_hash_base *lru, const char *key, uin uint32_t id = hash(key, len) % lru->size; struct lru_slot *slot = lru_slot_at(lru, id); if (lru_slot_match(slot, key, len)) { - slot->refs = 1; /* Increase slot significance */ + slot->refs += 1; /* Increase slot significance */ } else { if (slot->key) { slot->refs -= 1; /* Decrease slot significance */ -- GitLab