int CrushWrapper::remove_item(CephContext *cct, int item, bool unlink_only)
{
- ldout(cct, 5) << "remove_item " << item << (unlink_only ? " unlink_only":"") << dendl;
+ ldout(cct, 5) << "remove_item " << item
+ << (unlink_only ? " unlink_only":"") << dendl;
int ret = -ENOENT;
if (item < 0 && !unlink_only) {
crush_bucket *t = get_bucket(item);
if (IS_ERR(t)) {
- ldout(cct, 1) << "remove_item bucket " << item << " does not exist" << dendl;
+ ldout(cct, 1) << "remove_item bucket " << item << " does not exist"
+ << dendl;
return -ENOENT;
}
assert(weight_set->size - 1 == new_size);
for (__u32 k = position; k < new_size; k++)
weight_set->weights[k] = weight_set->weights[k+1];
- weight_set->weights = (__u32*)realloc(weight_set->weights, new_size * sizeof(__u32));
+ weight_set->weights = (__u32*)realloc(weight_set->weights,
+ new_size * sizeof(__u32));
weight_set->size = new_size;
}
if (arg->ids_size) {
run_mon $dir a || return 1
run_osd $dir 0 || return 1
+ ceph osd set-require-min-compat-client luminous
ceph osd getcrushmap > $dir/map || return 1
crushtool -d $dir/map -o $dir/map.txt || return 1
sed -i -e '/end crush map/d' $dir/map.txt
run_mon $dir a || return 1
run_osd $dir 0 || return 1
+ ceph osd set-require-min-compat-client luminous
+ ceph osd crush tree
ceph osd getcrushmap > $dir/map || return 1
crushtool -d $dir/map -o $dir/map.txt || return 1
sed -i -e '/end crush map/d' $dir/map.txt
{
bucket_id -1
weight_set [
- [ 6.000 ]
- [ 7.000 ]
+ [ 2.000 ]
+ [ 1.000 ]
]
ids [ -10 ]
}
bucket_id -2
weight_set [
[ 2.000 ]
- [ 2.000 ]
+ [ 1.000 ]
]
ids [ -20 ]
}
EOF
crushtool -c $dir/map.txt -o $dir/map-new || return 1
ceph osd setcrushmap -i $dir/map-new || return 1
+ ceph osd crush tree
run_osd $dir 1 || return 1
+ ceph osd crush tree
ceph osd getcrushmap > $dir/map-one-more || return 1
crushtool -d $dir/map-one-more -o $dir/map-one-more.txt || return 1
cat $dir/map-one-more.txt
diff -u $dir/map-one-more.txt $CEPH_ROOT/src/test/crush/crush-choose-args-expected-one-more-0.txt || return 1
destroy_osd $dir 1 || return 1
+ ceph osd crush tree
ceph osd getcrushmap > $dir/map-one-less || return 1
crushtool -d $dir/map-one-less -o $dir/map-one-less.txt || return 1
diff -u $dir/map-one-less.txt $dir/map.txt || return 1