From: Josh Durgin Date: Tue, 11 Feb 2014 18:35:14 +0000 (-0800) Subject: ObjectCacher: remove max_bytes and max_ob arguments to trim() X-Git-Tag: v0.78~193^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bf8cf2d6d21a204a099347f3dcd5b48100b8c445;p=ceph.git ObjectCacher: remove max_bytes and max_ob arguments to trim() These are never passed, so replace them with the defaults. Backport: emperor, dumpling Signed-off-by: Josh Durgin --- diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc index 6160d7005f13..7273a3d0767e 100644 --- a/src/osdc/ObjectCacher.cc +++ b/src/osdc/ObjectCacher.cc @@ -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(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(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; } diff --git a/src/osdc/ObjectCacher.h b/src/osdc/ObjectCacher.h index d7ba9d8a50b3..aacafded6bfe 100644 --- a/src/osdc/ObjectCacher.h +++ b/src/osdc/ObjectCacher.h @@ -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); /**