]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common: Fixes issue with lru_clear() + add new test
authorSahid Orentino Ferdjaoui <sahid.ferdjaoui@cloudwatt.com>
Wed, 11 Jun 2014 13:37:45 +0000 (15:37 +0200)
committerSahid Orentino Ferdjaoui <sahid.ferdjaoui@cloudwatt.com>
Mon, 16 Jun 2014 13:54:53 +0000 (15:54 +0200)
commitd48ed68a709d17b9e48467a7a0117c6ead05411a
tree6a3503d2cebaf2e76d261167548cab514c95e156
parent62aa5c5c963584a37802421ef66da444c135f64f
common: Fixes issue with lru_clear() + add new test

The method lru_clear() must set attribute lru_num to zero
after lru_top, lru_bot and lru_mid are reseted. indeed, lru_num
is the total number of elements found in all of them.

Also the test insures the good behavior of the method
lru_adjust() - lru_touch() calls lru_adjust every time
to balance lru_top and lru_bot by the value of lru_midpoint.

Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@cloudwatt.com>
src/include/lru.h
src/test/common/test_lru.cc