spa.c (247187) | spa.c (247265) |
---|---|
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 --- 8 unchanged lines hidden (view full) --- 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 22/* 23 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 24 * Copyright (c) 2012 by Delphix. All rights reserved. | 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 --- 8 unchanged lines hidden (view full) --- 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 22/* 23 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 24 * Copyright (c) 2012 by Delphix. All rights reserved. |
25 * Copyright (c) 2013 Martin Matuska <mm@FreeBSD.org>. All rights reserved. |
|
25 */ 26 27/* 28 * This file contains all the routines used when modifying on-disk SPA state. 29 * This includes opening, importing, destroying, exporting a pool, and syncing a 30 * pool. 31 */ 32 --- 103 unchanged lines hidden (view full) --- 136#ifdef SYSDC 137boolean_t zio_taskq_sysdc = B_TRUE; /* use SDC scheduling class */ 138#endif 139uint_t zio_taskq_basedc = 80; /* base duty cycle */ 140 141boolean_t spa_create_process = B_TRUE; /* no process ==> no sysdc */ 142extern int zfs_sync_pass_deferred_free; 143 | 26 */ 27 28/* 29 * This file contains all the routines used when modifying on-disk SPA state. 30 * This includes opening, importing, destroying, exporting a pool, and syncing a 31 * pool. 32 */ 33 --- 103 unchanged lines hidden (view full) --- 137#ifdef SYSDC 138boolean_t zio_taskq_sysdc = B_TRUE; /* use SDC scheduling class */ 139#endif 140uint_t zio_taskq_basedc = 80; /* base duty cycle */ 141 142boolean_t spa_create_process = B_TRUE; /* no process ==> no sysdc */ 143extern int zfs_sync_pass_deferred_free; 144 |
145#ifndef illumos 146extern void spa_deadman(void *arg); 147#endif 148 |
|
144/* 145 * This (illegal) pool name is used when temporarily importing a spa_t in order 146 * to get the vdev stats associated with the imported devices. 147 */ 148#define TRYIMPORT_NAME "$import" 149 150/* 151 * ========================================================================== --- 6101 unchanged lines hidden (view full) --- 6253 } 6254 spa_config_exit(spa, SCL_CONFIG | SCL_STATE, FTAG); 6255 spa_config_enter(spa, SCL_CONFIG | SCL_STATE, FTAG, RW_READER); 6256 } 6257 spa_config_exit(spa, SCL_STATE, FTAG); 6258 6259 tx = dmu_tx_create_assigned(dp, txg); 6260 | 149/* 150 * This (illegal) pool name is used when temporarily importing a spa_t in order 151 * to get the vdev stats associated with the imported devices. 152 */ 153#define TRYIMPORT_NAME "$import" 154 155/* 156 * ========================================================================== --- 6101 unchanged lines hidden (view full) --- 6258 } 6259 spa_config_exit(spa, SCL_CONFIG | SCL_STATE, FTAG); 6260 spa_config_enter(spa, SCL_CONFIG | SCL_STATE, FTAG, RW_READER); 6261 } 6262 spa_config_exit(spa, SCL_STATE, FTAG); 6263 6264 tx = dmu_tx_create_assigned(dp, txg); 6265 |
6266 spa->spa_sync_starttime = gethrtime(); 6267#ifdef illumos 6268 VERIFY(cyclic_reprogram(spa->spa_deadman_cycid, 6269 spa->spa_sync_starttime + spa->spa_deadman_synctime)); 6270#else /* FreeBSD */ 6271#ifdef _KERNEL 6272 callout_reset(&spa->spa_deadman_cycid, 6273 hz * spa->spa_deadman_synctime / NANOSEC, spa_deadman, spa); 6274#endif 6275#endif 6276 |
|
6261 /* 6262 * If we are upgrading to SPA_VERSION_RAIDZ_DEFLATE this txg, 6263 * set spa_deflate if we have no raid-z vdevs. 6264 */ 6265 if (spa->spa_ubsync.ub_version < SPA_VERSION_RAIDZ_DEFLATE && 6266 spa->spa_uberblock.ub_version >= SPA_VERSION_RAIDZ_DEFLATE) { 6267 int i; 6268 --- 112 unchanged lines hidden (view full) --- 6381 6382 if (error == 0) 6383 break; 6384 zio_suspend(spa, NULL); 6385 zio_resume_wait(spa); 6386 } 6387 dmu_tx_commit(tx); 6388 | 6277 /* 6278 * If we are upgrading to SPA_VERSION_RAIDZ_DEFLATE this txg, 6279 * set spa_deflate if we have no raid-z vdevs. 6280 */ 6281 if (spa->spa_ubsync.ub_version < SPA_VERSION_RAIDZ_DEFLATE && 6282 spa->spa_uberblock.ub_version >= SPA_VERSION_RAIDZ_DEFLATE) { 6283 int i; 6284 --- 112 unchanged lines hidden (view full) --- 6397 6398 if (error == 0) 6399 break; 6400 zio_suspend(spa, NULL); 6401 zio_resume_wait(spa); 6402 } 6403 dmu_tx_commit(tx); 6404 |
6405#ifdef illumos 6406 VERIFY(cyclic_reprogram(spa->spa_deadman_cycid, CY_INFINITY)); 6407#else /* FreeBSD */ 6408#ifdef _KERNEL 6409 callout_drain(&spa->spa_deadman_cycid); 6410#endif 6411#endif 6412 |
|
6389 /* 6390 * Clear the dirty config list. 6391 */ 6392 while ((vd = list_head(&spa->spa_config_dirty_list)) != NULL) 6393 vdev_config_clean(vd); 6394 6395 /* 6396 * Now that the new config has synced transactionally, --- 250 unchanged lines hidden --- | 6413 /* 6414 * Clear the dirty config list. 6415 */ 6416 while ((vd = list_head(&spa->spa_config_dirty_list)) != NULL) 6417 vdev_config_clean(vd); 6418 6419 /* 6420 * Now that the new config has synced transactionally, --- 250 unchanged lines hidden --- |