]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client, librados, osdc: do not shadow Dispatcher::cct 3196/head
authorKefu Chai <tchaikov@gmail.com>
Wed, 17 Dec 2014 12:58:09 +0000 (20:58 +0800)
committerKefu Chai <tchaikov@gmail.com>
Wed, 17 Dec 2014 18:51:13 +0000 (02:51 +0800)
* there is no need to have another cct as Dispatch has one already.
* by `using` the parent member variable in `public`, we expose `cct`
  as part of the interface. so that `cct` can be accessed from
  outside the class.
* and in Objecter, the ctor is initiating its parent class using the
  uninitialized member variable cct. better off fixing this.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/client/Client.cc
src/client/Client.h
src/librados/RadosClient.cc
src/librados/RadosClient.h
src/osdc/Objecter.h

index 1a758470ff74e17cf2f198dca652e3c3dadd0c7f..ce36acb795de36813cbe26108dcf9497d40837ba 100644 (file)
@@ -152,7 +152,6 @@ dir_result_t::dir_result_t(Inode *in)
 
 Client::Client(Messenger *m, MonClient *mc)
   : Dispatcher(m->cct),
-    cct(m->cct),
     logger(NULL),
     m_command_hook(this),
     timer(m->cct, client_lock),
index 7b23b6fb0b6d7ace767b45f96e06f8454afe73e7..dfc23f6f111c5ef5f848137f2c7743fd1261dff6 100644 (file)
@@ -208,7 +208,7 @@ struct dir_result_t {
 
 class Client : public Dispatcher {
  public:
-  CephContext *cct;
+  using Dispatcher::cct;
 
   PerfCounters *logger;
 
index cce899a9866fd908b9cb0c93bf40326eb30dfa1a..a81e1f40e4ec4aa2b6dd71d3ef9bf893901fbb6a 100644 (file)
@@ -65,8 +65,7 @@ bool librados::RadosClient::ms_get_authorizer(int dest_type,
 }
 
 librados::RadosClient::RadosClient(CephContext *cct_)
-  : Dispatcher(cct_),
-    cct(cct_->get()),
+  : Dispatcher(cct_->get()),
     conf(cct_->_conf),
     state(DISCONNECTED),
     monclient(cct_),
index b3aa1e168d8061511a4a717953eda4f0e2dc2bc1..7e1c24e5aecc567909cae4ce290f7471c2073417 100644 (file)
@@ -36,7 +36,7 @@ class Messenger;
 class librados::RadosClient : public Dispatcher
 {
 public:
-  CephContext *cct;
+  using Dispatcher::cct;
   md_config_t *conf;
 private:
   enum {
index c21cd87a1eb465628c51b2c5bbc5e3b913cd8184..e502a920041162301b967efef9eb132cb049a563 100644 (file)
@@ -1007,7 +1007,7 @@ public:
 private:
   OSDMap    *osdmap;
 public:
-  CephContext *cct;
+  using Dispatcher::cct;
   std::multimap<string,string> crush_location;
 
   atomic_t initialized;
@@ -1778,10 +1778,9 @@ public:
           Finisher *fin,
           double mon_timeout,
           double osd_timeout) :
-    Dispatcher(cct),
+    Dispatcher(cct_),
     messenger(m), monc(mc), finisher(fin),
     osdmap(new OSDMap),
-    cct(cct_),
     initialized(0),
     last_tid(0), client_inc(-1), max_linger_id(0),
     num_unacked(0), num_uncommitted(0),