]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ObjectCacher: remove max_bytes and max_ob arguments to trim()
authorJosh Durgin <josh.durgin@inktank.com>
Tue, 11 Feb 2014 18:35:14 +0000 (10:35 -0800)
committerJosh Durgin <josh.durgin@inktank.com>
Wed, 12 Feb 2014 18:10:26 +0000 (10:10 -0800)
These are never passed, so replace them with the defaults.

Backport: emperor, dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit bf8cf2d6d21a204a099347f3dcd5b48100b8c445)

src/osdc/ObjectCacher.cc
src/osdc/ObjectCacher.h

index 590b5d473a8dbda20cb74188aa03e05d7e39a630..8dc57cff22248853cf073140a2e6cb17779cc475 100644 (file)
@@ -944,19 +944,14 @@ void ObjectCacher::flush(loff_t amount)
 }
 
 
-void ObjectCacher::trim(loff_t max_bytes, loff_t max_ob)
+void ObjectCacher::trim()
 {
   assert(lock.is_locked());
-  if (max_bytes < 0) 
-    max_bytes = max_size;
-  if (max_ob < 0)
-    max_ob = max_objects;
-  
-  ldout(cct, 10) << "trim  start: bytes: max " << max_bytes << "  clean " << get_stat_clean()
-                << ", objects: max " << max_ob << " current " << ob_lru.lru_get_size()
+  ldout(cct, 10) << "trim  start: bytes: max " << max_size << "  clean " << get_stat_clean()
+                << ", objects: max " << max_objects << " current " << ob_lru.lru_get_size()
                 << dendl;
 
-  while (get_stat_clean() > max_bytes) {
+  while (get_stat_clean() > max_size) {
     BufferHead *bh = static_cast<BufferHead*>(bh_lru_rest.lru_expire());
     if (!bh)
       break;
@@ -974,7 +969,7 @@ void ObjectCacher::trim(loff_t max_bytes, loff_t max_ob)
     }
   }
 
-  while (ob_lru.lru_get_size() > max_ob) {
+  while (ob_lru.lru_get_size() > max_objects) {
     Object *ob = static_cast<Object*>(ob_lru.lru_expire());
     if (!ob)
       break;
@@ -983,8 +978,8 @@ void ObjectCacher::trim(loff_t max_bytes, loff_t max_ob)
     close_object(ob);
   }
   
-  ldout(cct, 10) << "trim finish:  max " << max_bytes << "  clean " << get_stat_clean()
-                << ", objects: max " << max_ob << " current " << ob_lru.lru_get_size()
+  ldout(cct, 10) << "trim finish:  max " << max_size << "  clean " << get_stat_clean()
+                << ", objects: max " << max_objects << " current " << ob_lru.lru_get_size()
                 << dendl;
 }
 
index 9b045db5da9485b1aaa85b1352b0a16c9d8304e0..6930fe96216193c4bcbee63317af809b424a203c 100644 (file)
@@ -434,7 +434,7 @@ class ObjectCacher {
   void bh_read(BufferHead *bh);
   void bh_write(BufferHead *bh);
 
-  void trim(loff_t max_bytes=-1, loff_t max_objects=-1);
+  void trim();
   void flush(loff_t amount=0);
 
   /**