]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: remove redundant code from move_bucket
authorLoic Dachary <loic@dachary.org>
Fri, 6 Dec 2013 23:21:16 +0000 (00:21 +0100)
committerLoic Dachary <loic@dachary.org>
Fri, 6 Dec 2013 23:21:16 +0000 (00:21 +0100)
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 <loic@dachary.org>
src/crush/CrushWrapper.cc

index a250d47fb64d76ce293a09941d4b54d081d0f959..a46c80134aadd6c99d05f436dcddc71b8a24d584 100644 (file)
@@ -444,11 +444,6 @@ int CrushWrapper::move_bucket(CephContext *cct, int id, const map<string,string>
   // 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);
 }