diff options
author | Sage Weil <sage@inktank.com> | 2012-11-26 16:00:43 -0800 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2012-11-26 21:14:35 -0800 |
commit | 3e988d45c07b9061d5834567bfafc86ec286089a (patch) | |
tree | b5d69b6168ebc2ee6621ccf87b4f8771969d8dc3 | |
parent | a41dde3de508cc13ae9253d60ec3b253ec1f2fb6 (diff) | |
download | ceph-3e988d45c07b9061d5834567bfafc86ec286089a.tar.gz |
osdc/ObjectCacher: touch Objects in lru
Touch the object when we touch one of it's bh's, and when we touch it
during readx (possibly because it is negative).
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | src/osdc/ObjectCacher.cc | 1 | ||||
-rw-r--r-- | src/osdc/ObjectCacher.h | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc index 807a35e4fb6..7b776594225 100644 --- a/src/osdc/ObjectCacher.cc +++ b/src/osdc/ObjectCacher.cc @@ -977,6 +977,7 @@ int ObjectCacher::_readx(OSDRead *rd, ObjectSet *oset, Context *onfinish, // get Object cache sobject_t soid(ex_it->oid, rd->snap); Object *o = get_object(soid, oset, ex_it->oloc); + touch_ob(o); // does not exist and no hits? if (oset->return_enoent && !o->exists) { diff --git a/src/osdc/ObjectCacher.h b/src/osdc/ObjectCacher.h index 1e7293bb189..0daa9797226 100644 --- a/src/osdc/ObjectCacher.h +++ b/src/osdc/ObjectCacher.h @@ -389,6 +389,10 @@ class ObjectCacher { bh_lru_dirty.lru_touch(bh); else bh_lru_rest.lru_touch(bh); + touch_ob(bh->ob); + } + void touch_ob(Object *ob) { + ob_lru.lru_touch(ob); } // bh states |