if (spa_writeable(spa)) {
dmu_tx_t *tx;
int need_update = B_FALSE;
+ int c;
ASSERT(state != SPA_LOAD_TRYIMPORT);
state == SPA_LOAD_IMPORT)
need_update = B_TRUE;
- for (int c = 0; c < rvd->vdev_children; c++)
+ for (c = 0; c < rvd->vdev_children; c++)
if (rvd->vdev_child[c]->vdev_ms_array == 0)
need_update = B_TRUE;
vdev_t *vd, *tvd;
nvlist_t **spares, **l2cache;
uint_t nspares, nl2cache;
+ int c;
txg = spa_vdev_enter(spa);
/*
* Transfer each new top-level vdev from vd to rvd.
*/
- for (int c = 0; c < vd->vdev_children; c++) {
+ for (c = 0; c < vd->vdev_children; c++) {
tvd = vd->vdev_child[c];
vdev_remove_child(vd, tvd);
tvd->vdev_id = rvd->vdev_children;
boolean_t unspare = B_FALSE;
uint64_t unspare_guid;
size_t len;
+ int t;
txg = spa_vdev_enter(spa);
* But first make sure we're not on any *other* txg's DTL list, to
* prevent vd from being accessed after it's freed.
*/
- for (int t = 0; t < TXG_SIZE; t++)
+ for (t = 0; t < TXG_SIZE; t++)
(void) txg_list_remove_this(&tvd->vdev_dtl_list, vd, t);
vd->vdev_detached = B_TRUE;
vdev_dirty(tvd, VDD_DTL, vd, txg);