]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PaxosService: remove mkfs helpers
authorSage Weil <sage@inktank.com>
Tue, 18 Jun 2013 00:46:00 +0000 (17:46 -0700)
committerSage Weil <sage@inktank.com>
Tue, 25 Jun 2013 04:07:25 +0000 (21:07 -0700)
Keep it simple.  These are one-liners.

Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/MonmapMonitor.cc
src/mon/OSDMonitor.cc
src/mon/PaxosService.h

index 10faf093327cbc9343c9f0bb8ac79ee6d694c92d..20b01bd9ccb0c6213aee51f86f3c0c26ae28c05a 100644 (file)
@@ -70,9 +70,9 @@ void MonmapMonitor::update_from_paxos(bool *need_bootstrap)
   dout(10) << "update_from_paxos got " << version << dendl;
   mon->monmap->decode(monmap_bl);
 
-  if (mon->store->exists("mkfs", get_service_name())) {
+  if (mon->store->exists("mkfs", "monmap")) {
     MonitorDBStore::Transaction t;
-    erase_mkfs(&t);
+    t.erase("mkfs", "monmap");
     mon->store->apply_transaction(t);
   }
 }
index 986bf3a821b853fd61f39b7eb93092736aad472f..ed3c7867666f9b246545c87d3fa8138f6a3d92c3 100644 (file)
@@ -89,8 +89,8 @@ void OSDMonitor::create_initial()
   OSDMap newmap;
 
   bufferlist bl;
+  mon->store->get("mkfs", "osdmap", bl);
 
-  get_mkfs(bl);
   if (bl.length()) {
     newmap.decode(bl);
     newmap.set_fsid(mon->monmap->fsid);
@@ -159,7 +159,7 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap)
     dout(1) << osdmap << dendl;
 
     if (osdmap.epoch == 1) {
-      erase_mkfs(&t);
+      t.erase("mkfs", "osdmap");
     }
   }
   if (!t.empty())
index 136bbf3e0eccaf8ffda50d9bdbc17b9d5a770fd8..059a46b878b92f94964489092b30678232e4460b 100644 (file)
@@ -196,7 +196,6 @@ public:
       last_committed_name("last_committed"),
       first_committed_name("first_committed"),
       last_accepted_name("last_accepted"),
-      mkfs_name("mkfs"),
       full_version_name("full"), full_latest_name("latest"),
       cached_first_committed(0), cached_last_committed(0)
   {
@@ -467,7 +466,6 @@ public:
   const string last_committed_name;
   const string first_committed_name;
   const string last_accepted_name;
-  const string mkfs_name;
   const string full_version_name;
   const string full_latest_name;
   /**
@@ -863,14 +861,7 @@ public:
     string key = mon->store->combine_strings(prefix, name);
     t->put(get_service_name(), key, bl);
   }
-  /**
-   * Remove our mkfs entry from the store
-   *
-   * @param t A transaction to which we will add this erase operation
-   */
-  void erase_mkfs(MonitorDBStore::Transaction *t) {
-    t->erase(mkfs_name, get_service_name());
-  }
+
   /**
    * @}
    */
@@ -983,16 +974,6 @@ public:
   version_t get_value(const string& key) {
     return mon->store->get(get_service_name(), key);
   }
-  /**
-   * Get the contents of our mkfs entry
-   *
-   * @param bl A bufferlist to populate with the contents of the entry
-   * @return 0 on success; <0 otherwise
-   */
-  int get_mkfs(bufferlist& bl) {
-    return mon->store->get(mkfs_name, get_service_name(), bl);
-  }
-
 
   /**
    * @}