spa_config.c (332525) | spa_config.c (332536) |
---|---|
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 --- 348 unchanged lines hidden (view full) --- 357 358 return (pools); 359} 360 361void 362spa_config_set(spa_t *spa, nvlist_t *config) 363{ 364 mutex_enter(&spa->spa_props_lock); | 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 --- 348 unchanged lines hidden (view full) --- 357 358 return (pools); 359} 360 361void 362spa_config_set(spa_t *spa, nvlist_t *config) 363{ 364 mutex_enter(&spa->spa_props_lock); |
365 nvlist_free(spa->spa_config); | 365 if (spa->spa_config != NULL && spa->spa_config != config) 366 nvlist_free(spa->spa_config); |
366 spa->spa_config = config; 367 mutex_exit(&spa->spa_props_lock); 368} 369 370/* 371 * Generate the pool's configuration based on the current in-core state. 372 * 373 * We infer whether to generate a complete config or just one top-level config --- 30 unchanged lines hidden (view full) --- 404 fnvlist_add_uint64(config, ZPOOL_CONFIG_POOL_STATE, spa_state(spa)); 405 fnvlist_add_uint64(config, ZPOOL_CONFIG_POOL_TXG, txg); 406 fnvlist_add_uint64(config, ZPOOL_CONFIG_POOL_GUID, spa_guid(spa)); 407 if (spa->spa_comment != NULL) { 408 fnvlist_add_string(config, ZPOOL_CONFIG_COMMENT, 409 spa->spa_comment); 410 } 411 | 367 spa->spa_config = config; 368 mutex_exit(&spa->spa_props_lock); 369} 370 371/* 372 * Generate the pool's configuration based on the current in-core state. 373 * 374 * We infer whether to generate a complete config or just one top-level config --- 30 unchanged lines hidden (view full) --- 405 fnvlist_add_uint64(config, ZPOOL_CONFIG_POOL_STATE, spa_state(spa)); 406 fnvlist_add_uint64(config, ZPOOL_CONFIG_POOL_TXG, txg); 407 fnvlist_add_uint64(config, ZPOOL_CONFIG_POOL_GUID, spa_guid(spa)); 408 if (spa->spa_comment != NULL) { 409 fnvlist_add_string(config, ZPOOL_CONFIG_COMMENT, 410 spa->spa_comment); 411 } 412 |
412#ifdef _KERNEL | |
413 hostid = zone_get_hostid(NULL); | 413 hostid = zone_get_hostid(NULL); |
414#else /* _KERNEL */ 415 /* 416 * We're emulating the system's hostid in userland, so we can't use 417 * zone_get_hostid(). 418 */ 419 (void) ddi_strtoul(hw_serial, NULL, 10, &hostid); 420#endif /* _KERNEL */ | 414 |
421 if (hostid != 0) { 422 fnvlist_add_uint64(config, ZPOOL_CONFIG_HOSTID, hostid); 423 } 424 fnvlist_add_string(config, ZPOOL_CONFIG_HOSTNAME, utsname.nodename); 425 426 int config_gen_flags = 0; 427 if (vd != rvd) { 428 fnvlist_add_uint64(config, ZPOOL_CONFIG_TOP_GUID, --- 135 unchanged lines hidden --- | 415 if (hostid != 0) { 416 fnvlist_add_uint64(config, ZPOOL_CONFIG_HOSTID, hostid); 417 } 418 fnvlist_add_string(config, ZPOOL_CONFIG_HOSTNAME, utsname.nodename); 419 420 int config_gen_flags = 0; 421 if (vd != rvd) { 422 fnvlist_add_uint64(config, ZPOOL_CONFIG_TOP_GUID, --- 135 unchanged lines hidden --- |