osd: update mClock.*Queue to incorporate the changes on dmclock

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2017-10-19 13:22:07 +08:00
parent 5e370e1299
commit 22aff9e87e
5 changed files with 18 additions and 18 deletions

View File

@ -58,24 +58,24 @@ namespace ceph {
} }
dmc::ClientInfo const dmc::ClientInfo*
mClockClientQueue::op_class_client_info_f( mClockClientQueue::op_class_client_info_f(
const mClockClientQueue::InnerClient& client) const mClockClientQueue::InnerClient& client)
{ {
switch(client.second) { switch(client.second) {
case osd_op_type_t::client_op: case osd_op_type_t::client_op:
return mclock_op_tags->client_op; return &mclock_op_tags->client_op;
case osd_op_type_t::osd_subop: case osd_op_type_t::osd_subop:
return mclock_op_tags->osd_subop; return &mclock_op_tags->osd_subop;
case osd_op_type_t::bg_snaptrim: case osd_op_type_t::bg_snaptrim:
return mclock_op_tags->snaptrim; return &mclock_op_tags->snaptrim;
case osd_op_type_t::bg_recovery: case osd_op_type_t::bg_recovery:
return mclock_op_tags->recov; return &mclock_op_tags->recov;
case osd_op_type_t::bg_scrub: case osd_op_type_t::bg_scrub:
return mclock_op_tags->scrub; return &mclock_op_tags->scrub;
default: default:
assert(0); assert(0);
return dmc::ClientInfo(-1, -1, -1); return nullptr;
} }
} }

View File

@ -62,7 +62,7 @@ namespace ceph {
mClockClientQueue(CephContext *cct); mClockClientQueue(CephContext *cct);
static crimson::dmclock::ClientInfo static const crimson::dmclock::ClientInfo*
op_class_client_info_f(const InnerClient& client); op_class_client_info_f(const InnerClient& client);
inline unsigned length() const override final { inline unsigned length() const override final {

View File

@ -58,22 +58,22 @@ namespace ceph {
} }
dmc::ClientInfo const dmc::ClientInfo*
mClockOpClassQueue::op_class_client_info_f(const osd_op_type_t& op_type) { mClockOpClassQueue::op_class_client_info_f(const osd_op_type_t& op_type) {
switch(op_type) { switch(op_type) {
case osd_op_type_t::client_op: case osd_op_type_t::client_op:
return mclock_op_tags->client_op; return &mclock_op_tags->client_op;
case osd_op_type_t::osd_subop: case osd_op_type_t::osd_subop:
return mclock_op_tags->osd_subop; return &mclock_op_tags->osd_subop;
case osd_op_type_t::bg_snaptrim: case osd_op_type_t::bg_snaptrim:
return mclock_op_tags->snaptrim; return &mclock_op_tags->snaptrim;
case osd_op_type_t::bg_recovery: case osd_op_type_t::bg_recovery:
return mclock_op_tags->recov; return &mclock_op_tags->recov;
case osd_op_type_t::bg_scrub: case osd_op_type_t::bg_scrub:
return mclock_op_tags->scrub; return &mclock_op_tags->scrub;
default: default:
assert(0); assert(0);
return dmc::ClientInfo(-1, -1, -1); return nullptr;
} }
} }

View File

@ -60,7 +60,7 @@ namespace ceph {
mClockOpClassQueue(CephContext *cct); mClockOpClassQueue(CephContext *cct);
static crimson::dmclock::ClientInfo static const crimson::dmclock::ClientInfo*
op_class_client_info_f(const osd_op_type_t& op_type); op_class_client_info_f(const osd_op_type_t& op_type);
inline unsigned length() const override final { inline unsigned length() const override final {

View File

@ -48,10 +48,10 @@ struct Client {
}; };
crimson::dmclock::ClientInfo client_info_func(const Client& c) { const crimson::dmclock::ClientInfo* client_info_func(const Client& c) {
static const crimson::dmclock::ClientInfo static const crimson::dmclock::ClientInfo
the_info(10.0, 10.0, 10.0); the_info(10.0, 10.0, 10.0);
return the_info; return &the_info;
} }