On Fri, Jan 27, 2017 at 3:33 AM, liuchang0812 <liuchang0812@xxxxxxxxx> wrote: > Hi, Ming. > > PGQueueable class has a constructor as: `PGQueueable(OpRequestRef > op)`, which does not have `explicit`, so CPP compiler translates > OpRequestRef to PGQueueable in ` > osd->op_wq.queue(make_pair(PGRef(this), op));`, as ` > osd->op_wq.queue(make_pair(PGRef(this), PGQueueable(op)));` Hi Chang, Thanks for the explanation. I just verify it with below test code. class Foo { }; class Bar { public: Bar(Foo f) { cout << "Bar constructor called" << endl; } }; void test(Bar t) { } int main() { Foo f; test(f); return 0; } > > > > 2017-01-27 15:41 GMT+08:00 Ming Lin <minggr@xxxxxxxxx>: >> void PG::queue_op(OpRequestRef& op) >> { >> ... >> osd->op_wq.queue(make_pair(PGRef(this), op)); >> >> >> class OSDService { >> .... >> ShardedThreadPool::ShardedWQ < pair <PGRef, PGQueueable> > &op_wq; >> >> "op" is of type OpRequestRef, but op_wq second is of type PGQueueable >> >> How does this work? Is "PGQueueable" same as "OpRequestRef"? >> >> Thanks. >> -- >> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in >> the body of a message to majordomo@xxxxxxxxxxxxxxx >> More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html