summaryrefslogtreecommitdiff
path: root/src/osd/OSD.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/OSD.cc')
-rw-r--r--src/osd/OSD.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc
index a93545d4437..1e91d5a2096 100644
--- a/src/osd/OSD.cc
+++ b/src/osd/OSD.cc
@@ -129,7 +129,9 @@ static ostream& _prefix(std::ostream* _dout, int whoami, OSDMapRef osdmap) {
const coll_t coll_t::META_COLL("meta");
-static CompatSet get_osd_compat_set() {
+//Initial features in new superblock.
+//Features here are also automatically upgraded
+CompatSet OSD::get_osd_initial_compat_set() {
CompatSet::FeatureSet ceph_osd_feature_compat;
CompatSet::FeatureSet ceph_osd_feature_ro_compat;
CompatSet::FeatureSet ceph_osd_feature_incompat;
@@ -147,6 +149,13 @@ static CompatSet get_osd_compat_set() {
ceph_osd_feature_incompat);
}
+//Features are added here that this OSD supports.
+CompatSet OSD::get_osd_compat_set() {
+ CompatSet compat = get_osd_initial_compat_set();
+ //Any features here can be set in code, but not in initial superblock
+ return compat;
+}
+
OSDService::OSDService(OSD *osd) :
osd(osd),
whoami(osd->whoami), store(osd->store), clog(osd->clog),
@@ -611,7 +620,7 @@ int OSD::mkfs(const std::string &dev, const std::string &jdev, uuid_d fsid, int
sb.cluster_fsid = fsid;
sb.osd_fsid = store->get_fsid();
sb.whoami = whoami;
- sb.compat_features = get_osd_compat_set();
+ sb.compat_features = get_osd_initial_compat_set();
// benchmark?
if (g_conf->osd_auto_weight) {
@@ -1080,11 +1089,12 @@ int OSD::init()
return r;
}
- if (osd_compat.compare(superblock.compat_features) != 0) {
+ CompatSet initial = get_osd_initial_compat_set();
+ if (initial.compare(superblock.compat_features) != 0) {
// We need to persist the new compat_set before we
// do anything else
dout(5) << "Upgrading superblock compat_set" << dendl;
- superblock.compat_features = osd_compat;
+ superblock.compat_features = initial;
ObjectStore::Transaction t;
write_superblock(t);
r = store->apply_transaction(t);