From: Yehuda Sadeh Date: Fri, 21 Feb 2014 00:54:06 +0000 (-0800) Subject: rgw: remove memory allocation X-Git-Tag: v0.79~105^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1e7cd10d39aebea63683852e7a48094b94a8919e;p=ceph.git rgw: remove memory allocation Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc index f1041096de55..2d7cb64f8b4a 100644 --- a/src/rgw/rgw_main.cc +++ b/src/rgw/rgw_main.cc @@ -517,7 +517,9 @@ static int process_request(RGWRados *store, RGWREST *rest, RGWRequest *req, RGWC RGWEnv& rgw_env = client_io->get_env(); struct req_state *s = req->init_state(g_ceph_context, &rgw_env); - s->obj_ctx = store->create_context(s); + + RGWRadosCtx rados_ctx(store, s); + s->obj_ctx = &rados_ctx; store->set_intent_cb(s->obj_ctx, call_log_intent); s->req_id = store->unique_id(req->id); @@ -616,7 +618,6 @@ done: if (handler) handler->put_op(op); rest->put_handler(handler); - store->destroy_context(s->obj_ctx); dout(1) << "====== req done req=" << hex << req << dec << " http_status=" << http_ret << " ======" << dendl; diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index f6a810e0e1eb..1defea32a9fb 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -702,6 +702,7 @@ struct RGWRadosCtx { void *user_ctx; RGWRadosCtx(RGWRados *_store) : store(_store), intent_cb(NULL), user_ctx(NULL) { } + RGWRadosCtx(RGWRados *_store, void *_user_ctx) : store(_store), intent_cb(NULL), user_ctx(_user_ctx) { } RGWObjState *get_state(rgw_obj& obj); void set_atomic(rgw_obj& obj);