]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: remove redundant test in insert_item
authorLoic Dachary <loic@dachary.org>
Thu, 5 Dec 2013 12:01:00 +0000 (13:01 +0100)
committerLoic Dachary <loic@dachary.org>
Thu, 5 Dec 2013 17:07:03 +0000 (18:07 +0100)
A year after the last modification of test to check if an item was added
twice to the same bucket, the subtree_contains test was added a few
lines above it, making it redundant.

Signed-off-by: Loic Dachary <loic@dachary.org>
src/crush/CrushWrapper.cc

index 1a9c81e36b022f17d9b082aeb5dc604ac4e96619..6ac90ccf6575689627ff6917b785a8874d95d9ce 100644 (file)
@@ -410,14 +410,6 @@ int CrushWrapper::insert_item(CephContext *cct, int item, float weight, string n
       return -EINVAL;
     }
 
-
-    // make sure the item doesn't already exist in this bucket
-    for (unsigned j=0; j<b->size; j++)
-      if (b->items[j] == cur) {
-       ldout(cct, 1) << "insert_item " << cur << " already exists in bucket " << b->id << dendl;
-       return -EEXIST;
-      }
-    
     // are we forming a loop?
     if (subtree_contains(cur, b->id)) {
       ldout(cct, 1) << "insert_item " << cur << " already contains " << b->id