osd: remove unused ReplicatedBackend::objects_read_async()

async read is not used by replica pool at all.

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2017-11-07 14:14:13 +08:00
parent f265ed6b1c
commit 0cd7331358
2 changed files with 2 additions and 35 deletions

View 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);
}

View 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 {