]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: remove unused ReplicatedBackend::objects_read_async()
authorKefu Chai <kchai@redhat.com>
Tue, 7 Nov 2017 06:14:13 +0000 (14:14 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 7 Nov 2017 06:24:15 +0000 (14:24 +0800)
async read is not used by replica pool at all.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/osd/PrimaryLogPG.cc
src/osd/ReplicatedBackend.cc

index 3ceee7cb48b34c7b492f4d5ee4a154a5bcad93ae..08e4ed102449d89914f4e8b718144613f19bc8ae 100644 (file)
@@ -3212,6 +3212,7 @@ void PrimaryLogPG::execute_ctx(OpContext *ctx)
   if (result == -EINPROGRESS || pending_async_reads) {
     // come back later.
     if (pending_async_reads) {
+      assert(pool.info.is_erasure());
       in_progress_async_reads.push_back(make_pair(op, ctx));
       ctx->start_async_reads(this);
     }
index 9c3a7344a6e65bd9035db1f219c4d78285515088..a0bdb0f22b31eb81d58db90937eee307036e5571 100644 (file)
@@ -269,18 +269,6 @@ int ReplicatedBackend::objects_read_sync(
   return store->read(ch, ghobject_t(hoid), off, len, *bl, op_flags);
 }
 
-struct AsyncReadCallback : public GenContext<ThreadPool::TPHandle&> {
-  int r;
-  Context *c;
-  AsyncReadCallback(int r, Context *c) : r(r), c(c) {}
-  void finish(ThreadPool::TPHandle&) override {
-    c->complete(r);
-    c = NULL;
-  }
-  ~AsyncReadCallback() override {
-    delete c;
-  }
-};
 void ReplicatedBackend::objects_read_async(
   const hobject_t &hoid,
   const list<pair<boost::tuple<uint64_t, uint64_t, uint32_t>,
@@ -288,29 +276,7 @@ void ReplicatedBackend::objects_read_async(
   Context *on_complete,
   bool fast_read)
 {
-  // There is no fast read implementation for replication backend yet
-  assert(!fast_read);
-
-  int r = 0;
-  for (list<pair<boost::tuple<uint64_t, uint64_t, uint32_t>,
-                pair<bufferlist*, Context*> > >::const_iterator i =
-          to_read.begin();
-       i != to_read.end() && r >= 0;
-       ++i) {
-    int _r = store->read(ch, ghobject_t(hoid), i->first.get<0>(),
-                        i->first.get<1>(), *(i->second.first),
-                        i->first.get<2>());
-    if (i->second.second) {
-      get_parent()->schedule_recovery_work(
-       get_parent()->bless_gencontext(
-         new AsyncReadCallback(_r, i->second.second)));
-    }
-    if (_r < 0)
-      r = _r;
-  }
-  get_parent()->schedule_recovery_work(
-    get_parent()->bless_gencontext(
-      new AsyncReadCallback(r, on_complete)));
+  assert(0 == "async read is not used by replica pool");
 }
 
 class C_OSD_OnOpCommit : public Context {