zpool_main.c (332547) | zpool_main.c (332550) |
---|---|
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 --- 2343 unchanged lines hidden (view full) --- 2352 rewind_policy = ZPOOL_TRY_REWIND; 2353 else if (do_rewind) 2354 rewind_policy = ZPOOL_DO_REWIND; 2355 if (xtreme_rewind) 2356 rewind_policy |= ZPOOL_EXTREME_REWIND; 2357 2358 /* In the future, we can capture further policy and include it here */ 2359 if (nvlist_alloc(&policy, NV_UNIQUE_NAME, 0) != 0 || | 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 --- 2343 unchanged lines hidden (view full) --- 2352 rewind_policy = ZPOOL_TRY_REWIND; 2353 else if (do_rewind) 2354 rewind_policy = ZPOOL_DO_REWIND; 2355 if (xtreme_rewind) 2356 rewind_policy |= ZPOOL_EXTREME_REWIND; 2357 2358 /* In the future, we can capture further policy and include it here */ 2359 if (nvlist_alloc(&policy, NV_UNIQUE_NAME, 0) != 0 || |
2360 nvlist_add_uint64(policy, ZPOOL_REWIND_REQUEST_TXG, txg) != 0 || 2361 nvlist_add_uint32(policy, ZPOOL_REWIND_REQUEST, rewind_policy) != 0) | 2360 nvlist_add_uint64(policy, ZPOOL_LOAD_REQUEST_TXG, txg) != 0 || 2361 nvlist_add_uint32(policy, ZPOOL_LOAD_REWIND_POLICY, 2362 rewind_policy) != 0) |
2362 goto error; 2363 2364 if (searchdirs == NULL) { 2365 searchdirs = safe_malloc(sizeof (char *)); 2366 searchdirs[0] = "/dev"; 2367 nsearch = 1; 2368 } 2369 --- 108 unchanged lines hidden (view full) --- 2478 2479 verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_STATE, 2480 &pool_state) == 0); 2481 if (!do_destroyed && pool_state == POOL_STATE_DESTROYED) 2482 continue; 2483 if (do_destroyed && pool_state != POOL_STATE_DESTROYED) 2484 continue; 2485 | 2363 goto error; 2364 2365 if (searchdirs == NULL) { 2366 searchdirs = safe_malloc(sizeof (char *)); 2367 searchdirs[0] = "/dev"; 2368 nsearch = 1; 2369 } 2370 --- 108 unchanged lines hidden (view full) --- 2479 2480 verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_STATE, 2481 &pool_state) == 0); 2482 if (!do_destroyed && pool_state == POOL_STATE_DESTROYED) 2483 continue; 2484 if (do_destroyed && pool_state != POOL_STATE_DESTROYED) 2485 continue; 2486 |
2486 verify(nvlist_add_nvlist(config, ZPOOL_REWIND_POLICY, | 2487 verify(nvlist_add_nvlist(config, ZPOOL_LOAD_POLICY, |
2487 policy) == 0); 2488 2489 if (argc == 0) { 2490 if (first) 2491 first = B_FALSE; 2492 else if (!do_all) 2493 (void) printf("\n"); 2494 --- 1471 unchanged lines hidden (view full) --- 3966 rewind_policy = ZPOOL_TRY_REWIND; 3967 else if (do_rewind) 3968 rewind_policy = ZPOOL_DO_REWIND; 3969 if (xtreme_rewind) 3970 rewind_policy |= ZPOOL_EXTREME_REWIND; 3971 3972 /* In future, further rewind policy choices can be passed along here */ 3973 if (nvlist_alloc(&policy, NV_UNIQUE_NAME, 0) != 0 || | 2488 policy) == 0); 2489 2490 if (argc == 0) { 2491 if (first) 2492 first = B_FALSE; 2493 else if (!do_all) 2494 (void) printf("\n"); 2495 --- 1471 unchanged lines hidden (view full) --- 3967 rewind_policy = ZPOOL_TRY_REWIND; 3968 else if (do_rewind) 3969 rewind_policy = ZPOOL_DO_REWIND; 3970 if (xtreme_rewind) 3971 rewind_policy |= ZPOOL_EXTREME_REWIND; 3972 3973 /* In future, further rewind policy choices can be passed along here */ 3974 if (nvlist_alloc(&policy, NV_UNIQUE_NAME, 0) != 0 || |
3974 nvlist_add_uint32(policy, ZPOOL_REWIND_REQUEST, rewind_policy) != 0) | 3975 nvlist_add_uint32(policy, ZPOOL_LOAD_REWIND_POLICY, 3976 rewind_policy) != 0) { |
3975 return (1); | 3977 return (1); |
3978 } |
|
3976 3977 pool = argv[0]; 3978 device = argc == 2 ? argv[1] : NULL; 3979 3980 if ((zhp = zpool_open_canfail(g_zfs, pool)) == NULL) { 3981 nvlist_free(policy); 3982 return (1); 3983 } --- 2167 unchanged lines hidden --- | 3979 3980 pool = argv[0]; 3981 device = argc == 2 ? argv[1] : NULL; 3982 3983 if ((zhp = zpool_open_canfail(g_zfs, pool)) == NULL) { 3984 nvlist_free(policy); 3985 return (1); 3986 } --- 2167 unchanged lines hidden --- |