From: Loic Dachary Date: Mon, 16 Jun 2014 19:41:00 +0000 (+0200) Subject: Revert "erasure-code: create default profile if necessary" X-Git-Tag: v0.83~87^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0bb0095b5f193d3ea8a384cbb3e557309aa6f534;p=ceph.git Revert "erasure-code: create default profile if necessary" This reverts commit 360de6adf24ef9a1287d169416d5e9bbb72afbec. Conflicts: src/mon/OSDMonitor.cc --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 88572c9cc0b..46e47cb223d 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -4184,23 +4184,8 @@ bool OSDMonitor::prepare_command_impl(MMonCommand *m, cmd_getval(g_ceph_context, cmdmap, "name", name); string profile; cmd_getval(g_ceph_context, cmdmap, "profile", profile); - if (profile == "") { + if (profile == "") profile = "default"; - if (!osdmap.has_erasure_code_profile(profile)) { - if (pending_inc.has_erasure_code_profile(profile)) - goto wait; - - map profile_map; - err = osdmap.get_erasure_code_profile_default(g_ceph_context, - profile_map, - &ss); - if (err) - goto reply; - dout(20) << "erasure code profile " << name << " set" << dendl; - pending_inc.set_erasure_code_profile(profile, profile_map); - goto wait; - } - } int ruleset; err = crush_ruleset_create_erasure(name, profile, &ruleset, ss); diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 79759d7d4c0..8d2a346fb64 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -2562,25 +2562,13 @@ int OSDMap::build_simple(CephContext *cct, epoch_t e, uuid_d &fsid, set_weight(i, CEPH_OSD_OUT); } - map profile_map; - r = get_erasure_code_profile_default(cct, profile_map, &ss); - if (r < 0) { - lderr(cct) << ss.str() << dendl; - return r; - } - set_erasure_code_profile("default", profile_map); - return 0; -} - -int OSDMap::get_erasure_code_profile_default(CephContext *cct, - map &profile_map, - ostream *ss) -{ - int r = get_str_map(cct->_conf->osd_pool_default_erasure_code_profile, - *ss, - &profile_map); - profile_map["directory"] = + map erasure_code_profile_map; + r = get_str_map(cct->_conf->osd_pool_default_erasure_code_profile, + ss, + &erasure_code_profile_map); + erasure_code_profile_map["directory"] = cct->_conf->osd_pool_default_erasure_code_directory; + set_erasure_code_profile("default", erasure_code_profile_map); return r; } diff --git a/src/osd/OSDMap.h b/src/osd/OSDMap.h index 42441d1490e..e3ac29a1107 100644 --- a/src/osd/OSDMap.h +++ b/src/osd/OSDMap.h @@ -381,9 +381,6 @@ public: erasure_code_profiles.find(name); return i != erasure_code_profiles.end(); } - int get_erasure_code_profile_default(CephContext *cct, - map &profile_map, - ostream *ss); void set_erasure_code_profile(const string &name, const map &profile) { erasure_code_profiles[name] = profile; @@ -793,8 +790,6 @@ public: */ int build_simple(CephContext *cct, epoch_t e, uuid_d &fsid, int num_osd, int pg_bits, int pgp_bits); - int set_erasure_code_profile_default(CephContext *cct); - static int _build_crush_types(CrushWrapper& crush); static int build_simple_crush_map(CephContext *cct, CrushWrapper& crush, int num_osd, ostream *ss);