From: Sage Weil Date: Tue, 18 Jun 2013 00:46:00 +0000 (-0700) Subject: mon/PaxosService: remove mkfs helpers X-Git-Tag: v0.67-rc1~175^2~25 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=83c49be3693d49256072c78d077c1b05ee067ec4;p=ceph.git mon/PaxosService: remove mkfs helpers Keep it simple. These are one-liners. Signed-off-by: Sage Weil --- diff --git a/src/mon/MonmapMonitor.cc b/src/mon/MonmapMonitor.cc index 10faf093327c..20b01bd9ccb0 100644 --- a/src/mon/MonmapMonitor.cc +++ b/src/mon/MonmapMonitor.cc @@ -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); } } diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 986bf3a821b8..ed3c7867666f 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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()) diff --git a/src/mon/PaxosService.h b/src/mon/PaxosService.h index 136bbf3e0ecc..059a46b878b9 100644 --- a/src/mon/PaxosService.h +++ b/src/mon/PaxosService.h @@ -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); - } - /** * @}