From: Loic Dachary Date: Fri, 6 Dec 2013 23:21:16 +0000 (+0100) Subject: crush: remove redundant code from move_bucket X-Git-Tag: v0.74~21^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e00324b2bca5bbbdc76182bc09bd15e1d0de930f;p=ceph.git crush: remove redundant code from move_bucket The following was introduced in 2012 by a2d0cff1b071bed84ac439e4fcf9ddfb936f89c8 // un-set the device name so we can use add_item later build_rmap(name_map, name_rmap); name_map.erase(id); name_rmap.erase(id_name); when insert_item refused to move a bucket for which a name already exists. It was changed in 2013 by 4e2557a038dc1e8c68993ad8571d74e2eb8ea90a and now supports it. The TestCrushWrapper unittest for move_bucket pass. Signed-off-by: Loic Dachary --- diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index a250d47fb64d..a46c80134aad 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -444,11 +444,6 @@ int CrushWrapper::move_bucket(CephContext *cct, int id, const map // detach the bucket int bucket_weight = detach_bucket(cct, id); - // un-set the device name so we can use add_item later - build_rmap(name_map, name_rmap); - name_map.erase(id); - name_rmap.erase(id_name); - // insert the bucket back into the hierarchy return insert_item(cct, id, bucket_weight / (float)0x10000, id_name, loc); }