From 0cd73313581e1ba7af5691ed78d0c4cdc6bd16da Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 7 Nov 2017 14:14:13 +0800 Subject: [PATCH] osd: remove unused ReplicatedBackend::objects_read_async() async read is not used by replica pool at all. Signed-off-by: Kefu Chai --- src/osd/PrimaryLogPG.cc | 1 + src/osd/ReplicatedBackend.cc | 36 +----------------------------------- 2 files changed, 2 insertions(+), 35 deletions(-) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 3ceee7cb48b..08e4ed10244 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -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); } diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index 9c3a7344a6e..a0bdb0f22b3 100644 --- a/src/osd/ReplicatedBackend.cc +++ b/src/osd/ReplicatedBackend.cc @@ -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 { - 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, @@ -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 > >::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 {