]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "Enforce cache size on read requests"
authorJason Dillaman <dillaman@redhat.com>
Mon, 19 Jan 2015 17:46:00 +0000 (12:46 -0500)
committerJason Dillaman <dillaman@redhat.com>
Mon, 19 Jan 2015 17:46:00 +0000 (12:46 -0500)
This reverts commit b7784dc1baa47560a733fe9dcd2acec51bc93165.

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

index e804674ffe28572db0164fd9c01d2cdb800a9fff..e1499b4148541329c439b309b2fa04ddd438698d 100644 (file)
@@ -764,9 +764,6 @@ void ObjectCacher::bh_read_finish(int64_t poolid, sobject_t oid, ceph_tid_t tid,
       loff_t oldpos = opos;
       opos = bh->end();
 
-      ls.splice(ls.end(), waitfor_read);
-      waitfor_read.clear();
-
       if (r == -ENOENT) {
        if (trust_enoent) {
          ldout(cct, 10) << "bh_read_finish removing " << *bh << dendl;
@@ -1114,26 +1111,13 @@ int ObjectCacher::_readx(OSDRead *rd, ObjectSet *oset, Context *onfinish,
       for (map<loff_t, BufferHead*>::iterator bh_it = missing.begin();
            bh_it != missing.end();
            ++bh_it) {
-        loff_t clean = get_stat_clean() + get_stat_rx() +
-                       bh_it->second->length();
-        if (get_stat_rx() > 0 && static_cast<uint64_t>(clean) > max_size) {
-          // cache is full -- wait for rx's to complete
-          ldout(cct, 10) << "readx missed, waiting on cache to free "
-                         << (clean - max_size) << " bytes" << dendl;
-          if (success) {
-            waitfor_read.push_back(new C_RetryRead(this, rd, oset, onfinish));
-          }
-          bh_remove(o, bh_it->second);
-          delete bh_it->second;
-        } else {
-          bh_read(bh_it->second);
-          if (success && onfinish) {
-            ldout(cct, 10) << "readx missed, waiting on " << *bh_it->second 
-                     << " off " << bh_it->first << dendl;
-           bh_it->second->waitfor_read[bh_it->first].push_back( new C_RetryRead(this, rd, oset, onfinish) );
-          }
-          bytes_not_in_cache += bh_it->second->length();
+        bh_read(bh_it->second);
+        if (success && onfinish) {
+          ldout(cct, 10) << "readx missed, waiting on " << *bh_it->second 
+                   << " off " << bh_it->first << dendl;
+         bh_it->second->waitfor_read[bh_it->first].push_back( new C_RetryRead(this, rd, oset, onfinish) );
         }
+        bytes_not_in_cache += bh_it->second->length();
        success = false;
       }
 
index 5b93998456ab0e0407ab30854b5ebb053f6baac2..d2aebe984cdf4865590eabf8143e7c7487c45a94 100644 (file)
@@ -340,7 +340,6 @@ class ObjectCacher {
   void *flush_set_callback_arg;
 
   vector<ceph::unordered_map<sobject_t, Object*> > objects; // indexed by pool_id
-  list<Context*> waitfor_read;
 
   ceph_tid_t last_read_tid;