mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
librgw: pre-assign req->op (as self), avoid dynamic_cast
It would be nice to have some compile-type assistance w/the dual RGWOp & RGWLibRequest boilerplate. Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
This commit is contained in:
parent
f4994c84b1
commit
7e8ecc58ac
@ -393,8 +393,9 @@ int process_request(RGWRados* store, RGWREST* rest, RGWRequest* base_req,
|
||||
|
||||
req->log_format(s, "initializing for trans_id = %s", s->trans_id.c_str());
|
||||
|
||||
RGWOp *op = dynamic_cast<RGWOp*>(req);
|
||||
req->op = op; // XXX but we can do this in the ctor!
|
||||
/* XXX the following works, but we shouldn't need to pay for a
|
||||
* dynamic cast */
|
||||
RGWOp *op = reinterpret_cast<RGWOp*>(req); // req->op is already correct
|
||||
|
||||
bool should_log = true;
|
||||
|
||||
|
@ -299,7 +299,8 @@ public:
|
||||
RGWListBucketsRequest(uint64_t _req_id,
|
||||
rgw_readdir_cb _rcb, void* _cb_arg, uint64_t _offset)
|
||||
: RGWLibRequest(_req_id), offset(_offset), cb_arg(_cb_arg), rcb(_rcb) {
|
||||
// nothing
|
||||
// req->op = op
|
||||
op = this;
|
||||
}
|
||||
|
||||
int operator()(const std::string& name, const std::string& marker) {
|
||||
|
Loading…
Reference in New Issue
Block a user