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:
parent
8af75968ac
commit
b9bff8e8cb
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user