From dce22e308ff94112594e69da3f7aced9b005d8f4 Mon Sep 17 00:00:00 2001 From: Changcheng Liu Date: Wed, 26 Aug 2020 09:52:57 +0800 Subject: [PATCH] osd/OSDMap: no need to give same locations per time to create bucket Suggested-by: Kefu Chai Signed-off-by: Changcheng Liu --- src/osd/OSDMap.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index f54f00baa64bf..f7a70aaefd963 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -4234,11 +4234,12 @@ int OSDMap::build_simple_crush_map(CephContext *cct, CrushWrapper& crush, ceph_assert(r == 0); crush.set_item_name(rootid, "default"); + map loc{ + {"host", "localhost"}, + {"rack", "localrack"}, + {"root", "default"} + }; for (int o=0; o loc; - loc["host"] = "localhost"; - loc["rack"] = "localrack"; - loc["root"] = "default"; ldout(cct, 10) << " adding osd." << o << " at " << loc << dendl; char name[32]; snprintf(name, sizeof(name), "osd.%d", o); -- 2.39.5