]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
include: cleanup lru con/des
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 17 Jun 2020 18:55:11 +0000 (11:55 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 17 Jun 2020 18:55:11 +0000 (11:55 -0700)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/include/lru.h

index 1e30cdfe8ca22be394831f4b30f1ad12ae2f7b6c..3f5069ee3ed31f7ddf34e473c3efdf3f961a1999 100644 (file)
@@ -25,8 +25,8 @@
 
 class LRUObject {
 public:
-  LRUObject() : lru(), lru_link(this), lru_pinned(false) { }
-  ~LRUObject();
+  LRUObject() : lru_link(this) {}
+  virtual ~LRUObject();
 
   // pin/unpin item in cache
   void lru_pin();
@@ -35,15 +35,13 @@ public:
 
   friend class LRU;
 private:
-  class LRU *lru;
+  class LRU *lru{};
   xlist<LRUObject *>::item lru_link;
-  bool lru_pinned;
+  bool lru_pinned = false;
 };
 
 class LRU {
 public:
-  LRU() : num_pinned(0), midpoint(0.6) {}
-
   uint64_t lru_get_size() const { return lru_get_top()+lru_get_bot()+lru_get_pintail(); }
   uint64_t lru_get_top() const { return top.size(); }
   uint64_t lru_get_bot() const{ return bottom.size(); }
@@ -206,12 +204,12 @@ protected:
     }
   }
 
-  uint64_t num_pinned;
-  double midpoint;
+  uint64_t num_pinned = 0;
+  double midpoint = 0.6;
 
   friend class LRUObject;
 private:
-  typedef xlist<LRUObject *> LRUList;
+  using LRUList = xlist<LRUObject*>;
   LRUList top, bottom, pintail;
 };