1
0
mirror of https://github.com/ceph/ceph synced 2025-01-03 01:22:53 +00:00

crush: remove redundant test in insert_item

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>
This commit is contained in:
Loic Dachary 2013-12-05 13:01:00 +01:00
parent 8af75968ac
commit b9bff8e8cb

View 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