]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
fix lru midpoint calculation
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Tue, 4 Sep 2007 05:56:17 +0000 (05:56 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Tue, 4 Sep 2007 05:56:17 +0000 (05:56 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1780 29311d96-e01e-0410-9327-a35deaab8ce9

trunk/ceph/include/lru.h

index 7e00a0e0b51460214176d0b4558513c5fed5bfab..27edff8fdc00c7fb2d5523c8aa1f349aa5d6e5e8 100644 (file)
@@ -207,7 +207,7 @@ class LRU {
     if (!lru_max) return;
 
     unsigned toplen = lru_top.get_length();
-    unsigned topwant = (unsigned)(lru_midpoint * (double)lru_max);
+    unsigned topwant = (unsigned)(lru_midpoint * ((double)lru_max - lru_num_pinned));
     while (toplen > 0 && 
            toplen > topwant) {
       // remove from tail of top, stick at head of bot