Deleted Added
full compact
spa.c (314858) spa.c (321529)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 1291 unchanged lines hidden (view full) ---

1300 * Stop syncing.
1301 */
1302 if (spa->spa_sync_on) {
1303 txg_sync_stop(spa->spa_dsl_pool);
1304 spa->spa_sync_on = B_FALSE;
1305 }
1306
1307 /*
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 1291 unchanged lines hidden (view full) ---

1300 * Stop syncing.
1301 */
1302 if (spa->spa_sync_on) {
1303 txg_sync_stop(spa->spa_dsl_pool);
1304 spa->spa_sync_on = B_FALSE;
1305 }
1306
1307 /*
1308 * Even though vdev_free() also calls vdev_metaslab_fini, we need
1309 * to call it earlier, before we wait for async i/o to complete.
1310 * This ensures that there is no async metaslab prefetching, by
1311 * calling taskq_wait(mg_taskq).
1312 */
1313 if (spa->spa_root_vdev != NULL) {
1314 spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER);
1315 for (int c = 0; c < spa->spa_root_vdev->vdev_children; c++)
1316 vdev_metaslab_fini(spa->spa_root_vdev->vdev_child[c]);
1317 spa_config_exit(spa, SCL_ALL, FTAG);
1318 }
1319
1320 /*
1308 * Wait for any outstanding async I/O to complete.
1309 */
1310 if (spa->spa_async_zio_root != NULL) {
1311 for (int i = 0; i < max_ncpus; i++)
1312 (void) zio_wait(spa->spa_async_zio_root[i]);
1313 kmem_free(spa->spa_async_zio_root, max_ncpus * sizeof (void *));
1314 spa->spa_async_zio_root = NULL;
1315 }

--- 6050 unchanged lines hidden ---
1321 * Wait for any outstanding async I/O to complete.
1322 */
1323 if (spa->spa_async_zio_root != NULL) {
1324 for (int i = 0; i < max_ncpus; i++)
1325 (void) zio_wait(spa->spa_async_zio_root[i]);
1326 kmem_free(spa->spa_async_zio_root, max_ncpus * sizeof (void *));
1327 spa->spa_async_zio_root = NULL;
1328 }

--- 6050 unchanged lines hidden ---