mutex_exit(&mg->mg_lock);
return (-1ULL);
}
+
+ /*
+ * If the selected metaslab is condensing, skip it.
+ */
+ if (msp->ms_map->sm_condensing)
+ continue;
+
was_active = msp->ms_weight & METASLAB_ACTIVE_MASK;
if (activation_weight == METASLAB_WEIGHT_PRIMARY)
break;
mutex_enter(&msp->ms_lock);
- /*
- * If this metaslab is currently condensing then pick again as
- * we can't manipulate this metaslab until it's committed
- * to disk.
- */
- if (msp->ms_map->sm_condensing) {
- mutex_exit(&msp->ms_lock);
- continue;
- }
-
/*
* Ensure that the metaslab we have selected is still
* capable of handling our request. It's possible that
continue;
}
+ /*
+ * If this metaslab is currently condensing then pick again as
+ * we can't manipulate this metaslab until it's committed
+ * to disk.
+ */
+ if (msp->ms_map->sm_condensing) {
+ mutex_exit(&msp->ms_lock);
+ continue;
+ }
+
if ((offset = space_map_alloc(msp->ms_map, asize)) != -1ULL)
break;