metaslab_t *msp = NULL;
uint64_t offset = -1ULL;
uint64_t activation_weight;
- boolean_t tertiary = B_FALSE;
activation_weight = METASLAB_WEIGHT_PRIMARY;
for (int i = 0; i < d; i++) {
activation_weight = METASLAB_WEIGHT_SECONDARY;
} else if (activation_weight == METASLAB_WEIGHT_SECONDARY &&
DVA_GET_VDEV(&dva[i]) == mg->mg_vd->vdev_id) {
- tertiary = B_TRUE;
+ activation_weight = METASLAB_WEIGHT_CLAIM;
break;
}
}
* If we don't have enough metaslabs active to fill the entire array, we
* just use the 0th slot.
*/
- if (mg->mg_ms_ready < mg->mg_allocators * 2) {
- tertiary = B_FALSE;
+ if (mg->mg_ms_ready < mg->mg_allocators * 3)
allocator = 0;
- }
ASSERT3U(mg->mg_vd->vdev_ms_count, >=, 2);
msp = mg->mg_primaries[allocator];
was_active = B_TRUE;
} else if (activation_weight == METASLAB_WEIGHT_SECONDARY &&
- mg->mg_secondaries[allocator] != NULL && !tertiary) {
+ mg->mg_secondaries[allocator] != NULL) {
msp = mg->mg_secondaries[allocator];
was_active = B_TRUE;
} else {
continue;
}
- if (msp->ms_weight & METASLAB_WEIGHT_CLAIM) {
+ if (msp->ms_weight & METASLAB_WEIGHT_CLAIM &&
+ activation_weight != METASLAB_WEIGHT_CLAIM) {
metaslab_passivate(msp, msp->ms_weight &
~METASLAB_WEIGHT_CLAIM);
mutex_exit(&msp->ms_lock);