]> git-server-git.apps.pok.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>
Tue, 11 Feb 2014 20:06:10 +0000 (12:06 -0800)
These are never passed, so replace them with the defaults.

Backport: emperor, dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
src/osdc/ObjectCacher.cc
src/osdc/ObjectCacher.h

index 6160d7005f13b0330d88b99107662f82692bf9bf..7273a3d0767e3d25efb3b647370a2a6b672fe6e2 100644 (file)
@@ -946,19 +946,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;
@@ -976,7 +971,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;
@@ -985,8 +980,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 d7ba9d8a50b37d687424166fecffd5a99da6322f..aacafded6bfe7c16c3b75e8eac4ffeade61d4d29 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);
 
   /**