diff options
author | Alexander Motin <mav@FreeBSD.org> | 2018-03-28 22:29:06 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2018-03-28 22:29:06 +0000 |
commit | 5c4561f33215d982a12e3f3f594b73db0101553e (patch) | |
tree | bba1061621f06d4baf1faa9b31bf50d5dc0e1e97 /cddl/contrib/opensolaris/cmd/zpool | |
parent | 6cc8a8260fa707c3dd0d3153d71f3e49fa19d1eb (diff) | |
parent | d32e3273d252390ab3fa47c220b78c17a797e9e2 (diff) | |
download | src-5c4561f33215d982a12e3f3f594b73db0101553e.tar.gz src-5c4561f33215d982a12e3f3f594b73db0101553e.zip |
MFV r331706:
9235 rename zpool_rewind_policy_t to zpool_load_policy_t
illumos/illumos-gate@5dafeea3ebd2dd77affc802bcb90f63faf01589f
We want to be able to pass various settings during import/open of a pool,
which are not only related to rewind. Instead of adding a new policy and
duplicate a bunch of code, we should just rename rewind_policy to a more
generic term like load_policy.
For instance, we'd like to set spa->spa_import_flags from the nvlist,
rather from a flags parameter passed to spa_import as in some cases we want
those flags not only for the import case, but also for the open case. One
such flag could be ZFS_IMPORT_MISSING_LOG (as used in zdb) which would
allow zfs to open a pool when logs are missing.
Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>
Notes
Notes:
svn path=/head/; revision=331707
Diffstat (limited to 'cddl/contrib/opensolaris/cmd/zpool')
-rw-r--r-- | cddl/contrib/opensolaris/cmd/zpool/zpool_main.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c index ee6d1a8d54e5..51edeca384e6 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c @@ -2357,8 +2357,9 @@ zpool_do_import(int argc, char **argv) /* In the future, we can capture further policy and include it here */ if (nvlist_alloc(&policy, NV_UNIQUE_NAME, 0) != 0 || - nvlist_add_uint64(policy, ZPOOL_REWIND_REQUEST_TXG, txg) != 0 || - nvlist_add_uint32(policy, ZPOOL_REWIND_REQUEST, rewind_policy) != 0) + nvlist_add_uint64(policy, ZPOOL_LOAD_REQUEST_TXG, txg) != 0 || + nvlist_add_uint32(policy, ZPOOL_LOAD_REWIND_POLICY, + rewind_policy) != 0) goto error; if (searchdirs == NULL) { @@ -2483,7 +2484,7 @@ zpool_do_import(int argc, char **argv) if (do_destroyed && pool_state != POOL_STATE_DESTROYED) continue; - verify(nvlist_add_nvlist(config, ZPOOL_REWIND_POLICY, + verify(nvlist_add_nvlist(config, ZPOOL_LOAD_POLICY, policy) == 0); if (argc == 0) { @@ -3971,8 +3972,10 @@ zpool_do_clear(int argc, char **argv) /* In future, further rewind policy choices can be passed along here */ if (nvlist_alloc(&policy, NV_UNIQUE_NAME, 0) != 0 || - nvlist_add_uint32(policy, ZPOOL_REWIND_REQUEST, rewind_policy) != 0) + nvlist_add_uint32(policy, ZPOOL_LOAD_REWIND_POLICY, + rewind_policy) != 0) { return (1); + } pool = argv[0]; device = argc == 2 ? argv[1] : NULL; |