summaryrefslogtreecommitdiff
path: root/src/ceph_mon.cc
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2012-09-12 16:05:53 -0700
committerSage Weil <sage@inktank.com>2012-09-12 17:33:01 -0700
commitfa86f7aaa370fb41973f0c0e06a6c03721d29d5c (patch)
treeeb3986ea867c63fd2ae67fafb7465cad4a5a8f1a /src/ceph_mon.cc
parent4d333adff9c06ddbf6d465842b561c91b1097b23 (diff)
downloadceph-fa86f7aaa370fb41973f0c0e06a6c03721d29d5c.tar.gz
mon: move start-up feature check into static helper
Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'src/ceph_mon.cc')
-rw-r--r--src/ceph_mon.cc26
1 files changed, 3 insertions, 23 deletions
diff --git a/src/ceph_mon.cc b/src/ceph_mon.cc
index 2096a837090..851a6d1cf60 100644
--- a/src/ceph_mon.cc
+++ b/src/ceph_mon.cc
@@ -217,9 +217,6 @@ int main(int argc, const char **argv)
return 0;
}
- CompatSet mon_features = get_ceph_mon_feature_compat_set();
- CompatSet ondisk_features;
-
MonitorStore store(g_conf->mon_data);
err = store.mount();
if (err < 0) {
@@ -239,29 +236,12 @@ int main(int argc, const char **argv)
exit(1);
}
- bufferlist features;
- store.get_bl_ss(features, COMPAT_SET_LOC, 0);
- if (features.length() == 0) {
- cerr << "WARNING: mon fs missing feature list.\n"
- << "Assuming it is old-style and introducing one." << std::endl;
- //we only want the baseline ~v.18 features assumed to be on disk.
- //If new features are introduced this code needs to disappear or
- //be made smarter.
- ondisk_features = get_ceph_mon_feature_compat_set();
- } else {
- bufferlist::iterator it = features.begin();
- ondisk_features.decode(it);
- }
-
- if (!mon_features.writeable(ondisk_features)) {
- cerr << "monitor executable cannot read disk! Missing features: "
- << std::endl;
- CompatSet diff = mon_features.unsupported(ondisk_features);
- //NEEDS_COMPATSET_ITER
+ err = Monitor::check_features(&store);
+ if (err < 0) {
+ cerr << "error checking features: " << cpp_strerror(err) << std::endl;
exit(1);
}
-
// inject new monmap?
if (!inject_monmap.empty()) {
bufferlist bl;