From 1e7cd10d39aebea63683852e7a48094b94a8919e Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Thu, 20 Feb 2014 16:54:06 -0800 Subject: [PATCH] rgw: remove memory allocation Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_main.cc | 5 +++-- src/rgw/rgw_rados.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc index f1041096de553..2d7cb64f8b4a5 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 f6a810e0e1ebf..1defea32a9fbc 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); -- 2.39.5