]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: make OSD a config observer
authorSage Weil <sage@inktank.com>
Sun, 20 Jan 2013 02:28:35 +0000 (18:28 -0800)
committerSamuel Just <sam.just@inktank.com>
Sat, 26 Jan 2013 01:14:48 +0000 (17:14 -0800)
Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 9230c863b3dc2bdda12c23202682a84c48f070a1)

Conflicts:

src/osd/OSD.cc

src/osd/OSD.cc
src/osd/OSD.h

index f9c95d855521d4f8539e4bd71fa1891bd1c73336..ba8ac57fe6df5d3af2db23e67becc777fc4801f7 100644 (file)
@@ -841,6 +841,8 @@ int OSD::pre_init()
          << "currently in use. (Is ceph-osd already running?)" << dendl;
     return -EBUSY;
   }
+
+  g_conf->add_observer(this);
   return 0;
 }
 
@@ -1090,6 +1092,8 @@ void OSD::suicide(int exitcode)
 
 int OSD::shutdown()
 {
+  g_conf->remove_observer(this);
+
   service.shutdown();
   g_ceph_context->_conf->set_val("debug_osd", "100");
   g_ceph_context->_conf->set_val("debug_journal", "100");
@@ -6208,6 +6212,21 @@ void OSD::process_peering_events(const list<PG*> &pgs)
 
 // --------------------------------
 
+const char** OSD::get_tracked_conf_keys() const
+{
+  static const char* KEYS[] = {
+    NULL
+  };
+  return KEYS;
+}
+
+void OSD::handle_conf_change(const struct md_config_t *conf,
+                            const std::set <std::string> &changed)
+{
+}
+
+// --------------------------------
+
 int OSD::init_op_flags(MOSDOp *op)
 {
   vector<OSDOp>::iterator iter;
index 4a5c6e8db1b6e37d95848f20ac61b09d692deaa9..a315a1455d422d7b9cfbd1b57218571e7b477054 100644 (file)
@@ -394,8 +394,15 @@ public:
 
   OSDService(OSD *osd);
 };
-class OSD : public Dispatcher {
+class OSD : public Dispatcher,
+           public md_config_obs_t {
   /** OSD **/
+public:
+  // config observer bits
+  virtual const char** get_tracked_conf_keys() const;
+  virtual void handle_conf_change(const struct md_config_t *conf,
+                                 const std::set <std::string> &changed);
+
 protected:
   Mutex osd_lock;                      // global lock
   SafeTimer timer;    // safe timer (osd_lock)