osd: allow BlessedContexts to finish synchronously

If bluestore chooses to it may try to call sync_finish() from the queueing
call chain (instead of finish() from a Finisher).  Allow it for several
Contexts in PG and PrimaryLogPG, including those used for the main IO
path.

We assume here that all Contexts that we bless can complete synchronously
by calling their normal finish() method.

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2017-10-06 10:26:18 -05:00
parent df1c7308c9
commit 4df1645ee5

View File

@ -141,6 +141,11 @@ public:
c.release()->complete(t);
pg->unlock();
}
bool sync_finish(T t) {
// we assume here all blessed/wrapped Contexts can complete synchronously.
c.release()->complete(t);
return true;
}
};
GenContext<ThreadPool::TPHandle&> *PrimaryLogPG::bless_gencontext(
@ -164,6 +169,11 @@ public:
c.release()->complete(r);
pg->unlock();
}
bool sync_finish(int r) {
// we assume here all blessed/wrapped Contexts can complete synchronously.
c.release()->complete(r);
return true;
}
};