]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: eradicate dynamic memory allocations from RGWEnv.
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Mon, 1 Aug 2016 10:12:30 +0000 (12:12 +0200)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Fri, 21 Oct 2016 20:57:18 +0000 (22:57 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
src/rgw/rgw_common.cc
src/rgw/rgw_common.h
src/rgw/rgw_env.cc

index 50c3b90b7d3adb101c2acf41f9101b4a908fb0bc..9aa6f3c4d7d9264c4407aa8408f5b9c22b9efb92 100644 (file)
@@ -175,9 +175,9 @@ req_state::req_state(CephContext* _cct, RGWEnv* e, RGWUserInfo* u)
   : cct(_cct), cio(NULL), op(OP_UNKNOWN), user(u), has_acl_header(false),
     info(_cct, e)
 {
-  enable_ops_log = e->conf->enable_ops_log;
-  enable_usage_log = e->conf->enable_usage_log;
-  defer_to_bucket_acls = e->conf->defer_to_bucket_acls;
+  enable_ops_log = e->conf.enable_ops_log;
+  enable_usage_log = e->conf.enable_usage_log;
+  defer_to_bucket_acls = e->conf.defer_to_bucket_acls;
   content_started = false;
   format = 0;
   formatter = NULL;
index 75daeb49238b4660f81e5f6346d535f04fdd76cb..28e6396e0d7d0f33496d9eda9c26f1bc33da7aaa 100644 (file)
@@ -347,15 +347,29 @@ class RGWHTTPArgs
   }
 };
 
-class RGWConf;
+class RGWEnv;
+
+class RGWConf {
+  friend class RGWEnv;
+protected:
+  void init(CephContext *cct, RGWEnv* env);
+public:
+  RGWConf()
+    : enable_ops_log(1),
+      enable_usage_log(1),
+      defer_to_bucket_acls(0) {
+  }
+
+  int enable_ops_log;
+  int enable_usage_log;
+  uint8_t defer_to_bucket_acls;
+};
 
 class RGWEnv {
   std::map<string, string, ltstr_nocase> env_map;
 public:
-  RGWConf *conf; 
+  RGWConf conf;
 
-  RGWEnv();
-  ~RGWEnv();
   void init(CephContext *cct);
   void init(CephContext *cct, char **envp);
   void set(const boost::string_ref& name, const boost::string_ref& val);
@@ -371,19 +385,6 @@ public:
   std::map<string, string, ltstr_nocase>& get_map() { return env_map; }
 };
 
-class RGWConf {
-  friend class RGWEnv;
-protected:
-  void init(CephContext *cct, RGWEnv * env);
-public:
-  RGWConf() :
-    enable_ops_log(1), enable_usage_log(1), defer_to_bucket_acls(0) {}
-
-  int enable_ops_log;
-  int enable_usage_log;
-  uint8_t defer_to_bucket_acls;
-};
-
 enum http_op {
   OP_GET,
   OP_PUT,
index 505156d7d2b1b2ea63b8a37a3879ddb815bfb46c..56ac6b3e9a0d52e61750ce3a17776fd2cba8e71f 100644 (file)
@@ -9,19 +9,9 @@
 
 #define dout_subsys ceph_subsys_rgw
 
-RGWEnv::RGWEnv()
-{
-  conf = new RGWConf;
-}
-
-RGWEnv::~RGWEnv()
-{
-  delete conf;
-}
-
 void RGWEnv::init(CephContext *cct)
 {
-  conf->init(cct, this);
+  conf.init(cct, this);
 }
 
 void RGWEnv::set(const boost::string_ref& name, const boost::string_ref& val)