]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: remove memory allocation
authorYehuda Sadeh <yehuda@inktank.com>
Fri, 21 Feb 2014 00:54:06 +0000 (16:54 -0800)
committerYehuda Sadeh <yehuda@inktank.com>
Fri, 21 Mar 2014 22:16:23 +0000 (15:16 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_main.cc
src/rgw/rgw_rados.h

index f1041096de553185eee9ed3dc00c1f3dea9938a7..2d7cb64f8b4a52ef8b1021848d519082b1e12750 100644 (file)
@@ -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;
 
index f6a810e0e1ebfd6f2f6aca775d1ac658fdd179aa..1defea32a9fbc49c1ecfa91cbea7a453ef7634b3 100644 (file)
@@ -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);